خرید بک لینک

Vote count: 0

Newbie to Python and sklea here. I'm getting a "type error" on the following code that I don't understand. Can anyone help?

vectorizer = CountVectorizer()
X = vectorizer.fit_transform(train_data)
Y = vectorizer.transform(dev_data)

print Y.shape
print dev_labels.shape

parameters = {'n_neighbors':[1,300] }
grid_search = GridSearchCV(KNeighborsClassifier(), parameters, scoring=metrics.f1_score(Y, dev_labels))
grid_search.fit(X, train_labels)
print "the score is", grid_search.score(Y, dev_labels)
print "The best value is achieved when k = ", grid_search.best_params_

train_data, dev_data are basic data used for training the model. Y.shape is (676, 26879) while dev_labels.shape is (676,)

The error message is "Type_error" on the GridSearchCV line. It says: TypeError: len() of unsized object

What object is unsized?

asked 12 secs ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 19 تير 1395 ساعت: 0:24

صفحه بندی