Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodmillman committed Jan 10, 2025
1 parent 005fa22 commit 6772f46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/scikit-learn/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -999,13 +999,13 @@ overall performance of an algorithm. It appears in the bottom row
of the classification report; it can also be accessed directly::

>>> metrics.f1_score(y_test, y_pred, average="macro")
np.float64(0.991367...)
0.991367...

The over-fitting we saw previously can be quantified by computing the
f1-score on the training data itself::

>>> metrics.f1_score(y_train, clf.predict(X_train), average="macro")
np.float64(1.0)
1.0

.. note::

Expand Down Expand Up @@ -1164,8 +1164,8 @@ We can find the optimal parameters this way::
>>> for Model in [Ridge, Lasso]:
... gscv = GridSearchCV(Model(), dict(alpha=alphas), cv=3).fit(X, y)
... print('%s: %s' % (Model.__name__, gscv.best_params_))
Ridge: {'alpha': np.float64(0.06210169418915616)}
Lasso: {'alpha': np.float64(0.01268961003167922)}
Ridge: {'alpha': np.float64(0.06210169418915616})
Lasso: {'alpha': np.float64(0.01268961003167922})

Built-in Hyperparameter Search
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 6772f46

Please sign in to comment.