Не мог передать поисковую историю Bash так же как с CTRL-r

функция предиката принимает массив формы (n_samples, n_features). Я предполагаю n_features=3 в вашем случае, поэтому:

print('Your prediction for [12,44,0] is', gb_clf.predict([[12,44,0]])

Пример:

from sklearn.datasets import make_hastie_10_2
from sklearn.ensemble import GradientBoostingClassifier

X, y = make_hastie_10_2(random_state=0) # has 10 features
X_train, X_test = X[:2000], X[2000:]
y_train, y_test = y[:2000], y[2000:]

clf = GradientBoostingClassifier(n_estimators=100, learning_rate=1.0, max_depth=1, random_state=0).fit(X_train, y_train)
sample = [list(range(10))] # we provide 10 features for prediction
print('Prediction:', clf.predict(sample))

187
задан Mateusz Piotrowski 21 April 2017 в 06:09
поделиться

1 ответ

You can search forward as well. From the bash info manual, "8.2.5 Searching for Commands in the History":

To search backward in the history for a particular string, type C-r. Typing C-s searches forward through the history.

The problem with Ctrl-S however is that sometimes collides with XON/XOFF flow control (in Konsole for instance). The searching is a readline feature however, and you should be able to bind it to some other key. Update: Simpler and better is just to disable XON/XOFF by running

stty -ixon
293
ответ дан 23 November 2019 в 05:46
поделиться
Другие вопросы по тегам:

Похожие вопросы: