lazyfit


Namelazyfit JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/redhorn144/lazyfit.git
SummaryA python package that helps with the construction and optimization of RBF interpolants.
upload_time2023-11-23 00:38:37
maintainer
docs_urlNone
authorAlex Shaffer
requires_python
license
keywords interpolation data science
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!---
Best read with a KaTex equiped markdown renderer.
In vs-code Markdown Preview Enhanced is a good extension.
-->

 # Lazyfit
This is the lazy fit python package. This package provides classes and methods that may be used to build radial basis function interpolants and optimize their behaviors.

Rbf interpolation is a mesh-free interpolation technique in which a set of  radial basis function are used as the basis for a Haar space. The interpolant takes the form:

$$
L(p) = \sum_{i = 0}^n \lambda_i \varphi(||p - p_i ||)
$$

It is governed by the interpolation condition:

$$
F_j = \sum_{i = 0}^n \lambda_i \varphi(||p_i - p_j||)
$$

Where $p_i$ and $p_j$ are points in the input data and $F_j$ is the known  function value associated with $p_j$.

# Classes
## LazyFitter
The lazyfitter is the primary class of the package. It aims to provide a simple interface that builds and optimizes the interpolation behind the scene.
### Constructor
LazyFitter(coordinates, function_values, epsilon  =  1)
Parameters:
- coordinates: array_like
	>An array_like that contains the coordinates to build the interpolant. For m data points in $\mathbb{R^n}$ the shape is (m, n), this includes data on $\mathbb{R}$ which has shape (m, 1) not just (m).
- function_values: array_like
	>An array_like that contains the function values associated with the coordinates index aligned. For m data points, the shape is (m).
- epsilon: float
	> The shape parameter of the interpolant, default is 1.

### Member Variables:
- coordinates: array_like
	>An array_like that contains the coordinates to build the interpolant. For m data points in $\mathbb{R^n}$ the shape is (m, n), this includes data on $\mathbb{R}$ which has shape (m, 1) not just (m).
- function_values: array_like
	>An array_like that contains the function values associated with the coordinates index aligned. For m data points, the shape is (m).

- epsilon: float
	> Same as the epsilon in object creation, may change with optimization.
- min_error: list
	>Two entries, the first is the name of the minimum error basis function and the second is the RMS leave-one-out cross-validation error of that interpolant.

### Member Functions:
- OptimizeShape()
	> Optimizes the current basis function interpolant by shape parameter. Uses a bounded Brent's algorithm for the optimization the error estimator as a function of shape parameter.
- Interpolate(x): array_like
	> returns the evaluation of the interpolant at the point x.

## Rbf

### Constructor
Rbf(coordinates, function_values, kernel, epsilon  =  1, norm_weights = None)
- coordinates: array_like
	>An array_like that contains the coordinates to build the interpolant. For m data points in $\mathbb{R^n}$ the shape is (m, n), this includes data on $\mathbb{R}$ which has shape (m, 1) not just (m).
- function_values: array_like
	>An array_like that contains the function values associated with the coordinates index aligned. For m data points, the shape is (m).
- kernel
	- One of:
		- "linear" : $\varphi(r) = r$
		- "thin_plate_spline" : $\varphi(r) = r^2 log(r)$
		- "cubic" : $\varphi(r) = r^3$
		- "quintic" : $\varphi(r) = r^5$
		- "gaussian" : $\varphi(r) = e^{-(\epsilon r)^2}$
		- "multiquadric" : $\varphi(r) = -\sqrt{1 + (\epsilon r)^2}$
		- "inverse_quadric" : $\varphi(r) = \frac{1}{1 + (\epsilon r)^2}$
- epsilon: float
	> The shape parameter of the interpolant, default is 1.
- norm_weights: array_like
	> An array of the weights to be given to the various dimensions to the standard Euclidean norm. This produces an augmented Euclidean norm that is "equivalent" in the mathematical sense regarding normed spaces. Here norm_weights represents $a_i$ in the norm equation $||p_i - p_j|| = \sqrt{\sum_{k = 0}^n a_i (p_{i, k} - p_{j, k})^2}$ for $p_i, p_j$ on $\mathbb{R}^n$. If that were a standard Euclidean norm then $a_i$ would be all 1's.
	### Member Variables:
- coordinates: array_like
	>An array_like that contains the coordinates to build the interpolant. For m data points in $\mathbb{R^n}$ the shape is (m, n), this includes data on $\mathbb{R}$ which has shape (m, 1) not just (m).
- function_values: array_like
	>An array_like that contains the function values associated with the coordinates index aligned. For m data points, the shape is (m).
- n : int
	>The number of cooridnates/function_values given on construction.
- kernel
	- One of:
		- "linear" : $\varphi(r) = r$
		- "thin_plate_spline" : $\varphi(r) = r^2 log(r)$
		- "cubic" : $\varphi(r) = r^3$
		- "quintic" : $\varphi(r) = r^5$
		- "gaussian" : $\varphi(r) = e^{-(\epsilon r)^2}$
		- "multiquadric" : $\varphi(r) = -\sqrt{1 + (\epsilon r)^2}$
		- "inverse_quadric" : $\varphi(r) = \frac{1}{1 + (\epsilon r)^2}$
- epsilon: float
	> The shape parameter of the interpolant, default is 1. Changing this after construction will not rebuild the interpolant.
- weights : array
	>The coefficients of the interpolant's basis functions.
- is_singular: boolean
	> describes whether or not the basis function matrix $\Phi_{ij} = \varphi(||p_i - p_j||)$ is singular.
- average_error:
	>The RMS leave-one-out error of the interpolant, calculated on construction of the object. Calculation runs in $O(n^3)$ time.

### Member Functions:
- Interpolate(point):
	>Evaluates the interpolant at point.

# Dependancies
This Library has both scipy and numpy dependancies:
- numpy: 1.23.5
- scipy: 1.10.1

# CHANGELOG

## Version 0.1.2 11/19/2023
1. Updated: Changed the license info.
2. Fixed:
3. ...



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/redhorn144/lazyfit.git",
    "name": "lazyfit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Interpolation,Data Science",
    "author": "Alex Shaffer",
    "author_email": "alex.shaffer144@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c3/b4/8e5c6090e7942575c387f48884f29394a428f11d3eecaa6590c77523b500/lazyfit-0.1.2.tar.gz",
    "platform": null,
    "description": "<!---\r\nBest read with a KaTex equiped markdown renderer.\r\nIn vs-code Markdown Preview Enhanced is a good extension.\r\n-->\r\n\r\n # Lazyfit\r\nThis is the lazy fit python package. This package provides classes and methods that may be used to build radial basis function interpolants and optimize their behaviors.\r\n\r\nRbf interpolation is a mesh-free interpolation technique in which a set of  radial basis function are used as the basis for a Haar space. The interpolant takes the form:\r\n\r\n$$\r\nL(p) = \\sum_{i = 0}^n \\lambda_i \\varphi(||p - p_i ||)\r\n$$\r\n\r\nIt is governed by the interpolation condition:\r\n\r\n$$\r\nF_j = \\sum_{i = 0}^n \\lambda_i \\varphi(||p_i - p_j||)\r\n$$\r\n\r\nWhere $p_i$ and $p_j$ are points in the input data and $F_j$ is the known  function value associated with $p_j$.\r\n\r\n# Classes\r\n## LazyFitter\r\nThe lazyfitter is the primary class of the package. It aims to provide a simple interface that builds and optimizes the interpolation behind the scene.\r\n### Constructor\r\nLazyFitter(coordinates, function_values, epsilon  =  1)\r\nParameters:\r\n- coordinates: array_like\r\n\t>An array_like that contains the coordinates to build the interpolant. For m data points in $\\mathbb{R^n}$ the shape is (m, n), this includes data on $\\mathbb{R}$ which has shape (m, 1) not just (m).\r\n- function_values: array_like\r\n\t>An array_like that contains the function values associated with the coordinates index aligned. For m data points, the shape is (m).\r\n- epsilon: float\r\n\t> The shape parameter of the interpolant, default is 1.\r\n\r\n### Member Variables:\r\n- coordinates: array_like\r\n\t>An array_like that contains the coordinates to build the interpolant. For m data points in $\\mathbb{R^n}$ the shape is (m, n), this includes data on $\\mathbb{R}$ which has shape (m, 1) not just (m).\r\n- function_values: array_like\r\n\t>An array_like that contains the function values associated with the coordinates index aligned. For m data points, the shape is (m).\r\n\r\n- epsilon: float\r\n\t> Same as the epsilon in object creation, may change with optimization.\r\n- min_error: list\r\n\t>Two entries, the first is the name of the minimum error basis function and the second is the RMS leave-one-out cross-validation error of that interpolant.\r\n\r\n### Member Functions:\r\n- OptimizeShape()\r\n\t> Optimizes the current basis function interpolant by shape parameter. Uses a bounded Brent's algorithm for the optimization the error estimator as a function of shape parameter.\r\n- Interpolate(x): array_like\r\n\t> returns the evaluation of the interpolant at the point x.\r\n\r\n## Rbf\r\n\r\n### Constructor\r\nRbf(coordinates, function_values, kernel, epsilon  =  1, norm_weights = None)\r\n- coordinates: array_like\r\n\t>An array_like that contains the coordinates to build the interpolant. For m data points in $\\mathbb{R^n}$ the shape is (m, n), this includes data on $\\mathbb{R}$ which has shape (m, 1) not just (m).\r\n- function_values: array_like\r\n\t>An array_like that contains the function values associated with the coordinates index aligned. For m data points, the shape is (m).\r\n- kernel\r\n\t- One of:\r\n\t\t- \"linear\" : $\\varphi(r) = r$\r\n\t\t- \"thin_plate_spline\" : $\\varphi(r) = r^2 log(r)$\r\n\t\t- \"cubic\" : $\\varphi(r) = r^3$\r\n\t\t- \"quintic\" : $\\varphi(r) = r^5$\r\n\t\t- \"gaussian\" : $\\varphi(r) = e^{-(\\epsilon r)^2}$\r\n\t\t- \"multiquadric\" : $\\varphi(r) = -\\sqrt{1 + (\\epsilon r)^2}$\r\n\t\t- \"inverse_quadric\" : $\\varphi(r) = \\frac{1}{1 + (\\epsilon r)^2}$\r\n- epsilon: float\r\n\t> The shape parameter of the interpolant, default is 1.\r\n- norm_weights: array_like\r\n\t> An array of the weights to be given to the various dimensions to the standard Euclidean norm. This produces an augmented Euclidean norm that is \"equivalent\" in the mathematical sense regarding normed spaces. Here norm_weights represents $a_i$ in the norm equation $||p_i - p_j|| = \\sqrt{\\sum_{k = 0}^n a_i (p_{i, k} - p_{j, k})^2}$ for $p_i, p_j$ on $\\mathbb{R}^n$. If that were a standard Euclidean norm then $a_i$ would be all 1's.\r\n\t### Member Variables:\r\n- coordinates: array_like\r\n\t>An array_like that contains the coordinates to build the interpolant. For m data points in $\\mathbb{R^n}$ the shape is (m, n), this includes data on $\\mathbb{R}$ which has shape (m, 1) not just (m).\r\n- function_values: array_like\r\n\t>An array_like that contains the function values associated with the coordinates index aligned. For m data points, the shape is (m).\r\n- n : int\r\n\t>The number of cooridnates/function_values given on construction.\r\n- kernel\r\n\t- One of:\r\n\t\t- \"linear\" : $\\varphi(r) = r$\r\n\t\t- \"thin_plate_spline\" : $\\varphi(r) = r^2 log(r)$\r\n\t\t- \"cubic\" : $\\varphi(r) = r^3$\r\n\t\t- \"quintic\" : $\\varphi(r) = r^5$\r\n\t\t- \"gaussian\" : $\\varphi(r) = e^{-(\\epsilon r)^2}$\r\n\t\t- \"multiquadric\" : $\\varphi(r) = -\\sqrt{1 + (\\epsilon r)^2}$\r\n\t\t- \"inverse_quadric\" : $\\varphi(r) = \\frac{1}{1 + (\\epsilon r)^2}$\r\n- epsilon: float\r\n\t> The shape parameter of the interpolant, default is 1. Changing this after construction will not rebuild the interpolant.\r\n- weights : array\r\n\t>The coefficients of the interpolant's basis functions.\r\n- is_singular: boolean\r\n\t> describes whether or not the basis function matrix $\\Phi_{ij} = \\varphi(||p_i - p_j||)$ is singular.\r\n- average_error:\r\n\t>The RMS leave-one-out error of the interpolant, calculated on construction of the object. Calculation runs in $O(n^3)$ time.\r\n\r\n### Member Functions:\r\n- Interpolate(point):\r\n\t>Evaluates the interpolant at point.\r\n\r\n# Dependancies\r\nThis Library has both scipy and numpy dependancies:\r\n- numpy: 1.23.5\r\n- scipy: 1.10.1\r\n\r\n# CHANGELOG\r\n\r\n## Version 0.1.2 11/19/2023\r\n1. Updated: Changed the license info.\r\n2. Fixed:\r\n3. ...\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A python package that helps with the construction and optimization of RBF interpolants.",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/redhorn144/lazyfit.git"
    },
    "split_keywords": [
        "interpolation",
        "data science"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "acb69a7190289988daf10a76a8f0c5bd2dc21941e8b9f6a4ffe39eec0a8dad9b",
                "md5": "d4659555d0556946c1c97aea717ea0a4",
                "sha256": "7921a52f026835d9da7c956f835c908a212f1660f6ff08159403cd0f9b3fbef1"
            },
            "downloads": -1,
            "filename": "lazyfit-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d4659555d0556946c1c97aea717ea0a4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5899,
            "upload_time": "2023-11-23T00:38:36",
            "upload_time_iso_8601": "2023-11-23T00:38:36.252348Z",
            "url": "https://files.pythonhosted.org/packages/ac/b6/9a7190289988daf10a76a8f0c5bd2dc21941e8b9f6a4ffe39eec0a8dad9b/lazyfit-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c3b48e5c6090e7942575c387f48884f29394a428f11d3eecaa6590c77523b500",
                "md5": "e7259d2588ee25b73e571e3b6dae7930",
                "sha256": "ef7e56c165285c556b868d22e9effc2208a528bd7006cc76ede2f79be6dcdd43"
            },
            "downloads": -1,
            "filename": "lazyfit-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e7259d2588ee25b73e571e3b6dae7930",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6196,
            "upload_time": "2023-11-23T00:38:37",
            "upload_time_iso_8601": "2023-11-23T00:38:37.792198Z",
            "url": "https://files.pythonhosted.org/packages/c3/b4/8e5c6090e7942575c387f48884f29394a428f11d3eecaa6590c77523b500/lazyfit-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-23 00:38:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "redhorn144",
    "github_project": "lazyfit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "lazyfit"
}
        
Elapsed time: 0.14193s