artlib


Nameartlib JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/NiklasMelton/AdaptiveResonanceLib
SummaryA Python library for Adaptive Resonance Theory (ART) algorithms.
upload_time2024-11-15 09:52:12
maintainerNone
docs_urlNone
authorNiklas M. Melton
requires_python<4.0,>=3.9
licenseMIT
keywords adaptive resonance theory art machine learning neural networks clustering
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# AdaptiveResonanceLib

Welcome to AdaptiveResonanceLib, a comprehensive and modular Python library for Adaptive Resonance Theory (ART) algorithms. Based on scikit-learn, our library offers a wide range of ART models designed for both researchers and practitioners in the field of machine learning and neural networks. Whether you're working on classification, clustering, or pattern recognition, AdaptiveResonanceLib provides the tools you need to implement ART algorithms efficiently and effectively.

<!-- START available_models -->
## Available Models

AdaptiveResonanceLib includes implementations for the following ART models:

- #### Elementary Clustering
    - [ART1](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.ART1)
    - [ART2](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.ART2A)
    - [Bayesian ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.BayesianART)
    - [Gaussian ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.GaussianART)
    - [Hypersphere ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.HypersphereART)
    - [Ellipsoid ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.EllipsoidART)
    - [Fuzzy ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.FuzzyART)
    - [Quadratic Neuron ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.QuadraticNeuronART)
- #### Metric Informed
    - [CVI ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.CVIART)
    - [iCVI Fuzzy ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.iCVIFuzzyART)
- #### Topological
    - [Topo ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.TopoART)
    - [Dual Vigilance ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.DualVigilanceART)
- #### Classification
    - [Simple ARTMAP](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.SimpleARTMAP)
- #### Regression
    - [ARTMAP](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.ARTMAP)
    - [Fusion ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.FusionART)
- #### Hierarchical
    - [DeepARTMAP](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.DeepARTMAP)
    - [SMART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.SMART)
- #### Data Fusion
    - [Fusion ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.FusionART)
- #### Reinforcement Learning
    - [FALCON](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.FALCON)
    - [TD-FALCON](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.TD_FALCON)
