GTMAnalysisToolkit


NameGTMAnalysisToolkit JSON
Version 1.0.2 PyPI version JSON
download
home_page
SummaryGenerative Topographic Mapping and Analysis Toolkit
upload_time2024-02-18 15:47:58
maintainer
docs_urlNone
authorEng. Alberto Biscalchin
requires_python
license
keywords generative topographic mapping dimensionality reduction data visualization machine learning high-dimensional data analysis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Generative Topographic Mapping and Analysis Toolkit
## Introduction

The Generative Topographic Mapping and Analysis Toolkit is a Python package designed for high-dimensional data analysis using Generative Topographic Mapping (GTM). This toolkit facilitates the visualization of high-dimensional datasets in lower-dimensional spaces, supports both forward and inverse mappings, and offers comprehensive tools for model fitting, dimensionality reduction, error analysis, and hyperparameter optimization. It is particularly useful for researchers and practitioners in machine learning, data science, and bioinformatics.

## Features

- GTM model fitting for dimensionality reduction and data visualization.
- k-nearest neighbor normalized error (k3n-error) calculation for error analysis.
- Cross-validation based hyperparameter optimization for GTM models.
- Support for both forward analysis (regression) and inverse analysis.
- Visualization tools for low-dimensional embeddings of high-dimensional data.

## Installation 

To install the GTMAnalysisToolkit, run the following command in your terminal:
```bash
pip install GTMAnalysisToolkit
```
Ensure you have Python 3.x installed on your system. This package depends on numpy, scipy, matplotlib, and sklearn, which will be automatically installed during the GTMAnalysisToolkit installation.

## Quick Start

Here's a quick example to get you started with using the GTMAnalysisToolkit:

```Python
import matplotlib.figure as figure
import matplotlib.pyplot as plt
from GTMAnalysisToolkit import GTM
from sklearn.datasets import load_iris

# settings
shape_of_map = [10, 10]
shape_of_rbf_centers = [5, 5]
variance_of_rbfs = 4
lambda_in_em_algorithm = 0.001
number_of_iterations = 300
display_flag = 1

# load an iris dataset
iris = load_iris()
# input_dataset = pd.DataFrame(iris.data, columns=iris.feature_names)
input_dataset = iris.data
color = iris.target

# autoscaling
input_dataset = (input_dataset - input_dataset.mean(axis=0)) / input_dataset.std(axis=0, ddof=1)

# construct GTM model
model = GTM(shape_of_map, shape_of_rbf_centers, variance_of_rbfs, lambda_in_em_algorithm, number_of_iterations,
            display_flag)
model.fit(input_dataset)

if model.success_flag:
    # calculate of responsibilities
    responsibilities = model.responsibility(input_dataset)

    # plot the mean of responsibilities
    means = responsibilities.dot(model.map_grids)
    plt.figure(figsize=figure.figaspect(1))
    plt.scatter(means[:, 0], means[:, 1], c=color)
    plt.ylim(-1.1, 1.1)
    plt.xlim(-1.1, 1.1)
    plt.xlabel("z1 (mean)")
    plt.ylabel("z2 (mean)")
    plt.show()

    # plot the mode of responsibilities
    modes = model.map_grids[responsibilities.argmax(axis=1), :]
    plt.figure(figsize=figure.figaspect(1))
    plt.scatter(modes[:, 0], modes[:, 1], c=color)
    plt.ylim(-1.1, 1.1)
    plt.xlim(-1.1, 1.1)
    plt.xlabel("z1 (mode)")
    plt.ylabel("z2 (mode)")
    plt.show()

```

## License

This project is licensed under the GNU General Public License version 3 (GPL-3.0) - see the LICENSE file for details.

## Contributing
We welcome contributions to the GTMAnalysisToolkit! If you have suggestions or want to contribute code, please feel free to open an issue or pull request on our GitHub repository.

