Pre-built helper classes are constructed using PyDAAL and usage example(s) are provided in each folder.
Generic methods handled in each class are:
- Training: fits the data to create a model
- Prediction: uses training results to predict responses
- Quality Metrics: evaluates model quality based on the type of model
- Model Storage and Portability: enables model storage and retrieval with serialization and compression
Each folder in 2-pre-built-helper-class contains:
- A pre-built helper class.
- Related usage example(s) for practical purpose implementing all methods of the pre-built helper class.
- Documentation on methods, parameters and possible arguments.
Download 2-pre-built-helper-class/<algorithms> in your working directory. Import the respective class and start building your models
For example: To build a linear regression model
- Download 2-pre-built-helper-class/LinearRegression
- Import the class file LinearRegression.py in your python program
from LinearRegression import LinearRegression
- Create LinearRegression object and start building your model
#Instantiate Linear Regression object
lr = LinearRegression()
#Training
trainingResults = lr.training(trainData, trainDependentVariables)
#Prediction
predResponses = lr.prediction(trainingResults, testData)
#Predict with Metrics
predRes, predResRed, qualityMet = lr.predictWithQualityMetrics(trainingResult, trainData,trainDependentVariables,reducedBetaIndex=[2,10])
#Print Metrics results
lr.printAllQualityMetrics(qualityMet)
#Serialize
lr.serialize(trainingResults, fileName = "storeTrainingResults.npy")
#Deserialize
retrieveTrainingResults = lr.deserialize(fileName = "storeTrainingResults.npy")
For practice, Run the examples from 2-pre-built-helper-class/<algorithm>/<usage example>.
No. These examples may not cover all possible approaches, kindly refer to the documentation provided in 2-pre-built-helper-class/<algorithm>/<documentation> or the comment section above each method in the class file.