#NEWLINE# def project_data( self , data ) : #NEWLINE# #INDENT# '\n        Projects a data set to a trained SOM. It is based on nearest neighborhood search module of scikitlearn,\n        but it is not that fast.\n        ' #NEWLINE# clf = neighbors . KNeighborsClassifier ( n_neighbors = 1 ) #NEWLINE# labels = np . arange ( 0 , self . codebook . matrix . shape [ 0 ] ) #NEWLINE# clf . fit ( self . codebook . matrix , labels ) #NEWLINE# data = self . _normalizer . normalize_by ( self . data_raw , data ) #NEWLINE# return clf . predict ( data )