## Contact
For questions or support, please contact Eng. Alberto Biscalchin at biscalchin.mau.se@gmail.com

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "GTMAnalysisToolkit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "generative topographic mapping,dimensionality reduction,data visualization,machine learning,high-dimensional data analysis",
    "author": "Eng. Alberto Biscalchin",
    "author_email": "<biscalchin.mau.se@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/9f/88/87264ee16bb07b636e06ae8ebe952aae2e950a0529445e25c3a8b211387c/GTMAnalysisToolkit-1.0.2.tar.gz",
    "platform": null,
    "description": "# Generative Topographic Mapping and Analysis Toolkit\r\n## Introduction\r\n\r\nThe Generative Topographic Mapping and Analysis Toolkit is a Python package designed for high-dimensional data analysis using Generative Topographic Mapping (GTM). This toolkit facilitates the visualization of high-dimensional datasets in lower-dimensional spaces, supports both forward and inverse mappings, and offers comprehensive tools for model fitting, dimensionality reduction, error analysis, and hyperparameter optimization. It is particularly useful for researchers and practitioners in machine learning, data science, and bioinformatics.\r\n\r\n## Features\r\n\r\n- GTM model fitting for dimensionality reduction and data visualization.\r\n- k-nearest neighbor normalized error (k3n-error) calculation for error analysis.\r\n- Cross-validation based hyperparameter optimization for GTM models.\r\n- Support for both forward analysis (regression) and inverse analysis.\r\n- Visualization tools for low-dimensional embeddings of high-dimensional data.\r\n\r\n## Installation \r\n\r\nTo install the GTMAnalysisToolkit, run the following command in your terminal:\r\n```bash\r\npip install GTMAnalysisToolkit\r\n```\r\nEnsure you have Python 3.x installed on your system. This package depends on numpy, scipy, matplotlib, and sklearn, which will be automatically installed during the GTMAnalysisToolkit installation.\r\n\r\n## Quick Start\r\n\r\nHere's a quick example to get you started with using the GTMAnalysisToolkit:\r\n\r\n```Python\r\nimport matplotlib.figure as figure\r\nimport matplotlib.pyplot as plt\r\nfrom GTMAnalysisToolkit import GTM\r\nfrom sklearn.datasets import load_iris\r\n\r\n# settings\r\nshape_of_map = [10, 10]\r\nshape_of_rbf_centers = [5, 5]\r\nvariance_of_rbfs = 4\r\nlambda_in_em_algorithm = 0.001\r\nnumber_of_iterations = 300\r\ndisplay_flag = 1\r\n\r\n# load an iris dataset\r\niris = load_iris()\r\n# input_dataset = pd.DataFrame(iris.data, columns=iris.feature_names)\r\ninput_dataset = iris.data\r\ncolor = iris.target\r\n\r\n# autoscaling\r\ninput_dataset = (input_dataset - input_dataset.mean(axis=0)) / input_dataset.std(axis=0, ddof=1)\r\n\r\n# construct GTM model\r\nmodel = GTM(shape_of_map, shape_of_rbf_centers, variance_of_rbfs, lambda_in_em_algorithm, number_of_iterations,\r\n            display_flag)\r\nmodel.fit(input_dataset)\r\n\r\nif model.success_flag:\r\n    # calculate of responsibilities\r\n    responsibilities = model.responsibility(input_dataset)\r\n\r\n    # plot the mean of responsibilities\r\n    means = responsibilities.dot(model.map_grids)\r\n    plt.figure(figsize=figure.figaspect(1))\r\n    plt.scatter(means[:, 0], means[:, 1], c=color)\r\n    plt.ylim(-1.1, 1.1)\r\n    plt.xlim(-1.1, 1.1)\r\n    plt.xlabel(\"z1 (mean)\")\r\n    plt.ylabel(\"z2 (mean)\")\r\n    plt.show()\r\n\r\n    # plot the mode of responsibilities\r\n    modes = model.map_grids[responsibilities.argmax(axis=1), :]\r\n    plt.figure(figsize=figure.figaspect(1))\r\n    plt.scatter(modes[:, 0], modes[:, 1], c=color)\r\n    plt.ylim(-1.1, 1.1)\r\n    plt.xlim(-1.1, 1.1)\r\n    plt.xlabel(\"z1 (mode)\")\r\n    plt.ylabel(\"z2 (mode)\")\r\n    plt.show()\r\n\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the GNU General Public License version 3 (GPL-3.0) - see the LICENSE file for details.\r\n\r\n## Contributing\r\nWe welcome contributions to the GTMAnalysisToolkit! If you have suggestions or want to contribute code, please feel free to open an issue or pull request on our GitHub repository.\r\n\r\n## Contact\r\nFor questions or support, please contact Eng. Alberto Biscalchin at biscalchin.mau.se@gmail.com\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Generative Topographic Mapping and Analysis Toolkit",
    "version": "1.0.2",
    "project_urls": null,
    "split_keywords": [
        "generative topographic mapping",
        "dimensionality reduction",
        "data visualization",
        "machine learning",
        "high-dimensional data analysis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "42cc55966bd55bc5c852ddeb153a2a37ef842bb9ebc587e3c48c6b6731bf8c98",
                "md5": "396aa97be6c712bc34f6cb1df010d4e8",
                "sha256": "2f64b93a435da5ef12a1f3b0d55bfc8817efb5e8887bef1c5152c1905e377d88"
            },
            "downloads": -1,
            "filename": "GTMAnalysisToolkit-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "396aa97be6c712bc34f6cb1df010d4e8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 25254,
            "upload_time": "2024-02-18T15:47:57",
            "upload_time_iso_8601": "2024-02-18T15:47:57.522066Z",
            "url": "https://files.pythonhosted.org/packages/42/cc/55966bd55bc5c852ddeb153a2a37ef842bb9ebc587e3c48c6b6731bf8c98/GTMAnalysisToolkit-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9f8887264ee16bb07b636e06ae8ebe952aae2e950a0529445e25c3a8b211387c",
                "md5": "4e130844590a179092a631e0b391c3e9",
                "sha256": "2f723735c3ef9dd19a6e371cc2a1570635e6798735872ea35a0e5dbcd1916072"
            },
            "downloads": -1,
            "filename": "GTMAnalysisToolkit-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "4e130844590a179092a631e0b391c3e9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25967,
            "upload_time": "2024-02-18T15:47:58",
            "upload_time_iso_8601": "2024-02-18T15:47:58.946101Z",
            "url": "https://files.pythonhosted.org/packages/9f/88/87264ee16bb07b636e06ae8ebe952aae2e950a0529445e25c3a8b211387c/GTMAnalysisToolkit-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-18 15:47:58",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "gtmanalysistoolkit"
}
        
Elapsed time: 0.23675s