【发布时间】:2019-07-22 05:31:07
【问题描述】:
房价挑战 Kaggle 我正在尝试使用 RandomForestClassifier 预测价格。预测后,所有 id 的价格都相同。你知道这个问题吗?
clf = RandomForestClassifier(n_estimators=50)
clf = clf.fit(X_train,y_train)
clf.score(X_train, y_train)
X = df_test2[feature_cols]
imp = Imputer(missing_values='NaN', strategy='mean', axis=0)
df_imp = imp.fit_transform(X)
df_test_scale = scaler.transform(df_imp)
y_pred = clf.predict(df_test_scale)
predict_prices = pd.DataFrame({"Id" : df_test2['Id'], "SalePrice":y_pred})
predict_prices
【问题讨论】: