### Tutorials and Examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/gtda.point_clouds.ConsecutiveRescaling.html Guides and practical examples for using Giotto-TDA. ```APIDOC ## Tutorials and Examples ### Tutorials * **Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy`** * Generate data * Calculate persistent homology * Extract features * Use the new features in a standard classifier * Encapsulate the steps above in a pipeline * **Plotting in `giotto-tda`** * 1. Basic philosophy and `plot` methods * 2 Derived convenience methods: `transform_plot` and `fit_transform_plot` * **Getting started with Mapper** * Useful references * Import libraries * Generate and visualise data * Configure the Mapper pipeline * Visualise the Mapper graph * Run the Mapper pipeline * Creating custom filter functions * Visualise the Mapper graph interactively (Live Jupyter session needed) * **Topology of time series** * Useful references * See also * From time series to time delay embeddings * A periodic example * A non-periodic example * From time delay embeddings to persistence diagrams * Picking the embedding dimension and time delay * **Topology in time series forecasting** * See also * `SlidingWindow` ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/_modules/gtda/mapper/visualization.html Guides and examples demonstrating the usage of Giotto-TDA functionalities. ```APIDOC ## Tutorials and examples ### Description This section provides tutorials and examples to help users understand and apply Giotto-TDA. #### Tutorials - **Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy`** - Generate data - Calculate persistent homology - Extract features - Use the new features in a standard classifier - Encapsulate the steps above in a pipeline - **Plotting in `giotto-tda`** - 1. Basic philosophy and `plot` methods - 2 Derived convenience methods: `transform_plot` and `fit_transform_plot` - **Getting started with Mapper** - Useful references - Import libraries - Generate and visualise data - Configure the Mapper pipeline - Visualise the Mapper graph - Run the Mapper pipeline - Creating custom filter functions - Visualise the Mapper graph interactively (Live Jupyter session needed) - **Topology of time series** - Useful references - See also - From time series to time delay embeddings - A periodic example - A non-periodic example - From time delay embeddings to persistence diagrams - Picking the embedding dimension and time delay - **Topology in time series forecasting** - See also - `SlidingWindow` ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/_modules/gtda/images/filtrations.html Guides and practical examples for using Giotto-TDA, including topological feature extraction, plotting, Mapper, and time series analysis. ```APIDOC ## Tutorials and examples ### Tutorials - **Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy`** - Generate data - Calculate persistent homology - Extract features - Use the new features in a standard classifier - Encapsulate the steps above in a pipeline - **Plotting in `giotto-tda`** - 1. Basic philosophy and `plot` methods - 2 Derived convenience methods: `transform_plot` and `fit_transform_plot` - **Getting started with Mapper** - Useful references - Import libraries - Generate and visualise data - Configure the Mapper pipeline - Visualise the Mapper graph - Run the Mapper pipeline - Creating custom filter functions - Visualise the Mapper graph interactively (Live Jupyter session needed) - **Topology of time series** - Useful references - See also - From time series to time delay embeddings - A periodic example - A non-periodic example - From time delay embeddings to persistence diagrams - Picking the embedding dimension and time delay - **Topology in time series forecasting** - See also - `SlidingWindow` ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/diagrams/features/gtda.diagrams.NumberOfPoints.html Guides and practical examples demonstrating the usage of Giotto-TDA for various topological data analysis tasks. ```APIDOC ## Tutorials and examples ### Description This section provides tutorials and examples to help users understand and apply Giotto-TDA for different topological data analysis scenarios. ### Tutorials #### Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy` 1. Generate data 2. Calculate persistent homology 3. Extract features 4. Use the new features in a standard classifier 5. Encapsulate the steps above in a pipeline #### Plotting in `giotto-tda` 1. Basic philosophy and `plot` methods 2. Derived convenience methods: `transform_plot` and `fit_transform_plot` #### Getting started with Mapper 1. Useful references 2. Import libraries 3. Generate and visualise data 4. Configure the Mapper pipeline 5. Visualise the Mapper graph 6. Run the Mapper pipeline 7. Creating custom filter functions 8. Visualise the Mapper graph interactively (Live Jupyter session needed) #### Topology of time series 1. Useful references 2. See also 3. From time series to time delay embeddings 4. A periodic example 5. A non-periodic example 6. From time delay embeddings to persistence diagrams 7. Picking the embedding dimension and time delay #### Topology in time series forecasting 1. See also 2. `SlidingWindow` ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/_modules/gtda/mapper/cluster.html Links to tutorials and examples demonstrating the usage of Giotto-TDA functionalities. ```APIDOC ## Tutorials and examples ### Description This section provides practical examples and tutorials to guide users through the various features of Giotto-TDA. #### Tutorials - **Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy`** - Generate data - Calculate persistent homology - Extract features - Use the new features in a standard classifier - Encapsulate the steps above in a pipeline - **Plotting in `giotto-tda`** - 1. Basic philosophy and `plot` methods - 2 Derived convenience methods: `transform_plot` and `fit_transform_plot` - **Getting started with Mapper** - Useful references - Import libraries - Generate and visualise data - Configure the Mapper pipeline - Visualise the Mapper graph - Run the Mapper pipeline - Creating custom filter functions - Visualise the Mapper graph interactively (Live Jupyter session needed) - **Topology of time series** - Useful references - See also - From time series to time delay embeddings - A periodic example - A non-periodic example - From time delay embeddings to persistence diagrams - Picking the embedding dimension and time delay - **Topology in time series forecasting** - See also - `SlidingWindow` ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/_modules/gtda/base.html Links to tutorials and examples demonstrating the usage of Giotto-TDA functionalities. ```APIDOC ## Tutorials and examples ### Description This section provides practical examples and tutorials to help users understand and apply the features of the Giotto-TDA library. ### Tutorials - **Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy`** - Generate data - Calculate persistent homology - Extract features - Use the new features in a standard classifier - Encapsulate the steps above in a pipeline - **Plotting in `giotto-tda`** - 1. Basic philosophy and `plot` methods - 2 Derived convenience methods: `transform_plot` and `fit_transform_plot` - **Getting started with Mapper** - Useful references - Import libraries - Generate and visualise data - Configure the Mapper pipeline - Visualise the Mapper graph - Run the Mapper pipeline - Creating custom filter functions - Visualise the Mapper graph interactively (Live Jupyter session needed) - **Topology of time series** - Useful references - See also - From time series to time delay embeddings - A periodic example - A non-periodic example - From time delay embeddings to persistence diagrams - Picking the embedding dimension and time delay - **Topology in time series forecasting** - See also - `SlidingWindow` ``` -------------------------------- ### Tutorials and Examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/diagrams/representations/gtda.diagrams.PersistenceImage.html Guides and practical examples demonstrating the usage of Giotto-TDA for various topological data analysis tasks. ```APIDOC ## Tutorials and Examples ### Description This section provides tutorials and examples that illustrate how to use Giotto-TDA for various applications, from basic topological feature extraction to advanced techniques like Mapper and time series analysis. ### Tutorials #### Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy` 1. **Generate data**: Create synthetic data for analysis. 2. **Calculate persistent homology**: Compute persistence diagrams using `VietorisRipsPersistence`. 3. **Extract features**: Use `PersistenceEntropy` to extract features from the diagrams. 4. **Use new features in a classifier**: Integrate extracted features into a standard machine learning classifier. 5. **Encapsulate steps in a pipeline**: Combine all steps into a reusable Giotto-TDA pipeline. #### Plotting in `giotto-tda` 1. **Basic philosophy and `plot` methods**: Understand the fundamental plotting approaches. 2. **Derived convenience methods**: Explore `transform_plot` and `fit_transform_plot` for streamlined plotting. #### Getting started with Mapper - **Useful references**: Links to relevant background material. - **Import libraries**: Load necessary Giotto-TDA modules. - **Generate and visualise data**: Create and plot sample data. - **Configure the Mapper pipeline**: Set up the parameters for the Mapper algorithm. - **Visualise the Mapper graph**: Plot the resulting Mapper graph. - **Run the Mapper pipeline**: Execute the configured Mapper process. - **Creating custom filter functions**: Define your own functions for data filtering. - **Visualise the Mapper graph interactively**: Interactive plotting (requires a Live Jupyter session). #### Topology of time series - **Useful references**: Background information on time series topology. - **See also**: Related topics and modules. - **From time series to time delay embeddings**: Convert time series data into embeddings. - **A periodic example**: Demonstrates topological analysis on periodic time series. - **A non-periodic example**: Demonstrates topological analysis on non-periodic time series. - **From time delay embeddings to persistence diagrams**: Compute persistence diagrams from embeddings. - **Picking the embedding dimension and time delay**: Guidance on selecting optimal embedding parameters. #### Topology in time series forecasting - **See also**: Related topics and modules. - **`SlidingWindow`**: Using the `SlidingWindow` utility for time series analysis. ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/diagrams/representations/gtda.diagrams.BettiCurve.html Links to tutorials and examples demonstrating the usage of Giotto-TDA for various applications. ```APIDOC ## Tutorials and examples ### Description This section provides practical examples and tutorials to help users understand and apply Giotto-TDA functionalities. ### Tutorials * **Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy`**: * Generate data * Calculate persistent homology * Extract features * Use the new features in a standard classifier * Encapsulate the steps above in a pipeline * **Plotting in `giotto-tda`**: * 1. Basic philosophy and `plot` methods * 2 Derived convenience methods: `transform_plot` and `fit_transform_plot` * **Getting started with Mapper**: * Useful references * Import libraries * Generate and visualise data * Configure the Mapper pipeline * Visualise the Mapper graph * Run the Mapper pipeline * Creating custom filter functions * Visualise the Mapper graph interactively (Live Jupyter session needed) * **Topology of time series**: * Useful references * See also * From time series to time delay embeddings * A periodic example * A non-periodic example * From time delay embeddings to persistence diagrams * Picking the embedding dimension and time delay * **Topology in time series forecasting**: * See also * `SlidingWindow` ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/homology/gtda.homology.CubicalPersistence.html Links to tutorials and examples demonstrating the usage of Giotto-TDA for various applications. ```APIDOC ## Tutorials and examples ### Description This section provides practical examples and tutorials to help users understand and apply the functionalities of the Giotto-TDA library. ### Tutorials - **Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy`** - Generate data - Calculate persistent homology - Extract features - Use the new features in a standard classifier - Encapsulate the steps above in a pipeline - **Plotting in `giotto-tda`** - 1. Basic philosophy and `plot` methods - 2 Derived convenience methods: `transform_plot` and `fit_transform_plot` - **Getting started with Mapper** - Useful references - Import libraries - Generate and visualise data - Configure the Mapper pipeline - Visualise the Mapper graph - Run the Mapper pipeline - Creating custom filter functions - Visualise the Mapper graph interactively (Live Jupyter session needed) - **Topology of time series** - Useful references - See also - From time series to time delay embeddings - A periodic example - A non-periodic example - From time delay embeddings to persistence diagrams - Picking the embedding dimension and time delay - **Topology in time series forecasting** - See also - `SlidingWindow` ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/_modules/sklearn/base.html Links to tutorials and examples demonstrating the usage of Giotto-TDA for various applications. ```APIDOC ## Tutorials and examples ### Description This section provides practical examples and step-by-step tutorials for using Giotto-TDA's features. ### Tutorials: - **Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy`** - Generate data - Calculate persistent homology - Extract features - Use the new features in a standard classifier - Encapsulate the steps above in a pipeline - **Plotting in `giotto-tda`** - 1. Basic philosophy and `plot` methods - 2 Derived convenience methods: `transform_plot` and `fit_transform_plot` - **Getting started with Mapper** - Useful references - Import libraries - Generate and visualise data - Configure the Mapper pipeline - Visualise the Mapper graph - Run the Mapper pipeline - Creating custom filter functions - Visualise the Mapper graph interactively (Live Jupyter session needed) - **Topology of time series** - Useful references - See also - From time series to time delay embeddings - A periodic example - A non-periodic example - From time delay embeddings to persistence diagrams - Picking the embedding dimension and time delay - **Topology in time series forecasting** - See also - `SlidingWindow` ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/installation.html Documentation for tutorials and examples demonstrating the usage of Giotto-TDA. ```APIDOC ## Tutorials and examples ### Description This section provides practical examples and tutorials to guide users through various functionalities of Giotto-TDA. ### Tutorials #### Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy` 1. **Generate data**: Create sample data for analysis. 2. **Calculate persistent homology**: Use `VietorisRipsPersistence` to compute homology. 3. **Extract features**: Employ `PersistenceEntropy` to derive features. 4. **Use new features in a standard classifier**: Integrate extracted features into a machine learning model. 5. **Encapsulate steps in a pipeline**: Combine all operations into a reusable pipeline. #### Plotting in `giotto-tda` 1. **Basic philosophy and `plot` methods**: Understand the fundamentals of plotting in Giotto-TDA. 2. **Derived convenience methods**: Explore `transform_plot` and `fit_transform_plot` for streamlined plotting. #### Getting started with Mapper - **Useful references**: Pointers to relevant external resources. - **Import libraries**: Load necessary Giotto-TDA modules. - **Generate and visualise data**: Create and visualize sample high-dimensional data. - **Configure the Mapper pipeline**: Set up parameters for the Mapper algorithm. - **Visualise the Mapper graph**: Plot the resulting Mapper graph. - **Run the Mapper pipeline**: Execute the configured Mapper process. - **Creating custom filter functions**: Learn to define custom filters for Mapper. - **Visualise the Mapper graph interactively**: Generate an interactive graph visualization (requires a live Jupyter session). #### Topology of time series - **Useful references**: Relevant background information. - **See also**: Links to related sections. - **From time series to time delay embeddings**: Convert time series into delay embeddings. - **A periodic example**: Demonstrate with a periodic time series. - **A non-periodic example**: Demonstrate with a non-periodic time series. - **From time delay embeddings to persistence diagrams**: Compute persistence diagrams from embeddings. - **Picking the embedding dimension and time delay**: Guidance on selecting optimal embedding parameters. #### Topology in time series forecasting - **See also**: Related topics. - **`SlidingWindow`**: Using the sliding window technique for time series analysis. ``` -------------------------------- ### Tutorials and Examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/graphs.html This section provides practical examples and tutorials for using Giotto-TDA's features. ```APIDOC ## Tutorials and Examples ### Description This section offers hands-on tutorials demonstrating various functionalities of the Giotto-TDA library, from basic persistent homology to advanced Mapper and time series analysis. ### Tutorials * **Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy`** * Generate data * Calculate persistent homology * Extract features * Use the new features in a standard classifier * Encapsulate the steps above in a pipeline * **Plotting in `giotto-tda`** * 1. Basic philosophy and `plot` methods * 2 Derived convenience methods: `transform_plot` and `fit_transform_plot` * **Getting started with Mapper** * Useful references * Import libraries * Generate and visualise data * Configure the Mapper pipeline * Visualise the Mapper graph * Run the Mapper pipeline * Creating custom filter functions * Visualise the Mapper graph interactively (Live Jupyter session needed) * **Topology of time series** * Useful references * See also * From time series to time delay embeddings * A periodic example * A non-periodic example * From time delay embeddings to persistence diagrams * Picking the embedding dimension and time delay * **Topology in time series forecasting** * See also * `SlidingWindow` ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/graphs/creation/gtda.graphs.TransitionGraph.html A collection of tutorials and examples demonstrating how to use Giotto-TDA for various topological data analysis tasks. ```APIDOC ## Tutorials and examples ### Description Demonstrations of Giotto-TDA usage for various topological data analysis tasks. ### Tutorials * **Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy`** * Generate data * Calculate persistent homology * Extract features * Use the new features in a standard classifier * Encapsulate the steps above in a pipeline * **Plotting in `giotto-tda`** * 1. Basic philosophy and `plot` methods * 2 Derived convenience methods: `transform_plot` and `fit_transform_plot` * **Getting started with Mapper** * Useful references * Import libraries * Generate and visualise data * Configure the Mapper pipeline * Visualise the Mapper graph * Run the Mapper pipeline * Creating custom filter functions * Visualise the Mapper graph interactively (Live Jupyter session needed) * **Topology of time series** * Useful references * See also * From time series to time delay embeddings * A periodic example * A non-periodic example * From time delay embeddings to persistence diagrams * Picking the embedding dimension and time delay * **Topology in time series forecasting** * See also * `SlidingWindow` ``` -------------------------------- ### Tutorials and Examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/_modules/gtda/mapper/nerve.html This section provides links and descriptions to various tutorials and examples demonstrating the usage of Giotto-TDA for different applications. ```APIDOC ## Tutorials and Examples ### Description This section offers practical guides and code examples to help users understand and apply Giotto-TDA functionalities. ### Tutorial Categories - **Tutorials**: - Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy` - Plotting in `giotto-tda` - Getting started with Mapper - Topology of time series - Topology in time series forecasting ### Example Use Cases - **Topological feature extraction**: Demonstrates calculating persistent homology and extracting features for use in machine learning classifiers, including pipeline encapsulation. - **Plotting**: Covers basic plotting philosophies and advanced `transform_plot` and `fit_transform_plot` methods. - **Mapper**: Guides users through generating data, configuring Mapper pipelines, visualizing Mapper graphs (static and interactive), and creating custom filter functions. - **Time series analysis**: Explains how to derive topological features from time series, including time-delay embedding, persistence diagrams, and forecasting applications. - **Specific Components**: Examples often highlight the use of specific classes like `VietorisRipsPersistence`, `PersistenceEntropy`, `SlidingWindow`, and Mapper components. ``` -------------------------------- ### Format and Diff C++ Code with clang-format Source: https://giotto-ai.github.io/gtda-docs/0.5.1/contributing/index.html This example demonstrates how to use `clang-format` to format a C++ file according to the Google style guide and then compare the formatted file with the original using `diff`. This ensures code consistency. ```bash clang-format --style=google > /tmp/my_cc_file.cc diff /tmp/my_cc_file.cc ``` -------------------------------- ### Installation improvements for Giotto-TDA Source: https://giotto-ai.github.io/gtda-docs/0.5.1/notebooks/time_series_forecasting.html Mentions improvements made to the installation process of Giotto-TDA. This suggests a smoother and more reliable setup experience for users. ```python # This refers to changes in the setup scripts or dependency management. # Users should follow the latest installation instructions provided in the official documentation. # Example: pip install giotto-tda ``` -------------------------------- ### Installation Improvements in Giotto-TDA Source: https://giotto-ai.github.io/gtda-docs/0.5.1/_modules/gtda/mapper/nerve.html Discusses improvements made to the installation process of Giotto-TDA. These updates aim to simplify the setup and ensure compatibility with various environments and dependencies. ```bash # Example installation command (may vary based on environment) pip install giotto-tda # Or using conda # conda install -c conda-forge giotto-tda print("Installation process for Giotto-TDA has been improved.") ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/mapper/covers/gtda.mapper.OneDimensionalCover.html Provides a collection of tutorials and examples demonstrating the usage of Giotto-TDA for various topological data analysis tasks. ```APIDOC ## Tutorials and examples ### Description Provides a collection of tutorials and examples demonstrating the usage of Giotto-TDA for various topological data analysis tasks. ### Tutorials - Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy` - Generate data - Calculate persistent homology - Extract features - Use the new features in a standard classifier - Encapsulate the steps above in a pipeline - Plotting in `giotto-tda` - 1. Basic philosophy and `plot` methods - 2 Derived convenience methods: `transform_plot` and `fit_transform_plot` - Getting started with Mapper - Useful references - Import libraries - Generate and visualise data - Configure the Mapper pipeline - Visualise the Mapper graph - Run the Mapper pipeline - Creating custom filter functions - Visualise the Mapper graph interactively (Live Jupyter session needed) - Topology of time series - Useful references - See also - From time series to time delay embeddings - A periodic example - A non-periodic example - From time delay embeddings to persistence diagrams - Picking the embedding dimension and time delay - Topology in time series forecasting - See also - `SlidingWindow` ``` -------------------------------- ### Tutorials and examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/mapper/pipeline/gtda.mapper.make_mapper_pipeline.html This section provides tutorials and examples demonstrating the usage of Giotto-TDA for various topological data analysis tasks. ```APIDOC ## Tutorials and examples ### Tutorials #### Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy` 1. **Generate data**: Create synthetic data for topological analysis. 2. **Calculate persistent homology**: Use `VietorisRipsPersistence` to compute homology. 3. **Extract features**: Employ `PersistenceEntropy` to derive features. 4. **Use the new features in a standard classifier**: Integrate extracted features into a machine learning model. 5. **Encapsulate the steps above in a pipeline**: Combine all steps into a reusable pipeline. #### Plotting in `giotto-tda` 1. **Basic philosophy and `plot` methods**: Understand the fundamental plotting approaches. 2. **Derived convenience methods**: Utilize `transform_plot` and `fit_transform_plot` for streamlined plotting. #### Getting started with Mapper 1. **Useful references**: Consult relevant background material. 2. **Import libraries**: Load necessary Giotto-TDA modules. 3. **Generate and visualise data**: Create and plot sample data. 4. **Configure the Mapper pipeline**: Set up the parameters for the Mapper algorithm. 5. **Visualise the Mapper graph**: Plot the resulting Mapper graph. 6. **Run the Mapper pipeline**: Execute the configured Mapper process. 7. **Creating custom filter functions**: Define and use custom filters for Mapper. 8. **Visualise the Mapper graph interactively**: Explore the graph dynamically (requires a live Jupyter session). #### Topology of time series 1. **Useful references**: Find relevant theoretical background. 2. **See also**: Links to related sections. 3. **From time series to time delay embeddings**: Convert time series data into embeddings. 4. **A periodic example**: Demonstrate with periodic time series. 5. **A non-periodic example**: Demonstrate with non-periodic time series. 6. **From time delay embeddings to persistence diagrams**: Generate diagrams from embeddings. 7. **Picking the embedding dimension and time delay**: Select optimal parameters for embedding. #### Topology in time series forecasting 1. **See also**: Links to related sections. 2. **`SlidingWindow`**: Apply sliding window preprocessing. ``` -------------------------------- ### Installation improvements for Giotto-TDA Source: https://giotto-ai.github.io/gtda-docs/0.5.1/notebooks/topology_time_series.html Notes improvements made to the installation process of Giotto-TDA, aiming to simplify setup and ensure compatibility across different environments. This includes updates to dependencies and build procedures. ```bash # Example installation command (may vary based on environment) # pip install giotto-tda # For development or specific versions: # git clone https://github.com/giotto-ai/giotto-tda.git # cd giotto-tda # pip install -e . ``` -------------------------------- ### Tutorials and Examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/library.html This section provides links and descriptions for tutorials and examples demonstrating the usage of Giotto-TDA for various applications, including topological feature extraction, plotting, Mapper, and time series analysis. ```APIDOC ## Tutorials and Examples ### Description This section offers practical guides and code examples to help users understand and apply Giotto-TDA functionalities for diverse topological data analysis tasks. ### Tutorials - **Topological feature extraction using `VietorisRipsPersistence` and `PersistenceEntropy`**: Demonstrates a workflow from data generation to feature extraction and pipeline usage. - **Plotting in `giotto-tda`**: Explains the basic plotting philosophy and convenience methods like `transform_plot` and `fit_transform_plot`. - **Getting started with Mapper**: Guides users through configuring, running, and visualizing Mapper pipelines, including custom filter functions. - **Topology of time series**: Shows how to apply topological methods to time series data, from embedding to persistence diagrams. - **Topology in time series forecasting**: Illustrates the application of topological features in time series forecasting tasks, referencing `SlidingWindow`. ``` -------------------------------- ### New tutorials and examples for Giotto-TDA Source: https://giotto-ai.github.io/gtda-docs/0.5.1/notebooks/time_series_forecasting.html Indicates the availability of new tutorials and examples to help users learn and apply Giotto-TDA. These resources cover various applications and functionalities of the library. ```python # This refers to the availability of new documentation and example scripts. # Users should consult the official Giotto-TDA documentation website for these resources. ``` -------------------------------- ### Installation Improvements Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/homology/gtda.homology.SparseRipsPersistence.html Mentions improvements made to the installation process of the Giotto-TDA library. This could include easier dependency management or faster build times. ```bash # Example of installation command (may vary based on improvements): # pip install giotto-tda # Or for development: # git clone # cd giotto-tda # pip install -e . ``` -------------------------------- ### Import Libraries for Topological Analysis Source: https://giotto-ai.github.io/gtda-docs/0.5.1/library.html A common starting point for many Giotto-TDA examples is importing necessary libraries. This snippet shows the typical imports for homology and time series analysis. ```python import numpy as np from gtda.homology import VietorisRipsPersistence, FlagserPersistence from gtda.time_series import SlidingWindow, SingleTakensEmbedding from gtda.graphs import SparseRipsPersistence from gtda.pipeline import Pipeline ``` -------------------------------- ### Classifying 3D Shapes Example Source: https://giotto-ai.github.io/gtda-docs/0.5.1/library.html Provides a step-by-step guide on classifying 3D shapes using Giotto-TDA. It includes generating simple shapes, converting data to persistence diagrams, and training a classifier based on these topological features. ```python # This section would contain Python code for generating 3D shapes, # computing their persistence diagrams, and training a classifier. # Example: Generating simple shapes # from gtda.shape_ અદભૂત import generate_sphere # sphere_data = generate_sphere(n_points=100) # # # Converting data to persistence diagrams # from gtda.homology import VietorisRipsPersistence # vr = VietorisRipsPersistence() # diagrams = vr.fit_transform(sphere_data) # # # Training a classifier would follow using libraries like scikit-learn ``` -------------------------------- ### Gravitational Wave Detection Data Generation (Python) Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/diagrams/representations/gtda.diagrams.HeatKernel.html This example outlines the process of generating synthetic data for gravitational wave detection. It focuses on creating signals with a constant signal-to-noise ratio, which is a common setup for testing detection algorithms. ```python import numpy as np def generate_gravitational_wave_signal(duration, sampling_rate, snr): # Placeholder for actual signal generation logic # This would involve simulating a chirp signal and adding noise num_samples = int(duration * sampling_rate) time = np.linspace(0, duration, num_samples) # Simulate a simplified signal (e.g., a sine wave for demonstration) signal = np.sin(2 * np.pi * 50 * time) * np.exp(-time / 2) # Calculate noise level based on SNR signal_power = np.mean(signal**2) noise_power = signal_power / (snr**2) noise = np.random.normal(0, np.sqrt(noise_power), num_samples) noisy_signal = signal + noise return noisy_signal # Example parameters wave_duration = 4 # seconds sampling_frequency = 1024 # Hz constant_snr = 10 gw_data = generate_gravitational_wave_signal(wave_duration, sampling_frequency, constant_snr) # 'gw_data' now contains the generated time series data. ``` -------------------------------- ### Create Mapper Pipeline with Defaults Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/mapper/pipeline/gtda.mapper.make_mapper_pipeline.html This example demonstrates the basic usage of `make_mapper_pipeline` with all default parameters. It shows how to instantiate the pipeline and inspect the default filter function, which is PCA with 2 components. ```python import numpy as np from gtda.mapper import make_mapper_pipeline mapper = make_mapper_pipeline() print(mapper.__class__) mapper_params = mapper.get_mapper_params() print(mapper_params["filter_func"].__class__) ``` -------------------------------- ### Labeller Initialization and Usage Example (Python) Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/time_series/target_preparation/gtda.time_series.Labeller.html Demonstrates how to initialize the Labeller class with custom parameters like window size and function, and then use it to fit and transform a univariate time series for forecasting. ```python >>> import numpy as np >>> from gtda.time_series import Labeller >>> # Create a time series >>> X = np.arange(10) >>> labeller = Labeller(size=3, func=np.min) >>> # Fit and transform X >>> X, y = labeller.fit_transform_resample(X, X) >>> print(X) [1 2 3 4 5 6 7 8] >>> print(y) [0 1 2 3 4 5 6 7] ``` -------------------------------- ### Stationarizer Initialization and Transformation Example (Python) Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/time_series/preprocessing/gtda.time_series.Stationarizer.html Demonstrates how to initialize the Stationarizer with the 'return' operation and apply it to a noisy signal. It shows the process of creating sample data, instantiating the stationarizer, and then fitting and transforming the data, printing the shape of the resulting stationarized signal. ```python import numpy as np from gtda.time_series import Stationarizer # Create a noisy signal signal = np.asarray([np.sin(x /40) + 5 + np.random.random() for x in range(0, 300)]).reshape(-1, 1) # Initialize the stationarizer stationarizer = Stationarizer(operation='return') # Fit and transform the signal signal_stationarized = stationarizer.fit_transform(signal) print(signal_stationarized.shape) ``` -------------------------------- ### Initialize and use ConsistentRescaling Source: https://giotto-ai.github.io/gtda-docs/0.5.1/_modules/gtda/point_clouds/rescaling.html Demonstrates how to import, instantiate, and apply the ConsistentRescaling transformer to a point cloud dataset to obtain a rescaled distance matrix. ```python import numpy as np from gtda.point_clouds import ConsistentRescaling # Define a point cloud X = np.array([[[0, 0], [1, 2], [5, 6]]]) # Initialize and fit_transform cr = ConsistentRescaling() X_rescaled = cr.fit_transform(X) print(X_rescaled.shape) # Output: (1, 3, 3) ``` -------------------------------- ### Initialize and Fit PersistenceSilhouette Source: https://giotto-ai.github.io/gtda-docs/0.5.1/_modules/gtda/diagrams/representations.html Demonstrates the initialization of the PersistenceSilhouette class and the fit method which calculates samplings based on input persistence diagrams. ```python from gtda.homology import PersistenceSilhouette # Initialize the transformer silhouette = PersistenceSilhouette(power=1.0, n_bins=100) # Fit the transformer to persistence diagrams X # X should be of shape (n_samples, n_features, 3) silhouette.fit(X) # Access computed attributes print(silhouette.homology_dimensions_) print(silhouette.samplings_) ``` -------------------------------- ### Example Usage of GraphGeodesicDistance Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/graphs/processing/gtda.graphs.GraphGeodesicDistance.html An example demonstrating the usage of GraphGeodesicDistance. It first creates a TransitionGraph and then computes the geodesic distances on it using GraphGeodesicDistance. ```python import numpy as np from gtda.graphs import TransitionGraph, GraphGeodesicDistance X = np.arange(4).reshape(1, -1, 1) X_tg = TransitionGraph(func=None).fit_transform(X) print(X_tg[0].toarray()) X_ggd = GraphGeodesicDistance(directed=False).fit_transform(X_tg) print(X_ggd[0]) ``` -------------------------------- ### Time Series Analysis Examples Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/graphs/creation/gtda.graphs.KNeighborsGraph.html Examples demonstrating topological feature extraction from time series data using Giotto-TDA. ```APIDOC ## Time Series Analysis Examples ### Description This section provides examples of how to apply Giotto-TDA to time series data. It covers multivariate and univariate time series, including techniques like sliding windows, Takens Embedding, and endogeneous target preparation. ### Examples * **Multivariate time series example**: Sliding window + topology `Pipeline` * **Univariate time series** – `TakensEmbedding` and `SingleTakensEmbedding` * **Endogeneous target preparation** with `Labeller` ``` -------------------------------- ### Example Usage of MapperPipeline and make_mapper_pipeline Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/mapper/pipeline/gtda.mapper.pipeline.MapperPipeline.html Demonstrates how to create a MapperPipeline using make_mapper_pipeline with PCA, CubicalCover, and DBSCAN. It shows how to retrieve and modify Mapper-specific parameters like clusterer__eps using get_mapper_params and set_params. ```python from sklearn.cluster import DBSCAN from sklearn.decomposition import PCA from gtda.mapper import make_mapper_pipeline, CubicalCover filter_func = PCA(n_components=2) cover = CubicalCover() clusterer = DBSCAN() pipe = make_mapper_pipeline(filter_func=filter_func, cover=cover, clusterer=clusterer) print(pipe.get_mapper_params()["clusterer__eps"]) pipe.set_params(clusterer___eps=0.1) print(pipe.get_mapper_params()["clusterer__eps"]) ``` -------------------------------- ### SlidingWindow Initialization and Transformation Example (Python) Source: https://giotto-ai.github.io/gtda-docs/0.5.1/_modules/gtda/time_series/embedding.html Demonstrates how to initialize SlidingWindow with custom size and stride, and then apply it to transform input data X and resample target data y. It shows the resulting windowed data and resampled target. ```python >>> import numpy as np >>> from gtda.time_series import SlidingWindow >>> # Create a time series of two-dimensional vectors, and a corresponding >>> # time series of scalars >>> X = np.arange(20).reshape(-1, 2) >>> y = np.arange(10) >>> windows = SlidingWindow(size=3, stride=3) >>> # Fit and transform X >>> X_windows = windows.fit_transform(X) >>> print(X_windows) [[[ 2 3] [ 4 5] [ 6 7]] [[ 8 9] [10 11] [12 13]] [[14 15] [16 17] [18 19]]] >>> # Resample y >>> yr = windows.resample(y) >>> print(yr) [3 6 9] ``` -------------------------------- ### CubicalPersistence Transformer Examples in Python Source: https://giotto-ai.github.io/gtda-docs/0.5.1/notebooks/MNIST_classification.html Provides examples of the CubicalPersistence transformer, used for computing persistent homology on cubical data. The `n_jobs=-1` argument allows for parallel computation. ```python CubicalPersistence(n_jobs=-1) ``` ```python CubicalPersistence(n_jobs=-1) ``` -------------------------------- ### FeatureUnion Pipeline Configuration in Python Source: https://giotto-ai.github.io/gtda-docs/0.5.1/notebooks/MNIST_classification.html Example of configuring a FeatureUnion in Giotto-TDA, which combines multiple transformers into a single estimator. This example includes PersistenceEntropy and various Amplitude configurations. ```python FeatureUnion(transformer_list=[('persistenceentropy', PersistenceEntropy(nan_fill_value=-1)), ('amplitude-1', Amplitude(metric='bottleneck', metric_params={}, n_jobs=-1)), ('amplitude-2', Amplitude(metric='wasserstein', metric_params={'p': 1}, n_jobs=-1)), ('amplitude-3', Amplitude(metric='wasserstein', metric_params={'p': 2}, n_jobs=-1)), ('amplitude-4', Amplitude(metric_params={'n_bins': 100, 'n_layers': 1, 'p': 1}, n_jobs=-1)), ('amplitude-10', Amplitude(metric='heat', metric_params={'n_bins': 100, 'p': 1, 'sigma': 1.6}, n_jobs=-1)), ('amplitude-11', Amplitude(metric='heat', metric_params={'n_bins': 100, 'p': 1, 'sigma': 3.2}, n_jobs=-1)), ('amplitude-12', Amplitude(metric='heat', metric_params={'n_bins': 100, 'p': 2, 'sigma': 1.6}, n_jobs=-1)), ('amplitude-13', Amplitude(metric='heat', metric_params={'n_bins': 100, 'p': 2, 'sigma': 3.2}, n_jobs=-1))]) ``` -------------------------------- ### Running Unit Tests Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/homology/gtda.homology.SparseRipsPersistence.html Instructions on how to execute the project's unit tests. This is crucial for verifying code correctness and ensuring that new changes do not introduce regressions. ```bash # To run the unit tests, navigate to the project root directory # and execute the following command: # pytest # Or, if you need to specify a particular test file or directory: # pytest tests/test_module.py ``` -------------------------------- ### Perform Sliding Window Transformation in Python Source: https://giotto-ai.github.io/gtda-docs/0.5.1/modules/generated/time_series/preprocessing/gtda.time_series.SlidingWindow.html This example demonstrates how to initialize a SlidingWindow object, fit it to a time series dataset, and transform the input data into windows. It also shows how to resample a target array to match the generated windows. ```python import numpy as np from gtda.time_series import SlidingWindow # Create a time series of two-dimensional vectors, and a corresponding # time series of scalars X = np.arange(20).reshape(-1, 2) y = np.arange(10) # Initialize SlidingWindow with size 3 and stride 3 windows = SlidingWindow(size=3, stride=3) # Fit and transform X X_windows = windows.fit_transform(X) print(X_windows) # Resample y yr = windows.resample(y) print(yr) ``` -------------------------------- ### Importing giotto-tda and scientific computing libraries Source: https://giotto-ai.github.io/gtda-docs/0.5.1/notebooks/persistent_homology_graphs.html Initializes the environment by importing necessary libraries for numerical computation, graph handling, and topological feature extraction. ```python import numpy as np from numpy.random import default_rng rng = default_rng(42) from scipy.spatial.distance import pdist, squareform from scipy.sparse import coo_matrix from gtda.graphs import GraphGeodesicDistance from gtda.homology import VietorisRipsPersistence, SparseRipsPersistence, FlagserPersistence from igraph import Graph from IPython.display import SVG, display ``` -------------------------------- ### Gravitational Wave Detection Example Source: https://giotto-ai.github.io/gtda-docs/0.5.1/library.html This example demonstrates the application of Giotto-TDA for gravitational wave detection. It covers data generation with a constant signal-to-noise ratio and subsequent topological analysis to identify patterns. ```python # This section would contain Python code for generating simulated gravitational wave data # and applying topological feature extraction techniques. # Example: Generating data with a constant signal-to-noise ratio # import numpy as np # def generate_signal(snr, duration, sampling_rate): # # ... implementation to generate signal ... # return signal # # signal_data = generate_signal(snr=10, duration=4, sampling_rate=1024) # # Further steps would involve applying topological transformers ``` -------------------------------- ### Importing giotto-tda and dependencies Source: https://giotto-ai.github.io/gtda-docs/0.5.1/notebooks/mapper_quickstart.html Initializes the environment by importing necessary data manipulation, visualization, and TDA-specific modules from giotto-tda and scikit-learn. ```python import numpy as np import pandas as pd from gtda.plotting import plot_point_cloud from gtda.mapper import ( CubicalCover, make_mapper_pipeline, Projection, plot_static_mapper_graph, plot_interactive_mapper_graph, MapperInteractivePlotter ) from sklearn import datasets from sklearn.cluster import DBSCAN from sklearn.decomposition import PCA ``` -------------------------------- ### Gravitational Wave Detection Example Source: https://giotto-ai.github.io/gtda-docs/0.5.1/notebooks/time_series_forecasting.html Provides an example of using Giotto-TDA for gravitational wave detection. This involves generating simulated data with a constant signal-to-noise ratio and applying topological methods to identify potential signals. ```python # This section outlines an example, actual code would be more extensive. # It involves data generation and subsequent topological analysis. # Example placeholder for data generation: # def generate_signal(snr): # # ... implementation ... # return signal, noise # signal, noise = generate_signal(snr=1.0) # combined_data = signal + noise # Apply topological feature extraction and classification here. ``` -------------------------------- ### Install and Use clang-tidy for C++ Code Checks Source: https://giotto-ai.github.io/gtda-docs/0.5.1/contributing/index.html This snippet shows how to install `clang-tidy` on Ubuntu 16.04 and use it to check C++ code. `clang-tidy` helps enforce coding standards and identify potential issues. ```bash apt-get install -y clang-tidy ```