Skip to content

Commit

Permalink
[DOC] Examples added to docstrings for Time Series Forest Regressor a…
Browse files Browse the repository at this point in the history
…nd Dummy Regressor (#4775)

Additions to #4264 

Added examples to docstrings in _tsf.py and _dummy.py. Fixed a typo in
docstring for ResNetRegressor example.
  • Loading branch information
mgazian000 committed Jun 27, 2023
1 parent 3249323 commit 13ccc89
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2199,6 +2199,15 @@
"contributions": [
"doc"
]
},
{
"login": "mgazian000",
"name": "Michael Gaziani",
"avatar_url": "https://avatars.githubusercontent.com/mgazian000",
"profile": "https://github.com/mgazian000",
"contributions": [
"doc"
]
}
]
}
2 changes: 1 addition & 1 deletion sktime/regression/deep_learning/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ResNetRegressor(BaseDeepRegressor):
>>> from sktime.regression.deep_learning.resnet import ResNetRegressor
>>> from sktime.datasets import load_unit_test
>>> X_train, y_train = load_unit_test(split="train")
>>> clf = ResNetRegressor(n_epochs=20, bacth_size=4) # doctest: +SKIP
>>> clf = ResNetRegressor(n_epochs=20, batch_size=4) # doctest: +SKIP
>>> clf.fit(X_train, Y_train) # doctest: +SKIP
ResNetRegressor(...)
"""
Expand Down
11 changes: 11 additions & 0 deletions sktime/regression/dummy/_dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ class DummyRegressor(BaseRegressor):
The quantile to predict using the "quantile" strategy. A quantile of
0.5 corresponds to the median, while 0.0 to the minimum and 1.0 to the
maximum.
Examples
--------
>>> from sktime.regression.dummy import DummyRegressor
>>> from sktime.datasets import load_unit_test
>>> X_train, y_train = load_unit_test(split="train")
>>> X_test, y_test = load_unit_test(split="test")
>>> regressor = DummyRegressor(strategy="median") # doctest: +SKIP
>>> regressor.fit(X_train,y_train) # doctest: +SKIP
DummyRegressor(strategy='median')
>>> y_pred = regressor.predict(X_test) # doctest: +SKIP
"""

_tags = {
Expand Down
11 changes: 11 additions & 0 deletions sktime/regression/interval_based/_tsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ class TimeSeriesForestRegressor(BaseTimeSeriesForest, ForestRegressor, BaseRegre
classification and feature extraction", Information Sciences, 239, 2013
.. [2] Java implementation https://github.com/uea-machine-learning/tsml
.. [3] Arxiv paper: https://arxiv.org/abs/1302.2277
Examples
--------
>>> from sktime.regression.interval_based import TimeSeriesForestRegressor
>>> from sktime.datasets import load_unit_test
>>> X_train, y_train = load_unit_test(split="train")
>>> X_test, y_test = load_unit_test(split="test")
>>> regressor = TimeSeriesForestRegressor(n_estimators=150) # doctest: +SKIP
>>> regressor.fit(X_train, y_train) # doctest: +SKIP
TimeSeriesForestRegressor(n_estimators=150)
>>> y_pred = regressor.predict(X_test) # doctest: +SKIP
"""

_tags = {
Expand Down

0 comments on commit 13ccc89

Please sign in to comment.