Skip to main content

Principal curves implementation in Python

Project description

pcurvepy

Principal curves implementation (Hastie '89) in Python

Example:

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))

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

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

example

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pcurvepy-0.0.10-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file pcurvepy-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: pcurvepy-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for pcurvepy-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 30ea1ac6e53135be7b51892a835e1c5e6f84c77b3fb453dd3fb3385aaab0d8e7
MD5 948ed0c6027cf524c51b5b5a3e67d91f
BLAKE2b-256 0a118fb4d794aef4bb9646fd16c9118f4629c090a2e25860097569f2aaa60aef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page