regression
¶
The Turi Create regression toolkit contains models for regression problems.
Currently, we support linear regression and boosted trees. In addition to these
models, we provide a smart interface that selects the right model based on the
data. If you are unsure about which model to use, simply use
create()
function.
Training data must contain a column for the ‘target’ variable and one or more columns representing feature variables.
# Set up the data
>>> import turicreate as tc
>>> data = tc.SFrame('https://static.turi.com/datasets/regression/houses.csv')
# Select the best model based on your data.
>>> model = tc.regression.create(data, target='price',
... features=['bath', 'bedroom', 'size'])
# Make predictions and evaluate results.
>>> predictions = model.predict(data)
>>> results = model.evaluate(data)
creating a regression model¶
regression.create |
Automatically create a suitable regression model based on the provided training data. |
random forest¶
random_forest_regression.create |
Create a RandomForestRegression to predict a scalar target variable using one or more features. |
random_forest_regression.RandomForestRegression |
Encapsulates random forest models for regression tasks. |
decision tree¶
decision_tree_regression.create |
Create a DecisionTreeRegression to predict a scalar target variable using one or more features. |
decision_tree_regression.DecisionTreeRegression |
The prediction is based on a collection of base learners, regression trees. |
boosted trees¶
boosted_trees_regression.create |
Create a BoostedTreesRegression to predict a scalar target variable using one or more features. |
boosted_trees_regression.BoostedTreesRegression |
Encapsulates gradient boosted trees for regression tasks. |
linear regression¶
linear_regression.create |
Create a LinearRegression to predict a scalar target variable as a linear function of one or more features. |
linear_regression.LinearRegression |
Linear regression is an approach for modeling a scalar target \(y\) as a linear function of one or more explanatory variables denoted \(X\). |