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 hashes)
Close
Hashes for pcurvepy-0.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30ea1ac6e53135be7b51892a835e1c5e6f84c77b3fb453dd3fb3385aaab0d8e7 |
|
MD5 | 948ed0c6027cf524c51b5b5a3e67d91f |
|
BLAKE2b-256 | 0a118fb4d794aef4bb9646fd16c9118f4629c090a2e25860097569f2aaa60aef |