【机器学习】回归方法

sklearn 回归方法


示例原文链接
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
### 决策树回归 ###
from sklearn import tree
model_DecisionTreeRegressor = tree.DecisionTreeRegressor()

### 线性回归 ###
from sklearn import linear_model
model_LinearRegression = linear_model.LinearRegression()

### SVM回归 ###
from sklearn import svm
model_SVR = svm.SVR()

### KNN回归 ###
from sklearn import neighbors
model_KNeighborsRegressor = neighbors.KNeighborsRegressor()

### 随机森林回归 ###
from sklearn import ensemble
model_RandomForestRegressor = ensemble.RandomForestRegressor(n_estimators=20)#用20个决策树

### Adaboost回归 ###
from sklearn import ensemble
model_AdaBoostRegressor = ensemble.AdaBoostRegressor(n_estimators=50)#用50个决策树

### GBRT回归 ###
from sklearn import ensemble
model_GradientBoostingRegressor = ensemble.GradientBoostingRegressor(n_estimators=100)#用100个决策树

### Bagging回归 ###
from sklearn.ensemble import BaggingRegressor
model_BaggingRegressor = BaggingRegressor()

### ExtraTree极端随机树回归 ###
from sklearn.tree import ExtraTreeRegressor
model_ExtraTreeRegressor = ExtraTreeRegressor()