#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 10 12:52:49 2018

@author: miri-o
"""

import pandas as pd
from sklearn.decomposition import PCA


path = '/media/miri-o/Documents/'
data = pd.read_csv(path+'Celiac_vectors_2969380x100.csv')

n = 500000

pca = PCA(n_components=3)
random_data = data.sample(n)
pca_result = pca.fit_transform(random_data.values)

df['pca-one'] = pca_result[:,0]
df['pca-two'] = pca_result[:,1] 
df['pca-three'] = pca_result[:,2]

print('Explained variation per principal component: {}'.format(pca.explained_variance_ratio_))
