Skip to content

Commit 9a40907

Browse files
committed
Fixed small import and missing module errors
1 parent 8607d4a commit 9a40907

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/python/ml-pca.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ For more details about the linear algebra behind eigenvectors and loadings, see
222222

223223
```python
224224
import plotly.express as px
225+
import numpy as np
225226
from sklearn.decomposition import PCA
226227
from sklearn import datasets
227228
from sklearn.preprocessing import StandardScaler

doc/python/ml-roc-pr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,12 @@ df.loc[samples.index, 'species'] = samples.values
260260
# Define the inputs and outputs
261261
X = df.drop(columns=['species', 'species_id'])
262262
y = df['species']
263-
y_onehot = pd.get_dummies(y, columns=model.classes_)
264263

265264
# Fit the model
266265
model = LogisticRegression(max_iter=200)
267266
model.fit(X, y)
268267
y_scores = model.predict_proba(X)
268+
y_onehot = pd.get_dummies(y, columns=model.classes_)
269269

270270
# Create an empty figure, and iteratively add new lines
271271
# every time we compute a new class

0 commit comments

Comments
 (0)