Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
forecasting:regression [2020/12/02 00:47]
jclaudio [Decision Tree Regression]
forecasting:regression [2021/09/19 21:59] (current)
Line 81: Line 81:
  
 ==== Decision Tree Regression ==== ==== Decision Tree Regression ====
-**Form:** Universal. Can be used with any form. Just need to adjust the SVM Kernel accordingly.+**Form:** Universal. Can be used with any form.\\
 **When to use it:** Used when you want to divide your dataset into smaller subs-sets in the form of a tree structure\\ **When to use it:** Used when you want to divide your dataset into smaller subs-sets in the form of a tree structure\\
 **Library used:** [[https://​scikit-learn.org/​stable/​modules/​generated/​sklearn.tree.DecisionTreeRegressor.html#​sklearn.tree.DecisionTreeRegressor|sklearn.tree.DecisionTreeRegressor]]\\ **Library used:** [[https://​scikit-learn.org/​stable/​modules/​generated/​sklearn.tree.DecisionTreeRegressor.html#​sklearn.tree.DecisionTreeRegressor|sklearn.tree.DecisionTreeRegressor]]\\
Line 93: Line 93:
 {{ :​forecasting:​dectreeregoutput.png?​400 |}} {{ :​forecasting:​dectreeregoutput.png?​400 |}}
 //Note that we can easily visualize our results by using a 2D plot. This type of plot is only possible when we have no more than **1** independent variable.// //Note that we can easily visualize our results by using a 2D plot. This type of plot is only possible when we have no more than **1** independent variable.//
 +
 ==== Random Forest Regression ==== ==== Random Forest Regression ====
 +**Form:** Universal. Can be used with any form.\\
 +**When to use it:** Used when you want to have multiple random decision trees to improve your regression results.\\
 +**Library used:** [[https://​scikit-learn.org/​stable/​modules/​generated/​sklearn.ensemble.RandomForestRegressor.html#​sklearn.ensemble.RandomForestRegressor|sklearn.ensemble.RandomForestRegressor]]\\
 +**General workflow:**
 +  - Import **RandomForestRegressor** class from **sklearn.ensemble**
 +  - Create an instance of the **RandomForestRegressor()** class
 +  - Apply the **.fit** method to your independent and dependent variables
 +  - Apply the **.predict** method to your regressor to make any predictions about your data
 +**Sample Code and Output:**
 +{{ :​forecasting:​randforestregcode.png?​1600 |}}
 +{{ :​forecasting:​randforestregoutput.png?​400 |}}
 +//Note that we can easily visualize our results by using a 2D plot. This type of plot is only possible when we have no more than **1** independent variable.//
  • forecasting/regression.1606870028.txt.gz
  • Last modified: 2021/09/19 21:59
  • (external edit)