vkantor / MIPT_Data_Mining_In_Action_2016

"Data Mining in Action Course", Moscow Institute of Physics and Technologies
209 stars 175 forks source link

base/hw1 append_biases #20

Closed stapko closed 8 years ago

stapko commented 8 years ago

Не работает метод,а вообще не работает sparse.hstack()

`X_train_sample = X_train[:10000] y_train_sample = y_train[:10000]

clf = LogisticRegression() clf.w = np.random.randn(X_train_sample.shape[1]+1) * 2 LogisticRegression.append_biases(X_train_sample)`

ValueError: could not broadcast input array from shape (10000,2000) into shape (10000)

scr1 scr2

dmylnikov commented 8 years ago

проверь, что X_train, y_train - sparse matrices, их не надо преобразовывать в numpy.ndarray

stapko commented 8 years ago

Спасибо, помогло