scikit-ntk


Namescikit-ntk JSON
Version 1.2.1 PyPI version JSON
download
home_pagehttps://github.com/392781/scikit-ntk
SummaryImplementation of the neural tangent kernel for scikit-learn's Gaussian process module.
upload_time2024-10-07 23:21:17
maintainerNone
docs_urlNone
authorRonaldas P Lencevičius
requires_python<3.14,>=3.8
licenseBSD-3-Clause
keywords sckit-learn sklearn
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Neural Tangent Kernel for `scikit-learn` Gaussian Processes

![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/392781/scikit-ntk/CI.yml?branch=master&label=Lint%2C%20Build%2C%20Install%2C%20Test&style=flat-square) ![PyPI](https://img.shields.io/pypi/v/scikit-ntk?style=flat-square) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/scikit-ntk?style=flat-square) ![PyPI - Downloads](https://img.shields.io/pypi/dm/scikit-ntk?style=flat-square) [![Bibtex citation](https://img.shields.io/badge/bibtex-citation-lightgrey?style=flat-square)](#citation)

**scikit-ntk** is implementation of the neural tangent kernel (NTK) for the `scikit-learn` machine learning library as part of "An Empirical Analysis of the Laplace and Neural Tangent Kernels" master's thesis (found at [http://hdl.handle.net/20.500.12680/d504rr81v](http://hdl.handle.net/20.500.12680/d504rr81v) and [https://arxiv.org/abs/2208.03761](https://arxiv.org/abs/2208.03761)).  This library is meant to directly integrate with [`sklearn.gaussian_process`](https://scikit-learn.org/stable/modules/classes.html#module-sklearn.gaussian_process) module.  This implementation of the NTK can be used in combination with other kernels to train and predict with Gaussian process regressors and classifiers. 

## Installation

### Dependencies

scikit-ntk requires:
* Python (>=3.8)
* scikit-learn (>=1.0.1)


### User installation
In terminal using `pip` run:

```bash
pip install scikit-ntk
```

### Usage
Usage is described in [`examples/usage.py`](https://github.com/392781/scikit-ntk/blob/master/example/usage.py); however, to get started simply import the `NeuralTangentKernel` class:

```py
from skntk import NeuralTangentKernel as NTK

kernel_ntk = NTK(D=3, bias=0.01, bias_bounds=(1e-6, 1e6))
```
Once declared, usage is the same as other `scikit-learn` kernels.

## Building
Python Poetry (>=1.2) is required if you wish to build `scikit-ntk` from source.  In order to build follow these steps:

1. Clone the repository
```bash
git clone git@github.com:392781/scikit-ntk.git
```
2. Enable a Poetry virtual environment
```bash
poetry shell
```
3. Build and install
```bash
poetry build
poetry install --with dev
```

## Citation

If you use scikit-ntk in your scientific work, please use the following citation alongside the scikit-learn citations found at [https://scikit-learn.org/stable/about.html#citing-scikit-learn](https://scikit-learn.org/stable/about.html#citing-scikit-learn):

```
@mastersthesis{lencevicius2022laplacentk,
  author  = "Ronaldas Paulius Lencevicius",
  title   = "An Empirical Analysis of the Laplace and Neural Tangent Kernels",
  school  = "California State Polytechnic University, Pomona",
  year    = "2022",
  month   = "August",
  note    = {\url{http://hdl.handle.net/20.500.12680/d504rr81v}}
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/392781/scikit-ntk",
    "name": "scikit-ntk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.8",
    "maintainer_email": null,
    "keywords": "sckit-learn, sklearn",
    "author": "Ronaldas P Lencevi\u010dius",
    "author_email": "contact@ronaldas.dev",
    "download_url": "https://files.pythonhosted.org/packages/51/96/b2a7af9daa4f2c986d2e97a001125572ebee0591d605038298ad7307283c/scikit_ntk-1.2.1.tar.gz",
    "platform": null,
    "description": "## Neural Tangent Kernel for `scikit-learn` Gaussian Processes\n\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/392781/scikit-ntk/CI.yml?branch=master&label=Lint%2C%20Build%2C%20Install%2C%20Test&style=flat-square) ![PyPI](https://img.shields.io/pypi/v/scikit-ntk?style=flat-square) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/scikit-ntk?style=flat-square) ![PyPI - Downloads](https://img.shields.io/pypi/dm/scikit-ntk?style=flat-square) [![Bibtex citation](https://img.shields.io/badge/bibtex-citation-lightgrey?style=flat-square)](#citation)\n\n**scikit-ntk** is implementation of the neural tangent kernel (NTK) for the `scikit-learn` machine learning library as part of \"An Empirical Analysis of the Laplace and Neural Tangent Kernels\" master's thesis (found at [http://hdl.handle.net/20.500.12680/d504rr81v](http://hdl.handle.net/20.500.12680/d504rr81v) and [https://arxiv.org/abs/2208.03761](https://arxiv.org/abs/2208.03761)).  This library is meant to directly integrate with [`sklearn.gaussian_process`](https://scikit-learn.org/stable/modules/classes.html#module-sklearn.gaussian_process) module.  This implementation of the NTK can be used in combination with other kernels to train and predict with Gaussian process regressors and classifiers. \n\n## Installation\n\n### Dependencies\n\nscikit-ntk requires:\n* Python (>=3.8)\n* scikit-learn (>=1.0.1)\n\n\n### User installation\nIn terminal using `pip` run:\n\n```bash\npip install scikit-ntk\n```\n\n### Usage\nUsage is described in [`examples/usage.py`](https://github.com/392781/scikit-ntk/blob/master/example/usage.py); however, to get started simply import the `NeuralTangentKernel` class:\n\n```py\nfrom skntk import NeuralTangentKernel as NTK\n\nkernel_ntk = NTK(D=3, bias=0.01, bias_bounds=(1e-6, 1e6))\n```\nOnce declared, usage is the same as other `scikit-learn` kernels.\n\n## Building\nPython Poetry (>=1.2) is required if you wish to build `scikit-ntk` from source.  In order to build follow these steps:\n\n1. Clone the repository\n```bash\ngit clone git@github.com:392781/scikit-ntk.git\n```\n2. Enable a Poetry virtual environment\n```bash\npoetry shell\n```\n3. Build and install\n```bash\npoetry build\npoetry install --with dev\n```\n\n## Citation\n\nIf you use scikit-ntk in your scientific work, please use the following citation alongside the scikit-learn citations found at [https://scikit-learn.org/stable/about.html#citing-scikit-learn](https://scikit-learn.org/stable/about.html#citing-scikit-learn):\n\n```\n@mastersthesis{lencevicius2022laplacentk,\n  author  = \"Ronaldas Paulius Lencevicius\",\n  title   = \"An Empirical Analysis of the Laplace and Neural Tangent Kernels\",\n  school  = \"California State Polytechnic University, Pomona\",\n  year    = \"2022\",\n  month   = \"August\",\n  note    = {\\url{http://hdl.handle.net/20.500.12680/d504rr81v}}\n}\n```\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Implementation of the neural tangent kernel for scikit-learn's Gaussian process module.",
    "version": "1.2.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/392781/scikit-ntk/issues",
        "Homepage": "https://github.com/392781/scikit-ntk",
        "Repository": "https://github.com/392781/scikit-ntk"
    },
    "split_keywords": [
        "sckit-learn",
        " sklearn"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f1a938204bed67b4d3d532d2270a12b1a0003506e72166229dc0f4b2bdce541f",
                "md5": "29dc0fecc670117d25dc523b405d2d64",
                "sha256": "953c5a2d32b5b549e7627a5f5dbceaa66d5a16498d736ddc2b678c384f28d3a6"
            },
            "downloads": -1,
            "filename": "scikit_ntk-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "29dc0fecc670117d25dc523b405d2d64",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.8",
            "size": 5246,
            "upload_time": "2024-10-07T23:21:16",
            "upload_time_iso_8601": "2024-10-07T23:21:16.537260Z",
            "url": "https://files.pythonhosted.org/packages/f1/a9/38204bed67b4d3d532d2270a12b1a0003506e72166229dc0f4b2bdce541f/scikit_ntk-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5196b2a7af9daa4f2c986d2e97a001125572ebee0591d605038298ad7307283c",
                "md5": "e94c41cf9099001127719153297fb915",
                "sha256": "8a1bd65d146b4121cd1c696b04b014821d8c2870c319f3d426efd77509e04085"
            },
            "downloads": -1,
            "filename": "scikit_ntk-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e94c41cf9099001127719153297fb915",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.8",
            "size": 5172,
            "upload_time": "2024-10-07T23:21:17",
            "upload_time_iso_8601": "2024-10-07T23:21:17.428974Z",
            "url": "https://files.pythonhosted.org/packages/51/96/b2a7af9daa4f2c986d2e97a001125572ebee0591d605038298ad7307283c/scikit_ntk-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-07 23:21:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "392781",
    "github_project": "scikit-ntk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "scikit-ntk"
}
        
Elapsed time: 0.35409s