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')
Project details
Release history Release notifications | RSS feed
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)
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30ea1ac6e53135be7b51892a835e1c5e6f84c77b3fb453dd3fb3385aaab0d8e7 |
|
MD5 | 948ed0c6027cf524c51b5b5a3e67d91f |
|
BLAKE2b-256 | 0a118fb4d794aef4bb9646fd16c9118f4629c090a2e25860097569f2aaa60aef |