Skip to main content

pcurvepy

Principal Curves

This is an implementation of the Principal Curves (Hastie '89) algorithm in Python.

It is a fork of the zsteve/pcurvepy package where the projection indices are selected according to our translation of the R/C++ princurve package.

Installation:

pip install pcurvepy2

Example:

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import pcurve

data = pd.read_csv('test_data.csv')
x = data.loc[:, ('X1', 'X2')].to_numpy()

# transform data to have zero mean
x = x - np.mean(x, 0)
index = np.arange(0, len(x))

curve = pcurve.PrincipalCurve(k=5)
curve.fit(x)

plt.scatter(x[:, 0], x[:, 1], alpha=0.25, c=index)
plt.plot(curve.points[:, 0], curve.points[:, 1], c='k')

# get interpolation indices
pseudotime_interp, point_interp, order = curve.unpack_params()

example

Metadata

Release files for pcurvepy2 0.2.1

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

Source distribution (sdist)

Source distribution for pcurvepy2 0.2.1
File Size Uploaded Provenance
pcurvepy2-0.2.1.tar.gz 197.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 215.4 kB

Release files / pcurvepy2-0.2.1.tar.gz

Download URL pcurvepy2-0.2.1.tar.gz
Size 197.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a49f026e939f3e4cffd04f807674f0d850c30108297baaf9621598d13f231cc2
BLAKE2b-256 checksum
How to use checksums
b32c02fad96d9d84e2aa6651726e13445e3ff02d5746e2bd24127024e9f68c2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.12

Release files / pcurvepy2-0.2.1-py3-none-any.whl

Download URL pcurvepy2-0.2.1-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b54983c2c8e967f18931172a5bb327c23a5480aafb4a5dc8c3abe6ae06c5cb7f
BLAKE2b-256 checksum
How to use checksums
1ca9bbb583f5e18a563fcb4f204be97ea482c4092d5edefcd0af8720f2ad55f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.12

Security for pcurvepy2 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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