Closed stapko closed 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)
проверь, что X_train, y_train - sparse matrices, их не надо преобразовывать в numpy.ndarray
Спасибо, помогло
Не работает метод,а вообще не работает 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)