Skip to content

Commit a5c1810

Browse files
authored
Merge pull request #217 from lucasimi/improve-docs
Improve docs
2 parents ca1f9b0 + b17a093 commit a5c1810

File tree

3 files changed

+116
-62
lines changed

3 files changed

+116
-62
lines changed

README.md

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,62 @@
11
![Logo](https://github.com/lucasimi/tda-mapper-python/raw/main/docs/source/logos/tda-mapper-logo-horizontal.png)
22

3-
[![Source Code](https://img.shields.io/badge/lucasimi-tda--mapper--python-blue?logo=github&logoColor=silver)](https://github.com/lucasimi/tda-mapper-python)
43
[![PyPI version](https://img.shields.io/pypi/v/tda-mapper?logo=python&logoColor=silver)](https://pypi.python.org/pypi/tda-mapper)
54
[![downloads](https://img.shields.io/pypi/dm/tda-mapper?logo=python&logoColor=silver)](https://pypi.python.org/pypi/tda-mapper)
5+
[![codecov](https://img.shields.io/codecov/c/github/lucasimi/tda-mapper-python?logo=codecov&logoColor=silver)](https://codecov.io/github/lucasimi/tda-mapper-python)
66
[![test](https://img.shields.io/github/actions/workflow/status/lucasimi/tda-mapper-python/test-unit.yml?logo=github&logoColor=silver&branch=main&label=test)](https://github.com/lucasimi/tda-mapper-python/actions/workflows/test-unit.yml)
77
[![publish](https://img.shields.io/github/actions/workflow/status/lucasimi/tda-mapper-python/publish-pypi.yml?logo=github&logoColor=silver&label=publish)](https://github.com/lucasimi/tda-mapper-python/actions/workflows/publish-pypi.yml)
88
[![docs](https://img.shields.io/readthedocs/tda-mapper/main?logo=readthedocs&logoColor=silver)](https://tda-mapper.readthedocs.io/en/main/)
9-
[![codecov](https://img.shields.io/codecov/c/github/lucasimi/tda-mapper-python?logo=codecov&logoColor=silver)](https://codecov.io/github/lucasimi/tda-mapper-python)
109
[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.10642381-blue?logo=doi&logoColor=silver)](https://doi.org/10.5281/zenodo.10642381)
11-
[![Streamlit App](https://img.shields.io/badge/Streamlit-App-blue?logo=streamlit&logoColor=silver)](https://tda-mapper-app.streamlit.app/)
1210

1311
# tda-mapper
1412

15-
**tda-mapper** is a Python library based on the Mapper algorithm, a key tool in
16-
Topological Data Analysis (TDA). Designed for efficient computations and backed
17-
by advanced spatial search techniques, it scales seamlessly to high dimensional
18-
data, making it suitable for applications in machine learning, data mining, and
19-
exploratory data analysis.
13+
**tda-mapper** is a Python library built around the Mapper algorithm, a core
14+
technique in Topological Data Analysis (TDA) for extracting topological
15+
structure from complex data. Designed for computational efficiency and
16+
scalability, it leverages optimized spatial search methods to support
17+
high-dimensional datasets. The library is well-suited for integration into
18+
machine learning pipelines, unsupervised learning tasks, and exploratory data
19+
analysis.
2020

2121
Further details in the
2222
[documentation](https://tda-mapper.readthedocs.io/en/main/)
2323
and in the
2424
[paper](https://openreview.net/pdf?id=lTX4bYREAZ).
2525

26-
## Main Features
26+
### Core Features
27+
28+
- **Efficient construction**
29+
30+
Leverages optimized spatial search techniques and parallelization to
31+
accelerate the construction of Mapper graphs, supporting the analysis of
32+
high-dimensional datasets.
33+
34+
- **Scikit-learn integration**
2735

28-
- **Fast Mapper graph construction**: Accelerates computations with efficient spatial search, enabling analysis of large, high-dimensional datasets.
36+
Provides custom estimators that are fully compatible with scikit-learn's
37+
API, enabling seamless integration into scikit-learn pipelines for tasks
38+
such as dimensionality reduction, clustering, and feature extraction.
2939

30-
- **Scikit-learn compatibility**: Easily integrate Mapper as a part of your machine learning workflows.
40+
- **Flexible visualization**
3141

32-
- **Flexible visualization options**: Visualize Mapper graphs with multiple supported backends, tailored to your needs.
42+
Multiple visualization backends supported (e.g., Plotly, Matplotlib) for
43+
generating high-quality Mapper graph representations with adjustable
44+
layouts and styling.
3345

34-
- **Interactive exploration**: Explore data interactively through a user-friendly app.
46+
- **Interactive app**
47+
48+
Provides an interactive web-based interface (via Streamlit) for dynamic
49+
exploration of Mapper graph structures, offering real-time adjustments to
50+
parameters and visualizations.
3551

3652
## Background
3753

38-
The Mapper algorithm transforms complex datasets into graph representations
39-
that highlight clusters, transitions, and topological features. These insights
40-
reveal hidden patterns in data, applicable across fields like social sciences,
41-
biology, and machine learning. For an in-depth coverage of Mapper, including
42-
its mathematical foundations and applications, read the
54+
The Mapper algorithm extracts topological features from complex datasets,
55+
representing them as graphs that highlight clusters, transitions, and key
56+
structural patterns. These insights reveal hidden data relationships and are
57+
applicable across diverse fields, including social sciences, biology, and
58+
machine learning. For an in-depth overview of Mapper, including its
59+
mathematical foundations and practical applications, read
4360
[the original paper](https://research.math.osu.edu/tgda/mapperPBG.pdf).
4461

4562
| Step 1 | Step 2 | Step 3 | Step 4 |
@@ -52,13 +69,11 @@ its mathematical foundations and applications, read the
5269
If you use **tda-mapper** in your work, please consider citing both the
5370
[library](https://doi.org/10.5281/zenodo.10642381), archived in a permanent
5471
Zenodo record, and the [paper](https://openreview.net/pdf?id=lTX4bYREAZ),
55-
which provides a broader methodological overview.
56-
We recommend citing the specific version of the library used in your research,
57-
as well as the paper.
58-
For citation examples, refer to the
72+
which provides a broader methodological overview. We recommend citing the
73+
specific version of the library used in your research, along with the paper.
74+
For citation examples, please refer to the
5975
[documentation](https://tda-mapper.readthedocs.io/en/main/#citations).
6076

61-
6277
## Quick Start
6378

6479
### Installation
@@ -71,12 +86,11 @@ pip install tda-mapper
7186

7287
### How to Use
7388

74-
Here's a minimal example using the **circles dataset** from `scikit-learn` to demonstrate how to use **tda-mapper**.
75-
We start by generating the data and visualizing it.
76-
The dataset consists of two concentric circles.
77-
The goal is to compute a Mapper graph that summarizes this structure while preserving topological features.
78-
We proceed as follows:
79-
89+
Here's a minimal example using the **circles dataset** from `scikit-learn` to
90+
demonstrate how to use **tda-mapper**. This example demonstrates how to apply
91+
the Mapper algorithm on a synthetic dataset (concentric circles). The goal is
92+
to extract a topological graph representation using `PCA` as a lens and
93+
`DBSCAN` for clustering. We proceed as follows:
8094

8195
```python
8296
import matplotlib.pyplot as plt
@@ -114,7 +128,10 @@ fig.show(config={"scrollZoom": True})
114128
| ---------------- | ------------ |
115129
| ![Original Dataset](https://github.com/lucasimi/tda-mapper-python/raw/main/resources/circles_dataset_v2.png) | ![Mapper Graph](https://github.com/lucasimi/tda-mapper-python/raw/main/resources/circles_mean_v2.png) |
116130

117-
Left: the original dataset consisting of two concentric circles with noise, colored by class label. Right: the resulting Mapper graph, built from the PCA projection and clustered using DBSCAN. The two concentric circles are well identified by the connected components in the Mapper graph.
131+
Left: the original dataset consisting of two concentric circles with noise,
132+
colored by class label. Right: the resulting Mapper graph, built from the PCA
133+
projection and clustered using DBSCAN. The two concentric circles are well
134+
identified by the connected components in the Mapper graph.
118135

119136
More examples can be found in the
120137
[documentation](https://tda-mapper.readthedocs.io/en/main/examples.html).
@@ -124,10 +141,18 @@ More examples can be found in the
124141
Use our Streamlit app to visualize and explore your data without writing code.
125142
You can run a live demo directly on
126143
[Streamlit Cloud](https://tda-mapper-app.streamlit.app/),
127-
or locally on your machine using the following:
144+
or locally on your machine. The first time you run the app locally, you may
145+
need to install the required dependencies from the `requirements.txt` file by
146+
running
128147

129-
```
148+
```bash
130149
pip install -r app/requirements.txt
150+
```
151+
152+
then run the app locally with
153+
154+
```bash
131155
streamlit run app/streamlit_app.py
132156
```
133-
![tda-mapper-app](https://github.com/lucasimi/tda-mapper-python/raw/main/resources/tda-mapper-app.png)
157+
158+
![tda-mapper-app](https://github.com/lucasimi/tda-mapper-python/raw/main/resources/tda-mapper-app.png)

docs/source/index.rst

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,47 +25,56 @@
2525
https://github.com/lucasimi/tda-mapper-python/raw/main/docs/source/logos/tda-mapper-logo-horizontal.png
2626
:alt: Logo
2727

28-
|Source Code| |PyPI version| |downloads| |test| |publish| |docs| |codecov| |DOI|
29-
|Streamlit App|
28+
|PyPI version| |downloads| |codecov| |test| |publish| |docs| |DOI|
29+
30+
|Source Code|
3031

3132
tda-mapper
3233
==========
3334

34-
**tda-mapper** is a Python library based on the Mapper algorithm, a key tool in
35-
Topological Data Analysis (TDA). Designed for efficient computations and backed
36-
by advanced spatial search techniques, it scales seamlessly to high dimensional
37-
data, making it suitable for applications in machine learning, data mining, and
38-
exploratory data analysis.
35+
**tda-mapper** is a Python library built around the Mapper algorithm, a core
36+
technique in Topological Data Analysis (TDA) for extracting topological
37+
structure from complex data. Designed for computational efficiency and
38+
scalability, it leverages optimized spatial search methods to support
39+
high-dimensional datasets. The library is well-suited for integration into
40+
machine learning pipelines, unsupervised learning tasks, and exploratory data
41+
analysis.
3942

4043
Further details in the
4144
`documentation <https://tda-mapper.readthedocs.io/en/main/>`__
4245
and in the
4346
`paper <https://openreview.net/pdf?id=lTX4bYREAZ>`__.
4447

45-
Main features
48+
Core features
4649
-------------
4750

48-
- **Fast Mapper graph construction**: Accelerates computations with efficient
49-
spatial search, enabling analysis of large, high-dimensional datasets.
51+
- **Efficient construction**
52+
53+
Leverages optimized spatial search techniques and parallelization to accelerate the construction of Mapper graphs, supporting the analysis of high-dimensional datasets.
54+
55+
- **Scikit-learn integration**
56+
57+
Provides custom estimators that are fully compatible with scikit-learn's API, enabling seamless integration into scikit-learn pipelines for tasks such as dimensionality reduction, clustering, and feature extraction.
58+
59+
- **Flexible visualization**
60+
61+
Multiple visualization backends supported (e.g., Plotly, Matplotlib) for generating high-quality Mapper graph representations with adjustable layouts and styling.
5062

51-
- **Scikit-learn compatibility**: Easily integrate Mapper as a part of your
52-
machine learning workflows.
63+
- **Interactive app**
5364

54-
- **Flexible visualization options**: Visualize Mapper graphs with multiple
55-
supported backends, tailored to your needs.
65+
Provides an interactive web-based interface (via Streamlit) for dynamic exploration of Mapper graph structures, offering real-time adjustments to parameters and visualizations.
5666

57-
- **Interactive exploration**: Explore data interactively through a
58-
user-friendly app.
5967

6068
Background
6169
----------
6270

63-
The Mapper algorithm transforms complex datasets into graph representations
64-
that highlight clusters, transitions, and topological features. These insights
65-
reveal hidden patterns in data, applicable across fields like social sciences,
66-
biology, and machine learning. For an in-depth coverage of Mapper, including
67-
its mathematical foundations and applications, read the
68-
`original paper <https://research.math.osu.edu/tgda/mapperPBG.pdf>`__.
71+
The Mapper algorithm extracts topological features from complex datasets,
72+
representing them as graphs that highlight clusters, transitions, and key
73+
structural patterns. These insights reveal hidden data relationships and are
74+
applicable across diverse fields, including social sciences, biology, and
75+
machine learning. For an in-depth overview of Mapper, including its
76+
mathematical foundations and practical applications, read
77+
`the original paper <https://research.math.osu.edu/tgda/mapperPBG.pdf>`__.
6978

7079
+-----------------+-----------------+-----------------+-----------------+
7180
| Step 1 | Step 2 | Step 3 | Step 4 |
@@ -78,12 +87,12 @@ its mathematical foundations and applications, read the
7887
Citations
7988
---------
8089

81-
If you use **tda-mapper** in your work, please consider citing both the
90+
If you use **tda-mapper** in your work, please consider citing both the
8291
`library <https://doi.org/10.5281/zenodo.10642381>`__,
83-
archived in a permanent Zenodo record, and the
92+
archived in a permanent Zenodo record, and the
8493
`paper <https://openreview.net/pdf?id=lTX4bYREAZ>`__,
85-
which provides a broader methodological overview.
86-
We recommend citing the specific version of the library used in your research, as well as the paper.
94+
which provides a broader methodological overview. We recommend citing the
95+
specific version of the library used in your research, along with the paper.
8796

8897
- **tda-mapper**: For example to cite version 0.8.0 you can use:
8998

docs/source/quickstart.rst

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ Development
3737
How To Use
3838
----------
3939

40-
Here's a minimal example using the **circles dataset** from
41-
``scikit-learn`` to demonstrate how to use **tda-mapper**:
40+
Here's a minimal example using the **circles dataset** from `scikit-learn` to
41+
demonstrate how to use **tda-mapper**. This example demonstrates how to apply
42+
the Mapper algorithm on a synthetic dataset (concentric circles). The goal is
43+
to extract a topological graph representation using `PCA` as a lens and
44+
`DBSCAN` for clustering. We proceed as follows:
4245

4346
.. code:: python
4447
@@ -78,6 +81,11 @@ Here's a minimal example using the **circles dataset** from
7881
| |Original Dataset| | |Mapper Graph| |
7982
+----------------------------------------+-----------------------------+
8083

84+
Left: the original dataset consisting of two concentric circles with noise,
85+
colored by class label. Right: the resulting Mapper graph, built from the `PCA`
86+
projection and clustered using `DBSCAN`. The two concentric circles are well
87+
identified by the connected components in the Mapper graph.
88+
8189
More examples can be found in the
8290
`documentation <https://tda-mapper.readthedocs.io/en/main/>`__.
8391

@@ -89,13 +97,25 @@ You can run a live demo directly on
8997
`Streamlit Cloud <https://tda-mapper-app.streamlit.app/>`__,
9098
or locally on your machine using the following:
9199

100+
Use our Streamlit app to visualize and explore your data without writing code.
101+
You can run a live demo directly on
102+
`Streamlit Cloud <https://tda-mapper-app.streamlit.app/>`__,
103+
or locally on your machine. The first time you run the app locally, you may
104+
need to install the required dependencies from the `requirements.txt` file by
105+
running
106+
92107
.. code:: bash
93108
94109
pip install -r app/requirements.txt
110+
111+
then run the app locally with
112+
113+
.. code:: bash
114+
95115
streamlit run app/streamlit_app.py
96116
97117
|Interactive App|
98118

99119
.. |Original Dataset| image:: https://github.com/lucasimi/tda-mapper-python/raw/main/resources/circles_dataset_v2.png
100120
.. |Mapper Graph| image:: https://github.com/lucasimi/tda-mapper-python/raw/main/resources/circles_mean_v2.png
101-
.. |Interactive App| image :: https://github.com/lucasimi/tda-mapper-python/raw/main/resources/tda-mapper-app.png
121+
.. |Interactive App| image:: https://github.com/lucasimi/tda-mapper-python/raw/main/resources/tda-mapper-app.png

0 commit comments

Comments
 (0)