Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scikit learn 为什么RandomForestClassifier中max_特征的默认值与RandomForestRegressionor中的不同?_Scikit Learn - Fatal编程技术网

Scikit learn 为什么RandomForestClassifier中max_特征的默认值与RandomForestRegressionor中的不同?

Scikit learn 为什么RandomForestClassifier中max_特征的默认值与RandomForestRegressionor中的不同?,scikit-learn,Scikit Learn,在RandomForestClassifier中,max_features的默认值是sqrt(n_features),而在RandomForestRegressionor中,它是n_features,有什么具体原因吗?这是基于经验结果的启发式方法。平均而言,作为默认设置,将分类设置为max_features=sqrt(n_features),将回归设置为max_features=n_features似乎是一个更好的选择 这一启发源于本文: 在任何情况下,交叉验证此参数当然总是一个更好的主意 注意

RandomForestClassifier
中,
max_features
的默认值是
sqrt(n_features)
,而在
RandomForestRegressionor
中,它是
n_features
,有什么具体原因吗?

这是基于经验结果的启发式方法。平均而言,作为默认设置,将分类设置为max_features=sqrt(n_features),将回归设置为max_features=n_features似乎是一个更好的选择

这一启发源于本文:


在任何情况下,交叉验证此参数当然总是一个更好的主意

注意,您可能需要设置:

max_features = 'sqrt'  
而不是建议的:

max_features=sqrt(n_features)

取决于您正在运行的版本。

谢谢您的参考!如果我使用的随机林具有max_features=n_features和bootstrap=False,那么从本质上说它的行为类似于一棵决策树(只需要大量的计算开销)是否正确?是的,在这种情况下,所有树都是相同的(将寻找最佳分割时可能发生的某些联系进行模化)。如果max_features=n_features,那么随机子空间方法甚至没有被使用?