Topological Data Analysis for Python🐍

Overview

DOI Pypi Downloads

Scikit-TDA is a home for Topological Data Analysis Python libraries intended for non-topologists.

This project aims to provide a curated library of TDA Python tools that are widely usable and easily approachable. It is structured so that each package can stand alone or be used as part of the scikit-tda bundle.

Documentation

For complete documentation please checkout scikit-tda.org.

Contact

If you would like to contribute, please reach out to us on github, twitter or on Slack.

Setup

To install all these libraries

    pip install scikit-tda

Citations

If you would like to cite Scikit-TDA, please use the following citation/bibtex

Saul, Nathaniel and Tralie, Chris. (2019). Scikit-TDA: Topological Data Analysis for Python. Zenodo. http://doi.org/10.5281/zenodo.2533369

@misc{scikittda2019,
  author       = {Nathaniel Saul, Chris Tralie},
  title        = {Scikit-TDA: Topological Data Analysis for Python},
  year         = 2019,
  doi          = {10.5281/zenodo.2533369},
  url          = {https://doi.org/10.5281/zenodo.2533369}
}

License

This package is licensed with the MIT license.

Contributing

Contributions are more than welcome! There are lots of opportunities for potential projects, so please get in touch if you would like to help out. Everything from code to notebooks to examples and documentation are all equally valuable so please don't feel you can't contribute. To contribute please fork the project make your changes and submit a pull request. We will do our best to work through any issues with you and get your code merged into the main branch.

Comments
  • error installing scikit-tda/ripser

    error installing scikit-tda/ripser

    Hi

    First of all, thanks for building this application. I've seen previous issues been posted before that were similar but I really wasn't able to figure it out. I get the following error trying to install scikit-tda:

    `(base) MacBook-Pro-van-Tom:~ Tom$ pip3 --version
    pip 21.0.1 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)
    (base) MacBook-Pro-van-Tom:~ Tom$ pip3 install scikit-tda
    Collecting scikit-tda
      Using cached scikit_tda-0.1.0-py3-none-any.whl (2.9 kB)
    Collecting cechmate
      Using cached cechmate-0.1.0-py3-none-any.whl (23 kB)
    Collecting phat
      Using cached phat-1.5.0a.tar.gz (4.7 MB)
    WARNING: Discarding https://files.pythonhosted.org/packages/43/82/c14de81dc2953a71a060f72f2bc34c41996307956b162751f2a47e2c78f7/phat-1.5.0a.tar.gz#sha256=51e7fe5e05adf5c7e0895765572fff05b979731234251f13011610d71d4980ab (from https://pypi.org/simple/phat/). Requested phat from https://files.pythonhosted.org/packages/43/82/c14de81dc2953a71a060f72f2bc34c41996307956b162751f2a47e2c78f7/phat-1.5.0a.tar.gz#sha256=51e7fe5e05adf5c7e0895765572fff05b979731234251f13011610d71d4980ab (from scikit-tda) has inconsistent version: filename has '1.5.0a0', but metadata has '1.5.0'
    Collecting scikit-tda
      Using cached scikit_tda-0.0.3-py3-none-any.whl (2.6 kB)
    Collecting ripser
      Using cached ripser-0.6.0.tar.gz (71 kB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
        Preparing wheel metadata ... done
    Collecting Cython
      Using cached Cython-0.29.22-py2.py3-none-any.whl (980 kB)
    Collecting tadasets
      Using cached tadasets-0.0.4-py3-none-any.whl (7.1 kB)
    Collecting persim
      Using cached persim-0.2.0-py3-none-any.whl (31 kB)
    Collecting scikit-learn
      Using cached scikit_learn-0.24.1-cp39-cp39-macosx_10_13_x86_64.whl (7.3 MB)
    Collecting numba
      Using cached numba-0.51.2.tar.gz (2.1 MB)
    Collecting scipy
      Using cached scipy-1.6.1-cp39-cp39-macosx_10_9_x86_64.whl (30.9 MB)
    Collecting kmapper
      Using cached kmapper-1.4.1-py3-none-any.whl (95 kB)
    Collecting umap-learn
      Using cached umap_learn-0.5.1-py3-none-any.whl
    Collecting matplotlib
      Using cached matplotlib-3.3.4-cp39-cp39-macosx_10_9_x86_64.whl (8.5 MB)
    Collecting pillow
      Using cached Pillow-8.1.0-cp39-cp39-macosx_10_10_x86_64.whl (2.2 MB)
    Collecting numpy
      Using cached numpy-1.20.1-cp39-cp39-macosx_10_9_x86_64.whl (16.1 MB)
    Collecting Jinja2
      Using cached Jinja2-2.11.3-py2.py3-none-any.whl (125 kB)
    Collecting MarkupSafe>=0.23
      Using cached MarkupSafe-1.1.1-cp39-cp39-macosx_10_9_x86_64.whl (16 kB)
    Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3
      Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
    Collecting python-dateutil>=2.1
      Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
    Collecting cycler>=0.10
      Using cached cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
    Collecting kiwisolver>=1.0.1
      Using cached kiwisolver-1.3.1-cp39-cp39-macosx_10_9_x86_64.whl (61 kB)
    Collecting six
      Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
    Collecting llvmlite<0.35,>=0.34.0.dev0
      Using cached llvmlite-0.34.0.tar.gz (107 kB)
    Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from numba->scikit-tda) (49.2.1)
    Collecting deprecated
      Using cached Deprecated-1.2.11-py2.py3-none-any.whl (9.1 kB)
    Collecting joblib
      Using cached joblib-1.0.1-py3-none-any.whl (303 kB)
    Collecting hopcroftkarp
      Using cached hopcroftkarp-1.2.5-py2.py3-none-any.whl
    Collecting wrapt<2,>=1.10
      Using cached wrapt-1.12.1-py3-none-any.whl
    Collecting threadpoolctl>=2.0.0
      Using cached threadpoolctl-2.1.0-py3-none-any.whl (12 kB)
    Collecting pynndescent>=0.5
      Using cached pynndescent-0.5.2-py3-none-any.whl
    Using legacy 'setup.py install' for numba, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for llvmlite, since package 'wheel' is not installed.
    Building wheels for collected packages: ripser
      Building wheel for ripser (PEP 517) ... error
      ERROR: Command errored out with exit status 1:
       command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/mf/t7pnn0d50j19hqjm70yjbbbw0000gn/T/tmpfheg2jtg
           cwd: /private/var/folders/mf/t7pnn0d50j19hqjm70yjbbbw0000gn/T/pip-install-ikgb1occ/ripser_b696215e91084205a9847d1f777061bc
      Complete output (16 lines):
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-3.9
      creating build/lib.macosx-10.9-universal2-3.9/ripser
      copying ripser/_version.py -> build/lib.macosx-10.9-universal2-3.9/ripser
      copying ripser/__init__.py -> build/lib.macosx-10.9-universal2-3.9/ripser
      copying ripser/ripser.py -> build/lib.macosx-10.9-universal2-3.9/ripser
      running build_ext
      building 'pyRipser' extension
      creating build/temp.macosx-10.9-universal2-3.9
      creating build/temp.macosx-10.9-universal2-3.9/ripser
      gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DUSE_COEFFICIENTS=1 -DNDEBUG=1 -DASSEMBLE_REDUCTION_MATRIX=1 -I./ripser -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -I/private/var/folders/mf/t7pnn0d50j19hqjm70yjbbbw0000gn/T/pip-build-env-a0nbkw5b/overlay/lib/python3.9/site-packages/numpy/core/include -c ripser/pyRipser.cpp -o build/temp.macosx-10.9-universal2-3.9/ripser/pyRipser.o -Ofast -D_hypot=hypot -std=c++11 -mmacosx-version-min=10.9
      xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
      error: command '/usr/bin/gcc' failed with exit code 1
      ----------------------------------------
      ERROR: Failed building wheel for ripser
    Failed to build ripser
    ERROR: Could not build wheels for ripser which use PEP 517 and cannot be installed directly
    `
    

    Since I read the previous similar issues. I have tried to install previous versions of pip (19.0.0.1, 20.0) and different versions of python (3.6, 3.7, 3.8. 3.9). I have tried installing it on the root and in virtual environments (anaconda, pycharm). I have tried to disable pep517 with the following command python -m pip install --no-use-pep517 ripser

    I really don't know what to do at this point. I must say that I am pretty unfamiliar with git. Any help would be appreciated.

    KR

    opened by thjnmcdonald 4
  • error for windows installation

    error for windows installation

    how to install on windows? can you put it to conda forge then instalation will be easy like http://gudhi.gforge.inria.fr/ conda install -c conda-forge gudhi

    opened by Sandy4321 3
  • Most docs customization to an installable sphinx extension.

    Most docs customization to an installable sphinx extension.

    Code in docs/_static, docs/_templates, and docs/theme_settings.py should be packaged into a sphinx extension.

    This will make it easier to sync documentation configurations across all the scikit-tda packages.

    opened by sauln 2
  • Plotting the cocycles of dim.3, modifying the PlotCocycle2D code

    Plotting the cocycles of dim.3, modifying the PlotCocycle2D code

    Hello, I am able to apply the codes of the "Representative Cocycles" page on python successfully. However, I am more interested in having the cycles (cocycles) of dim.3 barcodes. Is there a possibility to help me in modifying the code that plots the cocycles. i.e. the function plotCocycle2D(D, X, cocycle, thresh) to accept a 3D point cloud and plot its cocycles of dim.3. I would highly appreciate it. I have tried but unfortunately, it did not work out for me. Many thanks in advance

    opened by NadaSaleh1991 0
  • A

    A "Getting Started" section of the documentation would be helpful.

    In addition to the promised tutorials for this software package, a short "Getting Started" section would help me understand how to use this software package.

    opened by galenseilis 1
  • 1-dimensional persistence diagram of image data

    1-dimensional persistence diagram of image data

    Hi,

    Is there a way to create 1-dimensional persistence diagram using sublevelset filtration or lower star filtration on image data? I think it is not possible to construct 1D PD with lower_star_img. Currently, I am able to construct 0D PD using lower_star_img, but I can't find a way to make 1D PDs. Any help would be greatly appreciated.

    Thank you.

    opened by AshleyChraya 2
  • help needed with installation error - Requested phat has different version

    help needed with installation error - Requested phat has different version

    Hi, when I downloaded scikit-tda, I got the error that "Requested phat has different version". May I know what I should do from here? The error message is as follows.

    pip install scikit-tda Collecting scikit-tda Downloading scikit_tda-0.1.0-py3-none-any.whl (2.9 kB) Requirement already satisfied: numpy in ./opt/anaconda3/lib/python3.7/site-packages (from scikit-tda) (1.19.2) Requirement already satisfied: scikit-learn in ./opt/anaconda3/lib/python3.7/site-packages (from scikit-tda) (0.23.2) Requirement already satisfied: Cython in ./opt/anaconda3/lib/python3.7/site-packages (from scikit-tda) (0.29.21) Requirement already satisfied: scipy in ./opt/anaconda3/lib/python3.7/site-packages (from scikit-tda) (1.6.0) Requirement already satisfied: pillow in ./opt/anaconda3/lib/python3.7/site-packages (from scikit-tda) (8.1.0) Requirement already satisfied: matplotlib in ./opt/anaconda3/lib/python3.7/site-packages (from scikit-tda) (3.3.4) Collecting cechmate Downloading cechmate-0.1.0-py3-none-any.whl (23 kB) Collecting phat Downloading phat-1.5.0a.tar.gz (4.7 MB) |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 4.7 MB 2.6 MB/s ERROR: Requested phat from https://files.pythonhosted.org/packages/43/82/c14de81dc2953a71a060f72f2bc34c41996307956b162751f2a47e2c78f7/phat-1.5.0a.tar.gz#sha256=51e7fe5e05adf5c7e0895765572fff05b979731234251f13011610d71d4980ab (from scikit-tda) has different version in metadata: '1.5.0'

    opened by c-siu 12
  • Persistence diagram for a clique complex

    Persistence diagram for a clique complex

    Hi everybody,

    I have seen a ton of codes to compute a persistence diagram when the input data is a point cloud. Is there a way to compute the persistence diagram for a filtration of a clique complex if the input data is a weighted graph? It cannot be done with the Ripser library right? Any code would be very much appreciated.

    Thank you.

    opened by Nilsmiz 1
Releases(v1.0.0)
Owner
Scikit-TDA
Topological Data Analysis for the Python ecosystem.
Scikit-TDA
A Python library for dynamic classifier and ensemble selection

DESlib DESlib is an easy-to-use ensemble learning library focused on the implementation of the state-of-the-art techniques for dynamic classifier and

425 Dec 18, 2022
scikit-learn cross validators for iterative stratification of multilabel data

iterative-stratification iterative-stratification is a project that provides scikit-learn compatible cross validators with stratification for multilab

745 Jan 05, 2023
Fast solver for L1-type problems: Lasso, sparse Logisitic regression, Group Lasso, weighted Lasso, Multitask Lasso, etc.

celer Fast algorithm to solve Lasso-like problems with dual extrapolation. Currently, the package handles the following problems: Lasso weighted Lasso

168 Dec 13, 2022
Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Optimization Algorithm,Immune Algorithm, Artificial Fish Swarm Algorithm, Differential Evolution and TSP(Traveling salesman)

scikit-opt Swarm Intelligence in Python (Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Algorithm, Immune Algorithm,A

ιƒ­ι£ž 3.7k Jan 01, 2023
A library of sklearn compatible categorical variable encoders

Categorical Encoding Methods A set of scikit-learn-style transformers for encoding categorical variables into numeric by means of different techniques

2.1k Jan 02, 2023
(AAAI' 20) A Python Toolbox for Machine Learning Model Combination

combo: A Python Toolbox for Machine Learning Model Combination Deployment & Documentation & Stats Build Status & Coverage & Maintainability & License

Yue Zhao 606 Dec 21, 2022
Extra blocks for scikit-learn pipelines.

scikit-lego We love scikit learn but very often we find ourselves writing custom transformers, metrics and models. The goal of this project is to atte

vincent d warmerdam 941 Dec 30, 2022
Topological Data Analysis for Python🐍

Scikit-TDA is a home for Topological Data Analysis Python libraries intended for non-topologists. This project aims to provide a curated library of TD

Scikit-TDA 373 Dec 24, 2022
Data Analysis Baseline Library

dabl The data analysis baseline library. "Mr Sanchez, are you a data scientist?" "I dabl, Mr president." Find more information on the website. State o

Andreas Mueller 122 Dec 27, 2022
Scikit-learn compatible estimation of general graphical models

skggm : Gaussian graphical models using the scikit-learn API In the last decade, learning networks that encode conditional independence relationships

213 Jan 02, 2023
scikit-learn inspired API for CRFsuite

sklearn-crfsuite sklearn-crfsuite is a thin CRFsuite (python-crfsuite) wrapper which provides interface simlar to scikit-learn. sklearn_crfsuite.CRF i

418 Jan 09, 2023
machine learning with logical rules in Python

skope-rules Skope-rules is a Python machine learning module built on top of scikit-learn and distributed under the 3-Clause BSD license. Skope-rules a

504 Dec 31, 2022
Large-scale linear classification, regression and ranking in Python

lightning lightning is a library for large-scale linear classification, regression and ranking in Python. Highlights: follows the scikit-learn API con

1.6k Dec 31, 2022
A library of extension and helper modules for Python's data analysis and machine learning libraries.

Mlxtend (machine learning extensions) is a Python library of useful tools for the day-to-day data science tasks. Sebastian Raschka 2014-2021 Links Doc

Sebastian Raschka 4.2k Dec 28, 2022
Multivariate imputation and matrix completion algorithms implemented in Python

A variety of matrix completion and imputation algorithms implemented in Python 3.6. To install: pip install fancyimpute Do not use conda. We don't sup

Alex Rubinsteyn 1.1k Dec 18, 2022
A Python Package to Tackle the Curse of Imbalanced Datasets in Machine Learning

imbalanced-learn imbalanced-learn is a python package offering a number of re-sampling techniques commonly used in datasets showing strong between-cla

6.2k Jan 01, 2023
A scikit-learn based module for multi-label et. al. classification

scikit-multilearn scikit-multilearn is a Python module capable of performing multi-label learning tasks. It is built on-top of various scientific Pyth

803 Jan 05, 2023