Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

dimension reduction using pca

# Import PCA
from sklearn.decomposition import PCA

# Create a PCA instance with 2 components: pca
pca = PCA(n_components= ...)

# Fit the PCA instance to the scaled samples
pca.fit(scaled_samples)

# Transform the scaled samples: pca_features
pca_features = pca.transform(scaled_samples)

# Print the shape of pca_features
print(pca_features.shape)
Comment

PREVIOUS NEXT
Code Example
Python :: kite order syntax 
Python :: python split get array for loop 
Python :: access dictionary in f string 
Python :: time, date 
Python :: how to update only some fields in django serielizer update method 
Python :: complete pipeline sample 
Python :: traint test split on column id 
Python :: remove variables withouth variance python 
Python :: change python version jupyter notebook 
Python :: Understand the most appropriate graph to use for your dataset 
Python :: call static method from another static method python 
Python :: real numbers python 
Python :: how to add other categories in django admin template 
Python :: Drop multiple consecutive columns 
Python :: python multi arguments 
Python :: python get favicon from url 
Python :: change between two python 3 version in raspberrry pi 
Python :: write yaml file without deleting content 
Python :: pyqgis 
Python :: how to import qpalette pyqt5 
Python :: site:github.com python ssh 
Python :: shorten all floats in a list 
Python :: weight constraints keras cnn 
Python :: python check mognodb size 
Python :: how to access cookies in django 
Python :: Return a new RDD containing the distinct elements in this RDD. 
Python :: python create adictionary randomly assigning clors to categorical vairables 
Python :: scrapy get raw html content of selector innerhtml 
Python :: dream manhunt 
Python :: gfrequency listing in pandas 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =