July 2017
Beginner to intermediate
715 pages
17h 3m
English
Smile is a general purpose machine learning library, so it has regression models as well. You can have a look at the list of models, here: https://github.com/haifengl/smile.
For example, this is how you can create a simple linear regression:
OLS ols = new OLS(data.getX(), data.getY());
For regularized regression, you can use ridge or LASSO:
double lambda = 0.01; RidgeRegression ridge = new RidgeRegression(data.getX(), data.getY(), lambda); LASSO lasso = new LASSO(data.getX(), data.getY(), lambda);
Using a RandomForest is very similar to the classification case:
int nbtrees = 100; RandomForest rf = new RandomForest.Trainer(nbtrees) .setNumRandomFeatures(15) .setMaxNodes(128) .setNodeSize(10) .setSamplingRates(0.6) .train(data.getX(), ...
Read now
Unlock full access