我使用 scikit-learn 开发了一个 RandomForestClassifier 模型来执行分类任务。该模型当前的精度低于预期。我相信调整超参数(例如 n_estimators 和 max_depth)可以提高性能,但我需要有关 scikit-learn 中超参数调整最有效方法的指导。
看看 scikit-learn 中的网格搜索:https://scikit-learn.org/stable/modules/ generated/sklearn.model_selection.GridSearchCV.html。您可以指定一个值列表来搜索每个感兴趣的参数,它将使用所有可能的组合来训练模型。