Skip to content
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

Deprecate functions for specific versions of Dynamic Time Warping #63

Merged
merged 15 commits into from Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
74 changes: 74 additions & 0 deletions doc/_static/custom.css
Expand Up @@ -10,6 +10,34 @@ div.topic ul{
margin-top: -10px;
}


/* Properties for API changes */

.deprecated {
color: rgba(190, 0, 0, 1);
background-color: rgba(255, 0, 0, 0.2);
border: 1px solid;
border-color: rgba(255, 0, 0, 1);
padding: 8px 8px 0px 8px;
border-radius: 5px;
margin-bottom: 8px;
}

.deprecated p span.versionmodified {
font-weight: bold;
}

.deprecated p a code {
background-color: transparent;
border-bottom: none;
}

.deprecated span.pre {
background-color: transparent;
border-bottom: none;
}


/* Properties for hyperlinks */

a.reference {
Expand Down Expand Up @@ -153,6 +181,31 @@ div.body dl.function dt[id^="pyts"] {
margin-bottom: 15px;
}

div[id^="dtw-method"] table.docutils dl dt {
border-radius: 0px !important;
padding: 0px !important;
background-color: transparent !important;
margin-top: 0px !important;
margin-bottom: 0px !important;
}


div[id^="dtw-method"] dl.function dt {
border-radius: 5px;
padding: 10px;
background-color: rgba(47, 47, 47, 0.08);
margin-top: 0px;
margin-bottom: 15px;
}


/* Properties for rubric in autodoc */

p.rubric {
font-size: 18px;
margin-bottom: 4px;
}


/* Properties for code blocks in Examples section of an object */

Expand All @@ -170,6 +223,10 @@ div.highlight pre {

/* Properties for tables */

table.docutils.citation {
margin: 0px !important;
}

table.docutils col.field-name {
background-color: rgba(47, 79, 79, 0.1);
}
Expand Down Expand Up @@ -265,3 +322,20 @@ div.sphx-glr-download-link-note.admonition.note p.admonition-title {
font-weight: 900;
color: rgba(47, 79, 79, 1);
}

/* Properties for See also blocks */

div.admonition.seealso {
background-color: rgba(226, 237, 33, 0.4);
border-radius: 4px;
padding: 10px;
}

div.admonition.seealso p.first.admonition-title{
font-size: 14px;
font-weight: bold;
}

div.admonition.seealso code {
background-color: transparent;
}
3 changes: 3 additions & 0 deletions doc/conf.py
Expand Up @@ -30,13 +30,16 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'numpydoc',
'pytsdtwdoc',
'sphinx_gallery.gen_gallery',
]

Expand Down
10 changes: 10 additions & 0 deletions doc/metrics.dtw-classic.rst
@@ -0,0 +1,10 @@
:orphan:

.. _metrics.dtw-classic:

dtw(method='classic')
---------------------

.. pyts-metrics:function:: pyts.metrics.dtw
:impl: pyts.metrics.dtw._dtw_classic
:method: classic
10 changes: 10 additions & 0 deletions doc/metrics.dtw-fast.rst
@@ -0,0 +1,10 @@
:orphan:

.. _metrics.dtw-fast:

dtw(method='fast')
------------------

.. pyts-metrics:function:: pyts.metrics.dtw
:impl: pyts.metrics.dtw._dtw_fast
:method: fast
10 changes: 10 additions & 0 deletions doc/metrics.dtw-itakura.rst
@@ -0,0 +1,10 @@
:orphan:

.. _metrics.dtw-itakura:

dtw(method='itakura')
---------------------

.. pyts-metrics:function:: pyts.metrics.dtw
:impl: pyts.metrics.dtw._dtw_itakura
:method: itakura
10 changes: 10 additions & 0 deletions doc/metrics.dtw-multiscale.rst
@@ -0,0 +1,10 @@
:orphan:

.. _metrics.dtw-multiscale:

dtw(method='multiscale')
------------------------

.. pyts-metrics:function:: pyts.metrics.dtw
:impl: pyts.metrics.dtw._dtw_multiscale
:method: multiscale
10 changes: 10 additions & 0 deletions doc/metrics.dtw-region.rst
@@ -0,0 +1,10 @@
:orphan:

.. _metrics.dtw-region:

dtw(method='region')
--------------------

.. pyts-metrics:function:: pyts.metrics.dtw
:impl: pyts.metrics.dtw._dtw_region
:method: region
10 changes: 10 additions & 0 deletions doc/metrics.dtw-sakoechiba.rst
@@ -0,0 +1,10 @@
:orphan:

.. _metrics.dtw-sakoechiba:

dtw(method='sakoechiba')
------------------------

.. pyts-metrics:function:: pyts.metrics.dtw
:impl: pyts.metrics.dtw._dtw_sakoechiba
:method: sakoechiba
6 changes: 3 additions & 3 deletions doc/modules/classification.rst
Expand Up @@ -27,7 +27,7 @@ a good baseline for time series classification::
>>> from pyts.datasets import load_gunpoint
>>> X_train, X_test, y_train, y_test = load_gunpoint(return_X_y=True)
>>> clf = KNeighborsClassifier(metric='dtw')
>>> clf.fit(X_train, y_train) # doctest: +ELLIPSIS
>>> clf.fit(X_train, y_train)
KNeighborsClassifier(...)
>>> clf.score(X_test, y_test)
0.91...
Expand Down Expand Up @@ -63,7 +63,7 @@ is the class yielding the highest cosine similarity.
>>> from pyts.datasets import load_gunpoint
>>> X_train, X_test, y_train, y_test = load_gunpoint(return_X_y=True)
>>> clf = SAXVSM(window_size=34, sublinear_tf=False, use_idf=False)
>>> clf.fit(X_train, y_train) # doctest: +ELLIPSIS
>>> clf.fit(X_train, y_train)
SAXVSM(...)
>>> clf.score(X_test, y_test)
0.76
Expand Down Expand Up @@ -96,7 +96,7 @@ the words are generated with the :ref:`approximation_sfa` algorithm.
>>> from pyts.datasets import load_gunpoint
>>> X_train, X_test, y_train, y_test = load_gunpoint(return_X_y=True)
>>> clf = BOSSVS(window_size=28)
>>> clf.fit(X_train, y_train) # doctest: +ELLIPSIS
>>> clf.fit(X_train, y_train)
BOSSVS(...)
>>> clf.score(X_test, y_test)
0.98
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/multivariate.rst
Expand Up @@ -28,7 +28,7 @@ performed at prediction time.
>>> from pyts.multivariate.classification import MultivariateClassifier
>>> X_train, X_test, y_train, y_test = load_basic_motions(return_X_y=True)
>>> clf = MultivariateClassifier(BOSSVS())
>>> clf.fit(X_train, y_train) # doctest: +ELLIPSIS
>>> clf.fit(X_train, y_train)
MultivariateClassifier(...)
>>> clf.score(X_test, y_test)
1.0
Expand Down
6 changes: 3 additions & 3 deletions doc/modules/transformation.rst
Expand Up @@ -134,11 +134,11 @@ corresponding words::
>>> from pyts.transformation import BOSS
>>> X_train, X_test, _, _ = load_gunpoint(return_X_y=True)
>>> boss = BOSS(word_size=2, n_bins=2, sparse=False)
>>> boss.fit(X_train) # doctest: +ELLIPSIS
>>> boss.fit(X_train)
BOSS(...)
>>> sorted(boss.vocabulary_.values())
['aa', 'ab', 'ba', 'bb']
>>> boss.transform(X_test) # doctest: +ELLIPSIS
>>> boss.transform(X_test)
array(...)

Classification can be performed with any standard classifier. In the example
Expand All @@ -153,7 +153,7 @@ below, we use a k-nearest neighbors classifier with the
>>> boss = BOSS(word_size=8, window_size=40, norm_mean=True, drop_sum=True, sparse=False)
>>> knn = KNeighborsClassifier(metric='boss')
>>> clf = make_pipeline(boss, knn)
>>> clf.fit(X_train, y_train) # doctest: +ELLIPSIS
>>> clf.fit(X_train, y_train)
Pipeline(...)
>>> clf.score(X_test, y_test)
1.0
Expand Down