Commit 37656071 authored by Alex Fout's avatar Alex Fout

created embedding class to generate different embeddings.

parent ed49e1de
from sklearn.decomposition import PCA
class Embedding(object):
def __init__(self, type="pca", ):
self.type = type
def train(self, train_data):
if self.type == "pca":
pca = PCA()
pca.fit(train_data)
self.pca= pca
def embed(self, train_data):
if self.type == "pca":
return self.pca.transform(train_data)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment