Skip to content

Commit

Permalink
Version 0.6.
Browse files Browse the repository at this point in the history
Merge branch 'release/0.6'
  • Loading branch information
vnmabus committed Sep 12, 2021
2 parents e0e5328 + 115b482 commit 3aedb62
Show file tree
Hide file tree
Showing 156 changed files with 16,654 additions and 8,071 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.6', '3.7', '3.8']
python-version: ['3.7', '3.8']

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,5 @@ pip-wheel-metadata/

# macOS DS_Store
.DS_Store
.gitignore
.vscode/settings.json
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include README.rst
include MANIFEST.in
include VERSION
include skfda/py.typed
include pyproject.toml
include *.txt
recursive-include deps *
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Requirements
* `fdasrsf <https://github.com/jdtuck/fdasrsf_python>`_ - SRSF framework
* `findiff <https://github.com/maroba/findiff>`_ - Finite differences
* `matplotlib <https://github.com/matplotlib/matplotlib>`_ - Plotting with Python
* `mpldatacursor <https://github.com/joferkington/mpldatacursor/>`_ - Interactive data cursors for matplotlib
* `multimethod <https://github.com/coady/multimethod>`_ - Multiple dispatch
* `numpy <https://github.com/numpy/numpy>`_ - The fundamental package for scientific computing with Python
* `pandas <https://github.com/pandas-dev/pandas>`_ - Powerful Python data analysis toolkit
Expand Down
8 changes: 7 additions & 1 deletion THANKS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ Carlos Ramos Carreño for the design, reviews and supervision, and for contribut
Pablo Marcos Manchón for the registration functions, including integration with fdasrsf.
Amanda Hernando Bernabé for visualization and clustering functions.
Pablo Pérez Manso for regression and related utilities.
Sergio Ruiz Lozano for the design of the logo.
Yujian Hong for the Principal Component Analysis functionalities.
David García Fernandez for implementing Anova and Hotelling tests.
Pedro Martín Rodríguez-Ponga Eyriès for implementing several classification methods.
Álvaro Sánchez Romero for improving the visualization methods and adding interactive visualizations.
Elena Petrunina for improving the documentation, and regression functions.
Luis Alberto Rodriguez Ramirez for providing mathematical support.
Sergio Ruiz Lozano for the design of the logo.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5
0.6
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/auto_examples/
/auto_tutorial/
/backreferences/
**/autosummary/
1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ help:
clean:
rm -rf $(BUILDDIR)/*
rm -rf auto_examples
rm -rf auto_tutorial
rm -rf modules/autosummary
rm -rf modules/exploratory/visualization/autosummary
rm -rf modules/exploratory/autosummary
Expand Down
13 changes: 2 additions & 11 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,9 @@
{%- endfor %}
{% endif %}

.. automethod:: __init__
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: Attributes

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{% for item in methods %}
.. automethod:: {{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

.. include:: {{package}}/backreferences/{{fullname}}.examples
52 changes: 46 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import sys

import pkg_resources
# -- Extensions to the Napoleon GoogleDocstring class ---------------------
from sphinx.ext.napoleon.docstring import GoogleDocstring

try:
release = pkg_resources.get_distribution('scikit-fda').version
except pkg_resources.DistributionNotFound:
Expand Down Expand Up @@ -54,7 +57,10 @@
'sphinx.ext.intersphinx',
'sphinx.ext.doctest',
'jupyter_sphinx',
'sphinx.ext.autodoc.typehints']
'sphinx.ext.autodoc.typehints',
'sphinxcontrib.bibtex']

bibtex_bibfiles = ['refs.bib']

autodoc_default_flags = ['members', 'inherited-members']

Expand Down Expand Up @@ -221,32 +227,66 @@
'sklearn': ('https://scikit-learn.org/stable', None),
'matplotlib': ('https://matplotlib.org/', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
'mpldatacursor': ('https://pypi.org/project/mpldatacursor/', None),
}


tutorial_list = [
"plot_introduction.py",
"plot_getting_data.py",
"plot_basis_representation.py",
"plot_skfda_sklearn.py",
]


class SkfdaExplicitSubOrder(object):
"""
Class for use within the 'within_subsection_order' key.
Inspired by Matplotlib gallery.
"""

def __init__(self, src_dir: str) -> None:
self.src_dir = src_dir # src_dir is unused here
self.ordered_list = tutorial_list

def __call__(self, filename: str) -> str:
"""Return a string determining the sort order."""
if filename in self.ordered_list:
ind = self.ordered_list.index(filename)
return f"{ind:04d}"

# ensure not explicitly listed items come last.
return f"zzz{filename}"


sphinx_gallery_conf = {
# path to your examples scripts
'examples_dirs': '../examples',
'examples_dirs': ['../examples', '../tutorial'],
# path where to save gallery generated examples
'gallery_dirs': 'auto_examples',
'gallery_dirs': ['auto_examples', 'auto_tutorial'],
'reference_url': {
# The module you locally document uses None
'skfda': None,
},
'backreferences_dir': 'backreferences',
'doc_module': 'skfda',
'within_subsection_order': SkfdaExplicitSubOrder,
}

autosummary_generate = True
autodoc_typehints = "description"
napoleon_use_rtype = True

autodoc_type_aliases = {
"ArrayLike": "ArrayLike",
"GridPointsLike": "Union[ArrayLike, Sequence[ArrayLike]]",
}

# Napoleon fix for attributes
# Taken from
# https://michaelgoerz.net/notes/extending-sphinx-napoleon-docstring-sections.html

# -- Extensions to the Napoleon GoogleDocstring class ---------------------
from sphinx.ext.napoleon.docstring import GoogleDocstring

# first, we define new methods for any new sections and add them to the class

Expand Down
6 changes: 6 additions & 0 deletions docs/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ General Concepts
domain
The set of possible input values of a function.

domain range
The valid range where a function can be evaluated. It is a Python
sequence that contains, for each dimension of the domain, a tuple with
the minimum and maximum values for that dimension. Usually used in
plotting functions and as the domain of integration for this function.

FDA
Functional Data Analysis
The branch of statistics that deals with curves, surfaces or other
Expand Down
28 changes: 21 additions & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,27 @@ or clustering of functional data.
In the `project page <https://github.com/GAA-UAM/scikit-fda>`_ hosted by
Github you can find more information related to the development of the package.

.. toctree::
:caption: Using scikit-fda
:hidden:

auto_tutorial/index

.. toctree::
:maxdepth: 2
:caption: Contents:
:maxdepth: 1
:titlesonly:
:hidden:

apilist
glossary

auto_examples/index

.. toctree::
:maxdepth: 1
:maxdepth: 2
:titlesonly:
:hidden:
:caption: More documentation

auto_examples/index
apilist
glossary

An exhaustive list of all the contents of the package can be found in the
:ref:`genindex`.
Expand Down Expand Up @@ -58,6 +64,14 @@ In this type of installation make sure that your default Python version is
currently supported, or change the python and pip commands by specifying a
version, such as python3.6.

How do I start?
---------------

If you want a quick overview of the package, we recommend you to try the
new :doc:`tutorial <auto_tutorial/index>`. For articles about specific
topics, feel free to explore the :doc:`examples <auto_examples/index>`. Want
to check the documentation of a particular class or function? Try searching
for it in the :doc:`API list <apilist>`.

Contributions
-------------
Expand Down
8 changes: 4 additions & 4 deletions docs/modules/exploratory/visualization/clustering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Clustering Plots
================
In order to show the results of the cluster algorithms in a visual way,
:mod:`this module <skfda.exploratory.visualization.clustering_plots>` is
implemented. It contains the following methods:
implemented. It contains the following classes:

.. autosummary::
:toctree: autosummary

skfda.exploratory.visualization.clustering.plot_clusters
skfda.exploratory.visualization.clustering.plot_cluster_lines
skfda.exploratory.visualization.clustering.plot_cluster_bars
skfda.exploratory.visualization.clustering.ClusterPlot
skfda.exploratory.visualization.clustering.ClusterMembershipLinesPlot
skfda.exploratory.visualization.clustering.ClusterMembershipPlot

In the first one, the samples of the FDataGrid are divided by clusters which
are assigned different colors. The following functions, are only valid for the
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/exploratory/visualization/fpca.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Functional Principal Component Analysis plots
=============================================
In order to show the modes of variation that the principal components represent,
the following function is implemented
the following class is implemented

.. autosummary::
:toctree: autosummary

skfda.exploratory.visualization.fpca.plot_fpca_perturbation_graphs
skfda.exploratory.visualization.fpca.FPCAPlot

See the example :ref:`sphx_glr_auto_examples_plot_fpca.py` for detailed
explanation.
Expand Down
49 changes: 42 additions & 7 deletions docs/modules/misc/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,33 @@ This module contains multiple functional distances and norms.
Lp Spaces
---------

The following functions computes the norms and distances used in Lp spaces.
The following classes compute the norms and metrics used in Lp spaces. One
first has to create an instance for the class, specifying the desired value
for ``p``, and use this instance to evaluate the norm or distance over
:term:`functional data objects`.

.. autosummary::
:toctree: autosummary

skfda.misc.metrics.lp_norm
skfda.misc.metrics.lp_distance
skfda.misc.metrics.LpNorm
skfda.misc.metrics.LpDistance

As the :math:`L_1`, :math:`L_2` and :math:`L_{\infty}` norms are very common
in :term:`FDA`, instances for these have been created, called respectively
``l1_norm``, ``l2_norm`` and ``linf_norm``. The same is true for metrics,
having ``l1_distance``, ``l2_distance`` and ``linf_distance`` already
created.

The following functions are wrappers for convenience, in case that one
only wants to evaluate the norm/metric for a value of ``p``. These functions
cannot be used in objects or methods that require a norm or metric, as the
value of ``p`` must be explicitly passed in each call.

.. autosummary::
:toctree: autosummary

skfda.misc.metrics.lp_norm
skfda.misc.metrics.lp_distance

Elastic distances
-----------------
Expand All @@ -32,11 +50,28 @@ analysis and registration of functional data.
skfda.misc.metrics.warping_distance


Utils
-----
Metric induced by a norm
------------------------

If a norm has been defined, it is possible to construct a metric between two
elements simply subtracting one from the other and computing the norm of the
result. Such a metric is called the metric induced by the norm, and the
:math:`Lp` distance is an example of these. The following class can be used
to construct a metric from a norm in this way:

.. autosummary::
:toctree: autosummary

skfda.misc.metrics.NormInducedMetric


Pairwise metric
---------------

Some tasks require the computation of all possible distances between pairs
of objets. The following class can compute that efficiently:

.. autosummary::
:toctree: autosummary

skfda.misc.metrics.distance_from_norm
skfda.misc.metrics.pairwise_distance
skfda.misc.metrics.PairwiseMetric
4 changes: 4 additions & 0 deletions docs/modules/ml/classification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ it is explained the basic usage of these estimators.
skfda.ml.classification.KNeighborsClassifier
skfda.ml.classification.RadiusNeighborsClassifier
skfda.ml.classification.NearestCentroid
skfda.ml.classification.DTMClassifier
skfda.ml.classification.DDClassifier
skfda.ml.classification.DDGClassifier
skfda.ml.classification.MaximumDepthClassifier
15 changes: 15 additions & 0 deletions docs/modules/ml/clustering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,18 @@ searches.
:toctree: autosummary

skfda.ml.clustering.NearestNeighbors

Hierarchical clustering
-----------------------

Hierarchical clusterings are constructed by iteratively merging or splitting
clusters given a metric between their elements, in order to cluster together
elements that are close from each other. This is repeated until a desired
number of clusters is obtained. The resulting hierarchy of clusters can be
represented as a tree, called a dendogram. The following hierarchical
clusterings are supported:

.. autosummary::
:toctree: autosummary

skfda.ml.clustering.AgglomerativeClustering
4 changes: 3 additions & 1 deletion docs/modules/ml/regression.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ Linear regression

A linear regression model is one in which the response variable can be
expressed as a linear combination of the covariates (which could be
multivariate or functional).
multivariate or functional). The following linear models are available
in scikit-fda:

.. autosummary::
:toctree: autosummary

skfda.ml.regression.LinearRegression
skfda.ml.regression.HistoricalLinearRegression

Nearest Neighbors
-----------------
Expand Down
Loading

0 comments on commit 3aedb62

Please sign in to comment.