changed CountVectorizer => my BOW
This commit is contained in:
		
							parent
							
								
									a6df94131c
								
							
						
					
					
						commit
						c2066d6adb
					
				@ -53,18 +53,18 @@ class NaiveBayes:
 | 
			
		||||
            n += 1
 | 
			
		||||
            print('# split no. ' + str(n))
 | 
			
		||||
            
 | 
			
		||||
            # # eigenes BOW => schlechtere ergebnisse
 | 
			
		||||
            # vocab = BagOfWords.make_vocab(X[train])   
 | 
			
		||||
            # # fit the training data and then return the matrix
 | 
			
		||||
            # training_data = BagOfWords.make_matrix(X[train], vocab)            
 | 
			
		||||
            # # transform testing data and return the matrix
 | 
			
		||||
            # testing_data = BagOfWords.make_matrix(X[test], vocab)
 | 
			
		||||
            
 | 
			
		||||
            # # using CountVectorizer:
 | 
			
		||||
            # eigenes BOW => schlechtere ergebnisse
 | 
			
		||||
            vocab = BagOfWords.make_vocab(X[train])   
 | 
			
		||||
            # fit the training data and then return the matrix
 | 
			
		||||
            training_data = cv.fit_transform(X[train], y[train]).toarray()
 | 
			
		||||
            training_data = BagOfWords.make_matrix(X[train], vocab)            
 | 
			
		||||
            # transform testing data and return the matrix
 | 
			
		||||
            testing_data = cv.transform(X[test]).toarray()    
 | 
			
		||||
            testing_data = BagOfWords.make_matrix(X[test], vocab)
 | 
			
		||||
            
 | 
			
		||||
            # # # using CountVectorizer:
 | 
			
		||||
            # # fit the training data and then return the matrix
 | 
			
		||||
            # training_data = cv.fit_transform(X[train], y[train]).toarray()
 | 
			
		||||
            # # transform testing data and return the matrix
 | 
			
		||||
            # testing_data = cv.transform(X[test]).toarray()    
 | 
			
		||||
            
 | 
			
		||||
            # # apply select percentile
 | 
			
		||||
            # selector = SelectPercentile(percentile=25)           
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user