本文整理汇总了Python中sklearn.ensemble.ExtraTreesRegressor.n_jobs方法的典型用法代码示例。如果您正苦于以下问题:Python ExtraTreesRegressor.n_jobs方法的具体用法?Python ExtraTreesRegressor.n_jobs怎么用?Python ExtraTreesRegressor.n_jobs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sklearn.ensemble.ExtraTreesRegressor
的用法示例。
在下文中一共展示了ExtraTreesRegressor.n_jobs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from sklearn.ensemble import ExtraTreesRegressor [as 别名]
# 或者: from sklearn.ensemble.ExtraTreesRegressor import n_jobs [as 别名]
print "The dimension of the feature matrix is ",fMatrix.shape
print "The dimension of the target matrix is ",opatches.shape
if 0:
print "Training a Extra Tree Regressor for sklearn"
s=time.time()
RF=ExtraTreesRegressor(24, max_depth=10, min_samples_split=20, min_samples_leaf=10, max_features=pw*pw*3, bootstrap=True, n_jobs=-1,random_state=41)
RF.fit(fMatrix, opatches)
print "done %.2f sec"%( time.time()-s)
pickle.dump(RF, open("data/serielized_rf.pkl","wb"))
else:
RF=pickle.load(open("data/serielized_rf.pkl","r"))
RF.n_jobs=1 #Strange but if parallel is slower
if visualize:
try: #for visualization
pylab.ion()
pylab.figure(figsize=(12,6))
except:
pass
ntrueall=[]
npredall=[]