Skip to content

Commit

Permalink
DOC: fix typos (#137)
Browse files Browse the repository at this point in the history
Closes #136
  • Loading branch information
adriangb authored Nov 26, 2020
1 parent 15cbe19 commit 8d47423
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions docs/source/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ remain uninstantiated. This is to make sure that the arguments you
pass are not touched afterwards, which makes it possible to clone the
wrapper instance, for example in a :py:class:`~sklearn.model_selection.GridSearchCV`.

Only when the :py:func:`~scikeras.wrappers.KerasClassifier.fit` or
:py:func:`~scikeras.wrappers.KerasRegressor.fit` method are called, are the
different attributes of the wrapper, such as the ``model``, initialized.
Only when the :py:func:`~scikeras.wrappers.BaseWrapper.fit` or
:py:func:`~scikeras.wrappers.BaseWrapper.initialize` methods are called, are the
different attributes of the wrapper, such as ``model_``, initialized.
An initialized attribute's name always ends on an underscore; e.g., the
initialized ``model`` is called ``model_``. (This is the same
nomenclature as sklearn uses.) Therefore, you always know which
Expand Down Expand Up @@ -194,8 +194,8 @@ one for ``X`` (features) and one for ``y`` (target).
By implementing a custom transformer, you can split a single input ``X`` into multiple inputs
for :py:class:`tensorflow.keras.Model` or perform any other manipulation you need.
To override the default transformers, simply override
:py:func:`scikeras.wrappers.BaseWrappers.target_transformer` or
:py:func:`scikeras.wrappers.BaseWrappers.function_transformer` for ``y`` and ``X`` respectively.
:py:func:`scikeras.wrappers.BaseWrappers.target_encoder` or
:py:func:`scikeras.wrappers.BaseWrappers.feature_encoder` for ``y`` and ``X`` respectively.

SciKeras uses :py:func:`sklearn.utils.multiclass.type_of_target` to categorize the target
type, and implements basic handling of the following cases out of the box:
Expand Down
4 changes: 2 additions & 2 deletions scikeras/utils/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def fit(self, y: np.ndarray) -> "ClassifierLabelEncoder":
raise ValueError(
f"Unknown label type: {target_type}."
"\n\nTo implement support, subclass KerasClassifier and override"
" ``target_transformer`` with a transformer that supports this"
" ``target_encoder`` with a transformer that supports this"
" label type."
"\n\nFor information on sklearn target types, see:"
" * https://scikit-learn.org/stable/modules/generated/sklearn.utils.multiclass.type_of_target.html"
Expand Down Expand Up @@ -267,7 +267,7 @@ def inverse_transform(
f"Class-predictions are not clearly defined for"
" 'multiclass-multioutput' target types."
"\n\nTo implement support, subclass KerasClassifier and override"
" ``target_transformer`` with a transformer that supports this"
" ``target_encoder`` with a transformer that supports this"
" label type."
"\n\nFor information on sklearn target types, see:"
" * https://scikit-learn.org/stable/modules/generated/sklearn.utils.multiclass.type_of_target.html"
Expand Down

0 comments on commit 8d47423

Please sign in to comment.