有人可以告诉我为什么尽管有大量的bootstrap样本,但结果与此代码的两次发布有很大不同:
from sklearn.ensemble import BaggingRegressor
from sklearn.neural_network import MLPRegressor
estimator = BaggingRegressor(MLPRegressor(),max_samples =10000,max_features=6)
X_train = X_train[['zkurt','zmean','zscale','zshape','zskew','zvar1']]
y_train = y_train[['vary']]
X_test = X_test[['zkurt','zmean','zscale','zshape','zskew','zvar1']]
y_test = y_test[['vary']]
estimator.fit(X_train, y_train.values.ravel())
y_predict = estimator.predict(X_test)
r2=estimator.score(X_test, y_test.values.ravel())
预测和r2从一个发射器到另一个发射器变化很大。
感谢您的帮助。