<jupyter_start><jupyter_text>Modelling<jupyter_code>X = SchoolDF_sub3.drop('COMPL_RPY_3YR_RT', axis=1)
y = SchoolDF_sub3['COMPL_RPY_3YR_RT']
X_train, X_valid, y_train, y_valid = train_test_split(X, y, test_size=0.3, random_state=1)
rfr = RandomForestRegressor()
rfr.fit(X_train, y_train)
y_pred = rfr.predict(X_valid)
math.sqrt(mean_squared_error(y_pred, y_valid))
pd.DataFrame(X.columns, rfr.feature_importances_).reset_index().rename(columns={'index':'imp', 0:'feature'})[['feature', 'imp']].sort_values(by='imp', ascending=False).head(10)
pickle.dump(rfr, open('model', 'wb'))
pickle.load()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup