Name | procurve JSON |
Version |
0.0.2
JSON |
| download |
home_page | |
Summary | Principal curve for spherical data using splines. |
upload_time | 2023-06-21 16:35:27 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.0 |
license | MIT |
keywords |
principal curve
dimensionality reduction
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
.. image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/MauricioSalazare/multi-copula/master?urlpath=lab/tree/examples
:alt: binder
ProCurve
===============
What is ProCurve?
------------------------
It is a robust principal curve package focused on fitting data that lies in a sphere.
Splines are the estimators used for the principal curves.
How to install
--------------
The package can be installed via pip using:
.. code:: shell
pip install procurve
Example:
--------
Run the load base case as:
.. code-block:: python
from src.procurve.principal_curve import PrincipalCurve
from src.procurve.utils import create_dataset
from src.procurve.plotting import plot_3d, segments
import numpy as np
from mpl_toolkits.mplot3d.art3d import Line3DCollection
X = create_dataset(source="snake")
spline_params = {"degree": 4,
"low_angle_deg": -40,
"high_angle_deg": 180,
"radius": 1.0}
pc = PrincipalCurve()
X, s, f_spline = pc.fit(X, init_fn="curve", param_fun=spline_params)
s_high_res = np.linspace(0, 1, 1000)
f_s = f_spline(s_high_res)
#%% Plot data
ax = plot_3d(X, plot_wireframe=True)
ax.plot(f_s[:,0], f_s[:,1], f_s[:,2], color="C3", linewidth=0.5, label="Principal curve")
line_collections_fit = segments(pc.last_iteration_log["data_sorted"],
pc.last_iteration_log["p_orthogonal"])
lc_fit = Line3DCollection(line_collections_fit, colors="C1", linewidths=0.4, label="Orthogonal projection")
ax.add_collection(lc_fit)
ax.legend(fontsize="small")
Reading and citations:
----------------------
..
_The mathematical formulation of the generative model with the copula can be found at:
The pseudo-algorithm and mathematical formulation can be found `here <https://https://github.com/MauricioSalazare/multi-copula/tree/master/examples>`_.
How to contact us
-----------------
Any questions, suggestions or collaborations contact Mauricio Salazar at <e.m.salazar.duque@tue.nl>
Raw data
{
"_id": null,
"home_page": "",
"name": "procurve",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.0",
"maintainer_email": "",
"keywords": "principal curve,dimensionality reduction",
"author": "",
"author_email": "Mauricio Salazar <e.m.salazar.duque@tue.nl>",
"download_url": "https://files.pythonhosted.org/packages/e9/52/5204e003cf2e69b96643ccb5c21f5fda7da0797a8a921814f0ebd3937c9e/procurve-0.0.2.tar.gz",
"platform": null,
"description": ".. image:: https://mybinder.org/badge_logo.svg\r\n :target: https://mybinder.org/v2/gh/MauricioSalazare/multi-copula/master?urlpath=lab/tree/examples\r\n :alt: binder\r\n\r\n\r\n\r\nProCurve\r\n===============\r\n\r\n\r\nWhat is ProCurve?\r\n------------------------\r\n\r\nIt is a robust principal curve package focused on fitting data that lies in a sphere.\r\nSplines are the estimators used for the principal curves.\r\n\r\nHow to install\r\n--------------\r\nThe package can be installed via pip using:\r\n\r\n.. code:: shell\r\n\r\n pip install procurve\r\n\r\nExample:\r\n--------\r\nRun the load base case as:\r\n\r\n.. code-block:: python\r\n\r\n from src.procurve.principal_curve import PrincipalCurve\r\n from src.procurve.utils import create_dataset\r\n from src.procurve.plotting import plot_3d, segments\r\n import numpy as np\r\n from mpl_toolkits.mplot3d.art3d import Line3DCollection\r\n\r\n X = create_dataset(source=\"snake\")\r\n spline_params = {\"degree\": 4,\r\n \"low_angle_deg\": -40,\r\n \"high_angle_deg\": 180,\r\n \"radius\": 1.0}\r\n pc = PrincipalCurve()\r\n X, s, f_spline = pc.fit(X, init_fn=\"curve\", param_fun=spline_params)\r\n s_high_res = np.linspace(0, 1, 1000)\r\n f_s = f_spline(s_high_res)\r\n\r\n #%% Plot data\r\n ax = plot_3d(X, plot_wireframe=True)\r\n ax.plot(f_s[:,0], f_s[:,1], f_s[:,2], color=\"C3\", linewidth=0.5, label=\"Principal curve\")\r\n line_collections_fit = segments(pc.last_iteration_log[\"data_sorted\"],\r\n pc.last_iteration_log[\"p_orthogonal\"])\r\n lc_fit = Line3DCollection(line_collections_fit, colors=\"C1\", linewidths=0.4, label=\"Orthogonal projection\")\r\n ax.add_collection(lc_fit)\r\n ax.legend(fontsize=\"small\")\r\n\r\n\r\n\r\n\r\nReading and citations:\r\n----------------------\r\n..\r\n _The mathematical formulation of the generative model with the copula can be found at:\r\n\r\nThe pseudo-algorithm and mathematical formulation can be found `here <https://https://github.com/MauricioSalazare/multi-copula/tree/master/examples>`_.\r\n\r\n\r\n\r\nHow to contact us\r\n-----------------\r\nAny questions, suggestions or collaborations contact Mauricio Salazar at <e.m.salazar.duque@tue.nl>\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Principal curve for spherical data using splines.",
"version": "0.0.2",
"project_urls": {
"repository": "https://github.com/MauricioSalazare/procurve"
},
"split_keywords": [
"principal curve",
"dimensionality reduction"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1532f6c6ad2c25678f6da57aa879566bd76c675d5c9d490c423af77ba54d1325",
"md5": "6e6e06dec6b420bf63b21b1a8230b53c",
"sha256": "2cd1ba594ca0aeda5a82c9faa680a2d99e4f674e4f851150aa5f98c4c5304f2c"
},
"downloads": -1,
"filename": "procurve-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6e6e06dec6b420bf63b21b1a8230b53c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.0",
"size": 11209,
"upload_time": "2023-06-21T16:35:26",
"upload_time_iso_8601": "2023-06-21T16:35:26.387218Z",
"url": "https://files.pythonhosted.org/packages/15/32/f6c6ad2c25678f6da57aa879566bd76c675d5c9d490c423af77ba54d1325/procurve-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e9525204e003cf2e69b96643ccb5c21f5fda7da0797a8a921814f0ebd3937c9e",
"md5": "96664c5b741d32a550ca38a10e2f014b",
"sha256": "d096a0b6ab34142dcafd1f3cbf302867f039d2873d5db65f6a2e031d5c69d174"
},
"downloads": -1,
"filename": "procurve-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "96664c5b741d32a550ca38a10e2f014b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.0",
"size": 11228,
"upload_time": "2023-06-21T16:35:27",
"upload_time_iso_8601": "2023-06-21T16:35:27.663468Z",
"url": "https://files.pythonhosted.org/packages/e9/52/5204e003cf2e69b96643ccb5c21f5fda7da0797a8a921814f0ebd3937c9e/procurve-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-21 16:35:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MauricioSalazare",
"github_project": "procurve",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "procurve"
}