- #### Biclustering
    - [Biclustering ARTMAP](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.biclustering.html#artlib.biclustering.BARTMAP.BARTMAP)

<!-- END available_models -->

<!-- START comparison_of_elementary_models -->
## Comparison of Elementary Models

[comment]: <> (![Comparison of Elementary Images]&#40;https://github.com/NiklasMelton/AdaptiveResonanceLib/raw/main/docs/_static/comparison_of_elementary_methods.jpg?raw=true"&#41;)
![Comparison of Elementary Images](https://github.com/NiklasMelton/AdaptiveResonanceLib/raw/main/img/comparison_of_elementary_methods.jpg?raw=true")
<!-- END comparison_of_elementary_models -->

<!-- START installation -->
## Installation

To install AdaptiveResonanceLib, simply use pip:

```bash
pip install artlib
```

Or to install directly from the most recent source:

```bash
pip install git+https://github.com/NiklasMelton/AdaptiveResonanceLib.git@develop
```

Ensure you have Python 3.9 or newer installed.
<!-- END installation -->

<!-- START quick-start -->
## Quick Start

Here are some quick examples to get you started with AdaptiveResonanceLib:

### Clustering Data with the Fuzzy ART model

```python
from artlib import FuzzyART
import numpy as np

# Your dataset
train_X = np.array([...]) # shape (n_samples, n_features)
test_X = np.array([...])

# Initialize the Fuzzy ART model
model = FuzzyART(rho=0.7, alpha = 0.0, beta=1.0)

# Prepare Data
train_X_prep = model.prepare_data(train_X)
test_X_prep = model.prepare_data(test_X)

# Fit the model
model.fit(train_X_prep)

# Predict data labels
predictions = model.predict(test_X_prep)
```

### Fitting a Classification Model with SimpleARTMAP

```python
from artlib import GaussianART, SimpleARTMAP
import numpy as np

# Your dataset
train_X = np.array([...]) # shape (n_samples, n_features)
train_y = np.array([...]) # shape (n_samples, ), must be integers
test_X = np.array([...])

# Initialize the Gaussian ART model
sigma_init = np.array([0.5]*train_X.shape[1]) # variance estimate for each feature
module_a = GaussianART(rho=0.0, sigma_init=sigma_init)

# Initialize the SimpleARTMAP model
model = SimpleARTMAP(module_a=module_a)

# Prepare Data
train_X_prep = model.prepare_data(train_X)
test_X_prep = model.prepare_data(test_X)

# Fit the model
model.fit(train_X_prep, train_y)

# Predict data labels
predictions = model.predict(test_X_prep)
```

### Fitting a Regression Model with FusionART

```python
from artlib import FuzzyART, HypersphereART, FusionART
import numpy as np

# Your dataset
train_X = np.array([...]) # shape (n_samples, n_features_X)
train_y = np.array([...]) # shape (n_samples, n_features_y)
test_X = np.array([...])

# Initialize the Fuzzy ART model
module_x = FuzzyART(rho=0.0, alpha = 0.0, beta=1.0)

# Initialize the Hypersphere ART model
r_hat = 0.5*np.sqrt(train_X.shape[1]) # no restriction on hyperpshere size
module_y = HypersphereART(rho=0.0, alpha = 0.0, beta=1.0, r_hat=r_hat)

# Initialize the FusionARTMAP model
gamma_values = [0.5, 0.5] # eqaul weight to both channels
channel_dims = [
  2*train_X.shape[1], # fuzzy ART complement codes data so channel dim is 2*n_features
  train_y.shape[1]
]
model = FusionART(
  modules=[module_x, module_y],
  gamma_values=gamma_values,
  channel_dims=channel_dims
)

# Prepare Data
train_Xy = model.join_channel_data(channel_data=[train_X, train_y])
train_Xy_prep = model.prepare_data(train_Xy)
test_Xy = model.join_channel_data(channel_data=[train_X], skip_channels=[1])
test_Xy_prep = model.prepare_data(test_Xy)

# Fit the model
model.fit(train_X_prep, train_y)

# Predict y-channel values
pred_y = model.predict_regression(test_Xy_prep, target_channels=[1])
```

<!-- END quick-start -->

<!-- START documentation -->
## Documentation

For more detailed documentation, including the full list of parameters for each model, visit our [Read the Docs page](https://adaptiveresonancelib.readthedocs.io/en/latest/index.html).
<!-- END documentation -->

<!-- START examples -->
## Examples

For examples of how to use each model in AdaptiveResonanceLib, check out the [`/examples`](https://github.com/NiklasMelton/AdaptiveResonanceLib/tree/develop/examples) directory in our repository.
<!-- END examples -->

<!-- START contributing -->
## Contributing

We welcome contributions to AdaptiveResonanceLib! If you have suggestions for improvements, or if you'd like to add more ART models, please see our `CONTRIBUTING.md` file for guidelines on how to contribute.

You can also join our [Discord server](https://discord.gg/E465HBwEuN) and participate directly in the discussion.
<!-- END contributing -->

<!-- START license -->
## License

AdaptiveResonanceLib is open source and available under the MIT license. See the [`LICENSE`](https://github.com/NiklasMelton/AdaptiveResonanceLib/blob/develop/LICENSE) file for more info.
<!-- END license -->

<!-- START contact -->
## Contact

For questions and support, please open an issue in the GitHub issue tracker or message us on our [Discord server](https://discord.gg/E465HBwEuN). We'll do our best to assist you.

Happy Modeling with AdaptiveResonanceLib!
<!-- END contact -->

<!-- START citation -->
## Citing this Repository
If you use this project in your research, please cite it as:

Melton, N. (2024). AdaptiveResonanceLib (Version 0.1.3)
<!-- END citation -->


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/NiklasMelton/AdaptiveResonanceLib",
    "name": "artlib",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "adaptive resonance theory, ART, machine learning, neural networks, clustering",
    "author": "Niklas M. Melton",
    "author_email": "niklasmelton@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7a/35/dc9aa8e8bcbb2686f649179fb5ef18a40b3ec714b77804a089357f897e34/artlib-0.1.3.tar.gz",
    "platform": null,
    "description": "\n# AdaptiveResonanceLib\n\nWelcome to AdaptiveResonanceLib, a comprehensive and modular Python library for Adaptive Resonance Theory (ART) algorithms. Based on scikit-learn, our library offers a wide range of ART models designed for both researchers and practitioners in the field of machine learning and neural networks. Whether you're working on classification, clustering, or pattern recognition, AdaptiveResonanceLib provides the tools you need to implement ART algorithms efficiently and effectively.\n\n<!-- START available_models -->\n## Available Models\n\nAdaptiveResonanceLib includes implementations for the following ART models:\n\n- #### Elementary Clustering\n    - [ART1](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.ART1)\n    - [ART2](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.ART2A)\n    - [Bayesian ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.BayesianART)\n    - [Gaussian ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.GaussianART)\n    - [Hypersphere ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.HypersphereART)\n    - [Ellipsoid ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.EllipsoidART)\n    - [Fuzzy ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.FuzzyART)\n    - [Quadratic Neuron ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.QuadraticNeuronART)\n- #### Metric Informed\n    - [CVI ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.CVIART)\n    - [iCVI Fuzzy ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.iCVIFuzzyART)\n- #### Topological\n    - [Topo ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.TopoART)\n    - [Dual Vigilance ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.DualVigilanceART)\n- #### Classification\n    - [Simple ARTMAP](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.SimpleARTMAP)\n- #### Regression\n    - [ARTMAP](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.ARTMAP)\n    - [Fusion ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.FusionART)\n- #### Hierarchical\n    - [DeepARTMAP](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.DeepARTMAP)\n    - [SMART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.SMART)\n- #### Data Fusion\n    - [Fusion ART](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.FusionART)\n- #### Reinforcement Learning\n    - [FALCON](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.FALCON)\n    - [TD-FALCON](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.html#artlib.TD_FALCON)\n- #### Biclustering\n    - [Biclustering ARTMAP](https://adaptiveresonancelib.readthedocs.io/en/latest/artlib.biclustering.html#artlib.biclustering.BARTMAP.BARTMAP)\n\n<!-- END available_models -->\n\n<!-- START comparison_of_elementary_models -->\n## Comparison of Elementary Models\n\n[comment]: <> (![Comparison of Elementary Images]&#40;https://github.com/NiklasMelton/AdaptiveResonanceLib/raw/main/docs/_static/comparison_of_elementary_methods.jpg?raw=true\"&#41;)\n![Comparison of Elementary Images](https://github.com/NiklasMelton/AdaptiveResonanceLib/raw/main/img/comparison_of_elementary_methods.jpg?raw=true\")\n<!-- END comparison_of_elementary_models -->\n\n<!-- START installation -->\n## Installation\n\nTo install AdaptiveResonanceLib, simply use pip:\n\n```bash\npip install artlib\n```\n\nOr to install directly from the most recent source:\n\n```bash\npip install git+https://github.com/NiklasMelton/AdaptiveResonanceLib.git@develop\n```\n\nEnsure you have Python 3.9 or newer installed.\n<!-- END installation -->\n\n<!-- START quick-start -->\n## Quick Start\n\nHere are some quick examples to get you started with AdaptiveResonanceLib:\n\n### Clustering Data with the Fuzzy ART model\n\n```python\nfrom artlib import FuzzyART\nimport numpy as np\n\n# Your dataset\ntrain_X = np.array([...]) # shape (n_samples, n_features)\ntest_X = np.array([...])\n\n# Initialize the Fuzzy ART model\nmodel = FuzzyART(rho=0.7, alpha = 0.0, beta=1.0)\n\n# Prepare Data\ntrain_X_prep = model.prepare_data(train_X)\ntest_X_prep = model.prepare_data(test_X)\n\n# Fit the model\nmodel.fit(train_X_prep)\n\n# Predict data labels\npredictions = model.predict(test_X_prep)\n```\n\n### Fitting a Classification Model with SimpleARTMAP\n\n```python\nfrom artlib import GaussianART, SimpleARTMAP\nimport numpy as np\n\n# Your dataset\ntrain_X = np.array([...]) # shape (n_samples, n_features)\ntrain_y = np.array([...]) # shape (n_samples, ), must be integers\ntest_X = np.array([...])\n\n# Initialize the Gaussian ART model\nsigma_init = np.array([0.5]*train_X.shape[1]) # variance estimate for each feature\nmodule_a = GaussianART(rho=0.0, sigma_init=sigma_init)\n\n# Initialize the SimpleARTMAP model\nmodel = SimpleARTMAP(module_a=module_a)\n\n# Prepare Data\ntrain_X_prep = model.prepare_data(train_X)\ntest_X_prep = model.prepare_data(test_X)\n\n# Fit the model\nmodel.fit(train_X_prep, train_y)\n\n# Predict data labels\npredictions = model.predict(test_X_prep)\n```\n\n### Fitting a Regression Model with FusionART\n\n```python\nfrom artlib import FuzzyART, HypersphereART, FusionART\nimport numpy as np\n\n# Your dataset\ntrain_X = np.array([...]) # shape (n_samples, n_features_X)\ntrain_y = np.array([...]) # shape (n_samples, n_features_y)\ntest_X = np.array([...])\n\n# Initialize the Fuzzy ART model\nmodule_x = FuzzyART(rho=0.0, alpha = 0.0, beta=1.0)\n\n# Initialize the Hypersphere ART model\nr_hat = 0.5*np.sqrt(train_X.shape[1]) # no restriction on hyperpshere size\nmodule_y = HypersphereART(rho=0.0, alpha = 0.0, beta=1.0, r_hat=r_hat)\n\n# Initialize the FusionARTMAP model\ngamma_values = [0.5, 0.5] # eqaul weight to both channels\nchannel_dims = [\n  2*train_X.shape[1], # fuzzy ART complement codes data so channel dim is 2*n_features\n  train_y.shape[1]\n]\nmodel = FusionART(\n  modules=[module_x, module_y],\n  gamma_values=gamma_values,\n  channel_dims=channel_dims\n)\n\n# Prepare Data\ntrain_Xy = model.join_channel_data(channel_data=[train_X, train_y])\ntrain_Xy_prep = model.prepare_data(train_Xy)\ntest_Xy = model.join_channel_data(channel_data=[train_X], skip_channels=[1])\ntest_Xy_prep = model.prepare_data(test_Xy)\n\n# Fit the model\nmodel.fit(train_X_prep, train_y)\n\n# Predict y-channel values\npred_y = model.predict_regression(test_Xy_prep, target_channels=[1])\n```\n\n<!-- END quick-start -->\n\n<!-- START documentation -->\n## Documentation\n\nFor more detailed documentation, including the full list of parameters for each model, visit our [Read the Docs page](https://adaptiveresonancelib.readthedocs.io/en/latest/index.html).\n<!-- END documentation -->\n\n<!-- START examples -->\n## Examples\n\nFor examples of how to use each model in AdaptiveResonanceLib, check out the [`/examples`](https://github.com/NiklasMelton/AdaptiveResonanceLib/tree/develop/examples) directory in our repository.\n<!-- END examples -->\n\n<!-- START contributing -->\n## Contributing\n\nWe welcome contributions to AdaptiveResonanceLib! If you have suggestions for improvements, or if you'd like to add more ART models, please see our `CONTRIBUTING.md` file for guidelines on how to contribute.\n\nYou can also join our [Discord server](https://discord.gg/E465HBwEuN) and participate directly in the discussion.\n<!-- END contributing -->\n\n<!-- START license -->\n## License\n\nAdaptiveResonanceLib is open source and available under the MIT license. See the [`LICENSE`](https://github.com/NiklasMelton/AdaptiveResonanceLib/blob/develop/LICENSE) file for more info.\n<!-- END license -->\n\n<!-- START contact -->\n## Contact\n\nFor questions and support, please open an issue in the GitHub issue tracker or message us on our [Discord server](https://discord.gg/E465HBwEuN). We'll do our best to assist you.\n\nHappy Modeling with AdaptiveResonanceLib!\n<!-- END contact -->\n\n<!-- START citation -->\n## Citing this Repository\nIf you use this project in your research, please cite it as:\n\nMelton, N. (2024). AdaptiveResonanceLib (Version 0.1.3)\n<!-- END citation -->\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python library for Adaptive Resonance Theory (ART) algorithms.",
    "version": "0.1.3",
    "project_urls": {
        "Documentation": "https://github.com/NiklasMelton/AdaptiveResonanceLib",
        "Homepage": "https://github.com/NiklasMelton/AdaptiveResonanceLib",
        "Repository": "https://github.com/NiklasMelton/AdaptiveResonanceLib"
    },
    "split_keywords": [
        "adaptive resonance theory",
        " art",
        " machine learning",
        " neural networks",
        " clustering"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f7c519de330a786a5b830c57fec0955b2c40b856a31b886145e5f362194ab83e",
                "md5": "aa8684cae686cbfe30bb9c57107f2147",
                "sha256": "de3756eb7d93e4e51ed8edde79a61134cfa3d135729a1dcf5dedcd2c3c9e43b5"
            },
            "downloads": -1,
            "filename": "artlib-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aa8684cae686cbfe30bb9c57107f2147",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 85936,
            "upload_time": "2024-11-15T09:52:11",
            "upload_time_iso_8601": "2024-11-15T09:52:11.315336Z",
            "url": "https://files.pythonhosted.org/packages/f7/c5/19de330a786a5b830c57fec0955b2c40b856a31b886145e5f362194ab83e/artlib-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7a35dc9aa8e8bcbb2686f649179fb5ef18a40b3ec714b77804a089357f897e34",
                "md5": "0c8f569c0dfe1f25b814d43ea8ffb01a",
                "sha256": "ede97ff740b7ed13b4066f50c6b557f85fe2d11bc163c0153f09170fa6afb7a1"
            },
            "downloads": -1,
            "filename": "artlib-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "0c8f569c0dfe1f25b814d43ea8ffb01a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 59915,
            "upload_time": "2024-11-15T09:52:12",
            "upload_time_iso_8601": "2024-11-15T09:52:12.972382Z",
            "url": "https://files.pythonhosted.org/packages/7a/35/dc9aa8e8bcbb2686f649179fb5ef18a40b3ec714b77804a089357f897e34/artlib-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-15 09:52:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NiklasMelton",
    "github_project": "AdaptiveResonanceLib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "artlib"
}
        
Elapsed time: 0.38470s