#God is Holy
import os
os.chdir("C:/Users/khile/Desktop/WD_python")
import pandas as pd 
import numpy as np 
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.decomposition import PCA
from sklearn import preprocessing

df = pd.read_csv('D:/data _science/PYTHON/PCA_Python/pca34.csv')
df.info()
df= df.drop('Unnamed: 0', axis=1)
df.info()

#PCA 
pca3_nocs = PCA(n_components=3)
pca3_nocs_comp = pca3_nocs.fit_transform(df)
pca3_nocs_comp #Components

pca3_nocs_egvct = pca3_nocs.components_ #Eigen vectors
print(pca3_nocs_egvct)

pca3_nocs_egvl = pca3_nocs.explained_variance_ #Eigen Values
print(pca3_nocs_egvl)

pca3_nocs.explained_variance_ratio_
# array([0.65149154, 0.289459  , 0.05904946])

np.cumsum(pca3_nocs.explained_variance_ratio_)
#array([0.65149154, 0.94095054, 1.        ])
1670ab054132fcc5b8c4d8d912f6dbba40fd601e
<mask token>

<mask token>
os.chdir('C:/Users/khile/Desktop/WD_python')
<mask token>
df.info()
<mask token>
df.info()
<mask token>
pca3_nocs_comp
<mask token>
print(pca3_nocs_egvct)
<mask token>
print(pca3_nocs_egvl)
pca3_nocs.explained_variance_ratio_
np.cumsum(pca3_nocs.explained_variance_ratio_)

<mask token>
os.chdir('C:/Users/khile/Desktop/WD_python')
<mask token>
df = pd.read_csv('D:/data _science/PYTHON/PCA_Python/pca34.csv')
df.info()
df = df.drop('Unnamed: 0', axis=1)
df.info()
pca3_nocs = PCA(n_components=3)
pca3_nocs_comp = pca3_nocs.fit_transform(df)
pca3_nocs_comp
pca3_nocs_egvct = pca3_nocs.components_
print(pca3_nocs_egvct)
pca3_nocs_egvl = pca3_nocs.explained_variance_
print(pca3_nocs_egvl)
pca3_nocs.explained_variance_ratio_
np.cumsum(pca3_nocs.explained_variance_ratio_)

import os
os.chdir('C:/Users/khile/Desktop/WD_python')
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.decomposition import PCA
from sklearn import preprocessing
df = pd.read_csv('D:/data _science/PYTHON/PCA_Python/pca34.csv')
df.info()
df = df.drop('Unnamed: 0', axis=1)
df.info()
pca3_nocs = PCA(n_components=3)
pca3_nocs_comp = pca3_nocs.fit_transform(df)
pca3_nocs_comp
pca3_nocs_egvct = pca3_nocs.components_
print(pca3_nocs_egvct)
pca3_nocs_egvl = pca3_nocs.explained_variance_
print(pca3_nocs_egvl)
pca3_nocs.explained_variance_ratio_
np.cumsum(pca3_nocs.explained_variance_ratio_)

#God is Holy
import os
os.chdir("C:/Users/khile/Desktop/WD_python")
import pandas as pd 
import numpy as np 
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.decomposition import PCA
from sklearn import preprocessing

df = pd.read_csv('D:/data _science/PYTHON/PCA_Python/pca34.csv')
df.info()
df= df.drop('Unnamed: 0', axis=1)
df.info()

#PCA 
pca3_nocs = PCA(n_components=3)
pca3_nocs_comp = pca3_nocs.fit_transform(df)
pca3_nocs_comp #Components

pca3_nocs_egvct = pca3_nocs.components_ #Eigen vectors
print(pca3_nocs_egvct)

pca3_nocs_egvl = pca3_nocs.explained_variance_ #Eigen Values
print(pca3_nocs_egvl)

pca3_nocs.explained_variance_ratio_
# array([0.65149154, 0.289459  , 0.05904946])

np.cumsum(pca3_nocs.explained_variance_ratio_)
#array([0.65149154, 0.94095054, 1.        ])