From ce87fcd261a3c6991ec22035a5f7f99fb24c02f1 Mon Sep 17 00:00:00 2001 From: xhlulu Date: Wed, 21 Oct 2020 11:19:37 -0400 Subject: [PATCH] Fix error in "Multiclass ROC Curve", change markdown version --- doc/python/ml-roc-pr.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/python/ml-roc-pr.md b/doc/python/ml-roc-pr.md index a7211af7b65..f31e35a12de 100644 --- a/doc/python/ml-roc-pr.md +++ b/doc/python/ml-roc-pr.md @@ -5,8 +5,8 @@ jupyter: text_representation: extension: .md format_name: markdown - format_version: '1.2' - jupytext_version: 1.4.2 + format_version: '1.1' + jupytext_version: 1.1.1 kernelspec: display_name: Python 3 language: python @@ -142,13 +142,15 @@ df.loc[samples.index, 'species'] = samples.values # Define the inputs and outputs X = df.drop(columns=['species', 'species_id']) y = df['species'] -y_onehot = pd.get_dummies(y, columns=model.classes_) # Fit the model model = LogisticRegression(max_iter=200) model.fit(X, y) y_scores = model.predict_proba(X) +# One hot encode the labels in order to plot them +y_onehot = pd.get_dummies(y, columns=model.classes_) + # Create an empty figure, and iteratively add new lines # every time we compute a new class fig = go.Figure() @@ -272,4 +274,4 @@ fig.show() Learn more about `px`, `px.area`, `px.hist`: * https://plot.ly/python/histograms/ * https://plot.ly/python/filled-area-plots/ -* https://plot.ly/python/line-charts/ \ No newline at end of file +* https://plot.ly/python/line-charts/