【机器学习】回归方法 发表于 2018-04-09 sklearn 回归方法 示例原文链接1234567891011121314151617181920212223242526272829303132333435### 决策树回归 ###from sklearn import treemodel_DecisionTreeRegressor = tree.DecisionTreeRegressor()### 线性回归 ###from sklearn import linear_modelmodel_LinearRegression = linear_model.LinearRegression()### SVM回归 ###from sklearn import svmmodel_SVR = svm.SVR()### KNN回归 ###from sklearn import neighborsmodel_KNeighborsRegressor = neighbors.KNeighborsRegressor()### 随机森林回归 ###from sklearn import ensemblemodel_RandomForestRegressor = ensemble.RandomForestRegressor(n_estimators=20)#用20个决策树### Adaboost回归 ###from sklearn import ensemblemodel_AdaBoostRegressor = ensemble.AdaBoostRegressor(n_estimators=50)#用50个决策树### GBRT回归 ###from sklearn import ensemblemodel_GradientBoostingRegressor = ensemble.GradientBoostingRegressor(n_estimators=100)#用100个决策树### Bagging回归 ###from sklearn.ensemble import BaggingRegressormodel_BaggingRegressor = BaggingRegressor()### ExtraTree极端随机树回归 ###from sklearn.tree import ExtraTreeRegressormodel_ExtraTreeRegressor = ExtraTreeRegressor()