优化代码KNeighborsClassifier(algorithm='auto', leaf_size=30, metric='minkowski', metric_params=None, n_jobs=1, n_neighbors=5, p=2, weights='uniform') GradientBoostingClassifier(criterion='friedman_mse', init=None, learning_rate=0.1, loss='deviance', max_depth=3, max_features=None, max_leaf_nodes=None, min_impurity_decrease=0.0, min_impurity_split=None, min_samples_leaf=1,min_samples_split=2, min_weight_fraction_leaf=0.0,n_estimators=100, presort='auto', random_state=None,subsample=1.0, verbose=0, warm_start=False),出错TypeError: __init__() got an unexpected keyword argument 'min_impurity_split'
时间: 2024-04-28 16:26:12 浏览: 179
优化算法的代码
这个错误是因为在 GradientBoostingClassifier 中的参数 min_impurity_split 已经被弃用,应该使用参数 min_impurity_decrease 来代替。你只需要将参数名 min_impurity_split 改为 min_impurity_decrease 即可解决该问题。
阅读全文