<s> __author__ = '<STR_LIT>' <EOL> import numpy as np <EOL> import theano <EOL> from sklearn . base import TransformerMixin <EOL> from pylearn2 . datasets . vector_spaces_dataset import VectorSpacesDataset <EOL> from pylearn2 . space import VectorSpace , CompositeSpace <EOL> class VectorDataset ( TransformerMixin ) : <EOL> def fit_transform ( self , X , y = None , ** fit_params ) : <EOL> print X . shape <EOL> nfeat = X . shape [ <NUM_LIT:1> ] <EOL> X = X . astype ( theano . config . floatX ) <EOL> if y is None : <EOL> dataset = VectorSpacesDataset ( X , ( VectorSpace ( nfeat ) , '<STR_LIT>' ) ) <EOL> else : <EOL> y = np . reshape ( y , ( y . shape [ <NUM_LIT:0> ] , <NUM_LIT:1> ) ) <EOL> space = CompositeSpace ( [ VectorSpace ( nfeat ) , VectorSpace ( <NUM_LIT:1> ) ] ) <EOL> source = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> data_specs = ( space , source ) <EOL> dataset = VectorSpacesDataset ( ( X , y ) , data_specs ) <EOL> return dataset </s>
