scikit-tda / scikit-tda Goto Github PK
View Code? Open in Web Editor NEWTopological Data Analysis for Pythonπ
Home Page: https://docs.scikit-tda.org
License: Other
Topological Data Analysis for Pythonπ
Home Page: https://docs.scikit-tda.org
License: Other
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
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
Hello, how to use scikit-tda to process the MNIST handwritten datasetοΌIs there any code for this
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.
I wrote the following requirements.txt
Cython>=0.29.21
numpy>=1.19.2
scikit-tda>=0.0.3
The command pip install -r requirements.txt
fails as it can not find the module Cython
Step 4/5 : RUN pip install -r /tmp/requirements.txt
---> Running in 853ba8bd6142
Collecting Cython>=0.29.21
Downloading Cython-0.29.21-cp38-cp38-manylinux1_x86_64.whl (1.9 MB)
Collecting numpy>=1.19.2
Downloading numpy-1.19.2-cp38-cp38-manylinux2010_x86_64.whl (14.5 MB)
Collecting scikit-tda>=0.0.3
Downloading scikit_tda-0.0.3-py3-none-any.whl (2.6 kB)
Collecting matplotlib
Downloading matplotlib-3.3.2-cp38-cp38-manylinux1_x86_64.whl (11.6 MB)
Collecting ripser
Downloading ripser-0.5.4.tar.gz (81 kB)
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4nort0ro/ripser/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4nort0ro/ripser/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"'
, open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-7jsjq948
cwd: /tmp/pip-install-4nort0ro/ripser/
Complete output (2 lines):
You don't seem to have Cython installed. Please get a
copy from www.cython.org or install it with `pip install Cython`
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The command '/bin/sh -c pip install -r /tmp/requirements.txt' returned a non-zero code: 1
If you install Cython first and then install scikit-tda no error is encountered. In this case running pip install -r requirements.txt
also works as Cython is already installed in the second round.
Similarly numpy needs to be installed beforehand to avoid this error:
Building wheels for collected packages: umap-learn, ripser, hopcroftkarp
Building wheel for umap-learn (setup.py): started
Building wheel for umap-learn (setup.py): finished with status 'done'
Created wheel for umap-learn: filename=umap_learn-0.4.6-py3-none-any.whl size=
67950 sha256=d02da08e28b24bc2ba921a3003f8a6a7b07b0d3f90c82fab0fb88e63447841ed
Stored in directory: /root/.cache/pip/wheels/9c/18/d0/2bcf7df75d19c6ca6ff8097b
12abd4c46879e9a8275e93e651
Building wheel for ripser (setup.py): started
Building wheel for ripser (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.a
rgv[0] = '"'"'/tmp/pip-install-qfhqfl3z/ripser/setup.py'"'"'; __file__='"'"'/tmp
/pip-install-qfhqfl3z/ripser/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', o
pen)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exe
c(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-dj3r8y
ry
cwd: /tmp/pip-install-qfhqfl3z/ripser/
Complete output (37 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/ripser
copying ripser/_version.py -> build/lib.linux-x86_64-3.8/ripser
copying ripser/__init__.py -> build/lib.linux-x86_64-3.8/ripser
copying ripser/ripser.py -> build/lib.linux-x86_64-3.8/ripser
running build_ext
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-qfhqfl3z/ripser/setup.py", line 80, in <module>
setup(
File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 1
53, in setup
return distutils.core.setup(**attrs)
File "/usr/local/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 290
, in run
self.run_command('build')
File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.8/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-qfhqfl3z/ripser/setup.py", line 39, in run
import numpy
Installing scikit-tda
after installing those two dependencies works fine. So removing scikit-tda
from the requirements.txt
and executing pip install scikit-tda>=0.0.3
afterwards works perfectly well.
FROM python:3.8
RUN pip install --upgrade pip
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
do you have video how to use it?
As the Google Image search for "topological data analysis" shows.
Thanks!
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'
Hi, I was trying to add this package to conda-forge but I just realize there is no license file in this repo. Do you mind to add one? It looks to me you could add something like this if you want a MIT license
Hi,
Do you have any example with time-series data ?
Thanks
Each of the major projects could benefit from an increase in the code coverage. Granted, this is not a great metric to track, getting them all to a baseline would help. This is a pretty open ended issue, so let's try a first baseline of 80%.
I tried installing this package on jupiter notes but had an error. could someone suggest a solution to me? find below the result after entering
pip install sckit_tda
ERROR: Failed building wheel for ripser
ERROR: Complete output from command 'C:\Users\USER\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;file='"'"'C:\Users\USER\AppData\Local\Temp\pip-install-gkx47tif\ripser\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\USER\AppData\Local\Temp\pip-record-3xthkebx\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\ripser
copying ripser\ripser.py -> build\lib.win-amd64-3.7\ripser
copying ripser_version.py -> build\lib.win-amd64-3.7\ripser
copying ripser_init_.py -> build\lib.win-amd64-3.7\ripser
running build_ext
building 'pyRipser' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command "'C:\Users\USER\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;file='"'"'C:\Users\USER\AppData\Local\Temp\pip-install-gkx47tif\ripser\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\USER\AppData\Local\Temp\pip-record-3xthkebx\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\USER\AppData\Local\Temp\pip-install-gkx47tif\ripser\
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.
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.
I'd like to spend some time designing the organizational structure of this project. Currently, each subproject exposes the defined methods on their own, and sktda
simply imports all of them. Even then, the current suggested API is to use each package as a stand-alone tool. We could reorganize this project better so it is more cohesive.
The issue currently is that each package stands mostly alone. This is nice because we can develop them all independently and it is straight forward to add new modules to the system. It can be confusing though as there is some repetition between packages and each has its own name. It would make more sense for everything to be logically indexed under sktda
based on uses rather than grouped under each individual library based on historical reasons.
One option would be to structure similar concepts together. We have ripser.py
and Cechmate
for persistent homology, kmapper
for mapper, persim
for working with persistence diagrams (and hopefully soon having distances on mapper as well. There are also visualization tools for both diagrams and simplicial complexes (mapper visuals).
We could have ~4 modules:
sktda.persistent_homology
: exposing everything in ripser.py and cechmate at the same level.sktda.mapper
: exposing kmappersktda.distances
: exposing half of persimsktda.plotting
: exposing the other half of persim and some of kmapperDoes anyone have thoughts on this?
I'm looking to view your documentation on your website scikit-tda.org and the site appears to be down. I've tried multiple browsers, computers and ip addresses, but no luck.
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
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.
Each project has a set of example scripts, it looks like Sphinx-gallery makes displaying rendering these examples look very nice.
It would be nice to have clear guides for how to build, test, and PR each package. These instructions could include:
Kepler Mapper has a small instruction doc, this should be replicated, expanded, and standardized across each package.
it seems we need the invited link to join in......
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.