New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOC] added usage examples to multiple estimator docstrings #6187
Changes from 6 commits
3c4dfb5
102d0fa
d195505
b57b3b1
05dd008
ac57c69
567fe64
31025dd
66305a5
fef4926
7e34737
ed1dc6c
ae1da4b
9a10001
301ef51
336c2dd
8018f41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,22 @@ class ShapeDTW(BaseClassifier): | |
.. [1] Jiaping Zhao and Laurent Itti, "shapeDTW: Shape Dynamic Time Warping", | ||
Pattern Recognition, 74, pp 171-184, 2018 | ||
http://www.sciencedirect.com/science/article/pii/S0031320317303710, | ||
|
||
Examples | ||
-------- | ||
>>> from sktime.classification.distance_based import ShapeDTW | ||
>>> from sktime.datasets import load_unit_test # doctest: +SKIP | ||
>>> X_train, y_train = load_unit_test(split="train") # doctest: +SKIP | ||
>>> X_test, y_test = load_unit_test(split="test") # doctest: +SKIP | ||
>>> clf = ShapeDTW(n_neighbors=1, | ||
... subsequence_length=30, | ||
... shape_descriptor_function="raw", | ||
... shape_descriptor_functions=None, | ||
... metric_params=None | ||
... ) # doctest: +SKIP | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'll be good to add indentation after |
||
>>> clf.fit(X_train, y_train) # doctest: +SKIP | ||
ShapeDTW(...) | ||
>>> y_pred = clf.predict(X_test) # doctest: +SKIP | ||
""" | ||
|
||
_tags = { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,21 @@ class labels (multi-output problem). | |
---------- | ||
.. [1] Deng et. al, A time series forest for classification and feature extraction, | ||
Information Sciences, 239:2013. | ||
|
||
Examples | ||
-------- | ||
>>> from sktime.classification.ensemble import ComposableTimeSeriesForestClassifier | ||
>>> from sktime.classification.kernel_based import RocketClassifier | ||
>>> from sktime.datasets import load_unit_test | ||
>>> X_train, y_train = load_unit_test(split="train") # doctest: +SKIP | ||
>>> X_test, y_test = load_unit_test(split="test") # doctest: +SKIP | ||
>>> clf = ComposableTimeSeriesForestClassifier( | ||
... RocketClassifier(num_kernels=100), | ||
... n_estimators=10, | ||
... ) # doctest: +SKIP | ||
>>> clf.fit(X_train, y_train) # doctest: +SKIP | ||
MihirsinhChauhan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ComposableTimeSeriesForestClassifier(...) | ||
>>> y_pred = clf.predict(X_test) # doctest: +SKIP | ||
MihirsinhChauhan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
|
||
_tags = { | ||
|
@@ -188,7 +203,7 @@ class labels (multi-output problem). | |
|
||
def __init__( | ||
self, | ||
estimator=None, | ||
estimator, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if this is acceptable in a example addition PR. Plus it's potentially a breaking change as it now wants makes estimator a positional argument from a keyword argument. In fact this is what causes the test failure in CI FYI @fkiraly |
||
n_estimators=100, | ||
max_depth=None, | ||
min_samples_split=2, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this
noqa
for? Is it for line length? Please fix by splitting into multiple lines instead of adding noqa.Also, I think doctest need not be skipped in this line, but it's okay to have as well.