cluster-optimizer


Namecluster-optimizer JSON
Version 0.0.1 PyPI version JSON
download
home_pageNone
SummaryA GridSearchCV like object for clustering in sklearn
upload_time2024-06-12 09:12:07
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Andreas Karwath Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords sklearn cluster gridsearch
VCS
bugtrack_url
requirements joblib numpy pandas python-dateutil pytz scikit-learn scipy six threadpoolctl tzdata
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Cluster Optimizer

This is a simple object simulating the [GridSearchCV](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html) object from [scikit-learn (sklearn)](https://scikit-learn.org), but only for clustering. Instead of estimating predictive performance measures using a test fold, it simply calculates unsupervised scores such as the [silhouette_score](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.silhouette_score.html#sklearn.metrics.silhouette_score) or [davies_bouldin_score](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.davies_bouldin_score.html#sklearn.metrics.davies_bouldin_score). 

The object is instantiated with an sklearn cluster algorithm, e.g. [KMeans](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html#sklearn.cluster.KMeans), [HDBScan](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.HDBSCAN.html#sklearn.cluster.HDBSCAN), or similar from from [sklearn.cluster](https://scikit-learn.org/stable/api/sklearn.cluster.html) and a set of parameter options. Different scoring approaches can be supplied as a list of the scoring functions (silhouette_score, davies_bouldin_score, calinski_harabasz_score  from [sklearn.metrics](https://scikit-learn.org/stable/api/sklearn.metrics.html) ). 

Using the ClusterOptimizer.optimize() method will perform a grid search through the supplied parameter space. The scores for all supplied scoring functions are stored for all parameters. 

The results can be obtained by ClusterOptimizer.results, which should return a [pandas](https://pandas.pydata.org/pandas-docs/stable/index.html) [DataFrame](https://pandas.pydata.org/pandas-docs/stable/reference/frame.html#dataframe). 

For one or two parameters, the result DataFrame can be used together with [seaborn](https://seaborn.pydata.org) for visualisation. 






            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cluster-optimizer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "sklearn, cluster, gridsearch",
    "author": null,
    "author_email": "\"A. Karwath\" <cluster_opimizer@karwath.org>",
    "download_url": "https://files.pythonhosted.org/packages/16/bb/226270554245352a2b4281bece661053fd8225dee992c91cb17de2742697/cluster_optimizer-0.0.1.tar.gz",
    "platform": null,
    "description": "# Cluster Optimizer\n\nThis is a simple object simulating the [GridSearchCV](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html) object from [scikit-learn (sklearn)](https://scikit-learn.org), but only for clustering. Instead of estimating predictive performance measures using a test fold, it simply calculates unsupervised scores such as the [silhouette_score](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.silhouette_score.html#sklearn.metrics.silhouette_score) or [davies_bouldin_score](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.davies_bouldin_score.html#sklearn.metrics.davies_bouldin_score). \n\nThe object is instantiated with an sklearn cluster algorithm, e.g. [KMeans](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html#sklearn.cluster.KMeans), [HDBScan](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.HDBSCAN.html#sklearn.cluster.HDBSCAN), or similar from from [sklearn.cluster](https://scikit-learn.org/stable/api/sklearn.cluster.html) and a set of parameter options. Different scoring approaches can be supplied as a list of the scoring functions (silhouette_score, davies_bouldin_score, calinski_harabasz_score  from [sklearn.metrics](https://scikit-learn.org/stable/api/sklearn.metrics.html) ). \n\nUsing the ClusterOptimizer.optimize() method will perform a grid search through the supplied parameter space. The scores for all supplied scoring functions are stored for all parameters. \n\nThe results can be obtained by ClusterOptimizer.results, which should return a [pandas](https://pandas.pydata.org/pandas-docs/stable/index.html) [DataFrame](https://pandas.pydata.org/pandas-docs/stable/reference/frame.html#dataframe). \n\nFor one or two parameters, the result DataFrame can be used together with [seaborn](https://seaborn.pydata.org) for visualisation. \n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Andreas Karwath  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A GridSearchCV like object for clustering in sklearn",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/athro/ClusterOptimizer"
    },
    "split_keywords": [
        "sklearn",
        " cluster",
        " gridsearch"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "09d6c3905335dc879c1f465f1bec1a786c0c2c3418c4a004792acf6d7e02106c",
                "md5": "f32b681ba2b51303dfd6d74a41557817",
                "sha256": "b460e9d95934348f741366d895d0896daf6f31330e2d293bcb6df0d565b7965a"
            },
            "downloads": -1,
            "filename": "cluster_optimizer-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f32b681ba2b51303dfd6d74a41557817",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 4977,
            "upload_time": "2024-06-12T09:12:05",
            "upload_time_iso_8601": "2024-06-12T09:12:05.854126Z",
            "url": "https://files.pythonhosted.org/packages/09/d6/c3905335dc879c1f465f1bec1a786c0c2c3418c4a004792acf6d7e02106c/cluster_optimizer-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "16bb226270554245352a2b4281bece661053fd8225dee992c91cb17de2742697",
                "md5": "be2b94b247371276b37dc249320f1900",
                "sha256": "2e0b2490c02aba4c59127a6286c8fe993962f3a4abc9df2148a60f1998b4da11"
            },
            "downloads": -1,
            "filename": "cluster_optimizer-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "be2b94b247371276b37dc249320f1900",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 5230,
            "upload_time": "2024-06-12T09:12:07",
            "upload_time_iso_8601": "2024-06-12T09:12:07.432693Z",
            "url": "https://files.pythonhosted.org/packages/16/bb/226270554245352a2b4281bece661053fd8225dee992c91cb17de2742697/cluster_optimizer-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-12 09:12:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "athro",
    "github_project": "ClusterOptimizer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "joblib",
            "specs": [
                [
                    "==",
                    "1.4.2"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "1.26.4"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "2.2.2"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.9.0.post0"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    "==",
                    "2024.1"
                ]
            ]
        },
        {
            "name": "scikit-learn",
            "specs": [
                [
                    "==",
                    "1.5.0"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    "==",
                    "1.13.1"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "threadpoolctl",
            "specs": [
                [
                    "==",
                    "3.5.0"
                ]
            ]
        },
        {
            "name": "tzdata",
            "specs": [
                [
                    "==",
                    "2024.1"
                ]
            ]
        }
    ],
    "lcname": "cluster-optimizer"
}
        
Elapsed time: 3.94000s