Skip to main content
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:

pip install procurve

Example:

Run the load base case as:

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 pseudo-algorithm and mathematical formulation can be found here.

How to contact us

Any questions, suggestions or collaborations contact Mauricio Salazar at <e.m.salazar.duque@tue.nl>

Release files for procurve 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for procurve 0.0.2
File Size Uploaded
procurve-0.0.2.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for procurve 0.0.2
File Interpreter ABI Platform
procurve-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / procurve-0.0.2.tar.gz

Download URL procurve-0.0.2.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d096a0b6ab34142dcafd1f3cbf302867f039d2873d5db65f6a2e031d5c69d174
BLAKE2b-256 checksum
How to use checksums
e9525204e003cf2e69b96643ccb5c21f5fda7da0797a8a921814f0ebd3937c9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / procurve-0.0.2-py3-none-any.whl

Download URL procurve-0.0.2-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2cd1ba594ca0aeda5a82c9faa680a2d99e4f674e4f851150aa5f98c4c5304f2c
BLAKE2b-256 checksum
How to use checksums
1532f6c6ad2c25678f6da57aa879566bd76c675d5c9d490c423af77ba54d1325
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page