Data Science Asked by data2fx on June 30, 2021
I am doing a prediction using RandomForestRegressor.
Below is the code for test data:
X = test_set.drop(['C_Nxt10DMx'], axis=1) # drop labels for training set
Y = test_set['C_Nxt10DMx'].copy()
test_prepared = full_pipeline.transform(X)
final_predictions = forest_reg.predict(test_prepared)
final_mse = mean_squared_error(Y, final_predictions)
final_rmse = np.sqrt(final_mse)
(forest_rmse*100)/Y.mean()
I am printing Y.isnull().sum()
and it is returning a 0 value. However, when I trying to bind the value in a data frame, it is returning an incorrect figure.
df = pd.DataFrame()
df['pred'] = final_predictions
df['Label'] = Y
print(Y.isnull().sum())
print(df['Label'].isnull().sum())
# 7646
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP