Package with the PCA, SVD and t-SNE methods for dimensionality reduction. It also contains the clustering algorithms K-Means and K-Medoids.
Project description
What is it?
dimensionality_reductions_jmsv is a Python package that provides three methods (PCA, SVD, t-SNE) to apply dimensionality reduction to any dataset. Aslo provides two methods (KMeans y KMedoids) to clustering.
Installing the package
-
Requests is available on PyPI:
pip install dimensionality_reductions_jmsv
-
Try your first dimensionality reduction with PCA
from dimensionality_reductions_jmsv.decomposition import PCA import numpy as np X = (np.random.rand(10, 10) * 10).astype(int) pca = PCA(n_components=2) X_pca = pca.fit_transform(X) print("Original Matrix:", '\n', X, '\n') print("Apply dimensionality reduction with PCA to Original Matrix:", '\n', X_pca)
-
Try your first KMeans cluster
from dimensionality_reductions_jmsv.cluster import KMeans from sklearn.datasets import make_blobs import matplotlib.pyplot as plt X, y = make_blobs(n_samples=500, n_features=2, centers=4, cluster_std=1, center_box=(-10.0, 10.0), shuffle=True, random_state=1, ) k = KMeans(n_clusters=4, init_method='kmeans++', random_state=32, n_init=10) m = k.fit_transform(X) plt.scatter(X[:, 0], X[:, 1], c=k._assign_clusters(X)) plt.title('Cluster KMeans') plt.show();
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 Distribution
Built Distribution
File details
Details for the file dimensionality_reductions_jmsv-0.2.0.tar.gz
.
File metadata
- Download URL: dimensionality_reductions_jmsv-0.2.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.7 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfdb0fbba0a2411653200ffe8582d58698b1abf46c5ba22fac1b3c4bd67686ab |
|
MD5 | c8a4aab16c9d0dff101429aeb1444977 |
|
BLAKE2b-256 | 6028b24f6224f94c7ccc74080dbe36b7b93276487cd383acb270f8b4423a398b |
File details
Details for the file dimensionality_reductions_jmsv-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: dimensionality_reductions_jmsv-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.7 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1881843274d45cc96cb29944603160f7aa7accc3aa7cdfa3b962bde1b7e7be22 |
|
MD5 | 7109c6f0d2aff8b1493603edb60f7ffe |
|
BLAKE2b-256 | e74c78e6aa7074655256fdbbf53d6e8fa1c89fd4c9c1f3f39d1c6268f338dab2 |