changed CountVectorizer => my BOW
This commit is contained in:
parent
a6df94131c
commit
c2066d6adb
|
@ -53,18 +53,18 @@ class NaiveBayes:
|
||||||
n += 1
|
n += 1
|
||||||
print('# split no. ' + str(n))
|
print('# split no. ' + str(n))
|
||||||
|
|
||||||
# # eigenes BOW => schlechtere ergebnisse
|
# eigenes BOW => schlechtere ergebnisse
|
||||||
# vocab = BagOfWords.make_vocab(X[train])
|
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:
|
|
||||||
# fit the training data and then return the matrix
|
# 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
|
# 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
|
# # apply select percentile
|
||||||
# selector = SelectPercentile(percentile=25)
|
# selector = SelectPercentile(percentile=25)
|
||||||
|
|
Loading…
Reference in New Issue