Skip to content

jiyoulee/vhost-cpu-requirements-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project experiments with predicting the CPU quota requirements of the Linux virtual machine I/O thread vHost using machine learning.

Development Environment

  • Python 3.8
  • Pycharm Community Edition 2020.2

Machine Learning Concepts

The following three supervised regression algorithms are used:

  • Linear Regression Model (LR)
  • Support Vector Machine Regression (SVM)
  • Random Forest Regression (RF)

For each model, its input values represent the packet size, TX bandwidth, TX pps, and the vCPU usage (located underneath the data folder in CVS format), while its predicted values as well as its target values represent the optimal CPU quota value. Either the Root Mean Square Logarithmic Error (RMLSE) or just the Root Mean Square Error (RMSE) can be selected as the evaluation metric.

Getting Started

  1. Install the following Python packages: openpyxl, numpy, pandas, scikit-learn, joblib.
  2. Navigate to the folder that includes the desired evaluation metric in its name. For example, if RMLSE is desired, follow the rest of this guideline with the files underneath the folder cpu_quota_rmsle.
  3. Open the Python file that has the desired supervised regression algorithm as its name. For example, if Linear Regression is desired, open the Python file linear.py.

Training and Cross-validating a Model

(Validation is only available for SVM and RF).

  1. Uncomment the Cross validate and Save model sections.
  2. Comment the Test, Evaluate, and Save sections.
  3. Execute the Python file.

The cross-validated model will be saved underneath the folder model with the name set as the value of the variable model_name.

Testing a Saved(Validated) Model

  1. Comment the Cross validate and Save model sections.
  2. Uncomment the Test, Evaluate, and Save sections.
  3. Execute the Python file.

Results will be saved in the path given as the argument to wb.save(), located at the end of the Python file.

References

Keras

MLP

Supervised Regression Algorithms

Random Forest

Linear Regression

Support Vector Regression

Python Libraries

Import

Split

Normalize

Train

Evaluate (RMSE)

Save

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages