Skip to content

Instantly share code, notes, and snippets.

@wibowotangara
Created January 24, 2024 04:42
Show Gist options
  • Save wibowotangara/98c35098b0548d2bfbd6834e726feea0 to your computer and use it in GitHub Desktop.
Save wibowotangara/98c35098b0548d2bfbd6834e726feea0 to your computer and use it in GitHub Desktop.
rfc = RandomForestClassifier(random_state=42)
rfc.fit(X_train, Y_train)
y_pred_proba = rfc.predict_proba(X_test)[:][:,1]
df_actual_predicted = pd.concat([pd.DataFrame(np.array(Y_test), columns=['y_actual']),
pd.DataFrame(y_pred_proba, columns=['y_pred_proba'])], axis=1)
df_actual_predicted.index = Y_test.index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment