<p dir="auto">scikit-learn 0.16.1 or 0.17dev<br>
numpy   1.80 or 1.9.2<br>
scipy   0.14.0</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sklearn.datasets import make_blobs
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier

datax,datay=make_blobs(n_samples=500)
baseSVC=RandomForestClassifier() 
clf=GradientBoostingClassifier(init=baseSVC,verbose=1)
clf.fit(datax,datay)
y_pred=clf.predict(datax)
"><pre class="notranslate"><code class="notranslate">from sklearn.datasets import make_blobs
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier

datax,datay=make_blobs(n_samples=500)
baseSVC=RandomForestClassifier() 
clf=GradientBoostingClassifier(init=baseSVC,verbose=1)
clf.fit(datax,datay)
y_pred=clf.predict(datax)

</code></pre></div>
<p dir="auto">And get these:<br>
Iter       Train Loss   Remaining Time<br>
Traceback (most recent call last):<br>
File "/media/internal4tb/steven/research_lre_ivector_2015/utils/bugTest.py", line 16, in <br>
clf.fit(datax,datay)<br>
File "/usr/local/lib/python2.7/dist-packages/sklearn/ensemble/gradient_boosting.py", line 980, in fit<br>
begin_at_stage, monitor)<br>
File "/usr/local/lib/python2.7/dist-packages/sklearn/ensemble/gradient_boosting.py", line 1040, in _fit_stages<br>
random_state)<br>
File "/usr/local/lib/python2.7/dist-packages/sklearn/ensemble/gradient_boosting.py", line 747, in _fit_stage<br>
sample_weight=sample_weight)<br>
File "/usr/local/lib/python2.7/dist-packages/sklearn/ensemble/gradient_boosting.py", line 550, in negative_gradient<br>
return y - np.nan_to_num(np.exp(pred[:, k] -<br>
IndexError: too many indices for array</p>
<p dir="auto">Similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="17219308" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/2233" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/2233/hovercard" href="https://github.com/scikit-learn/scikit-learn/issues/2233">#2233</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="24795572" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/2691" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/2691/hovercard" href="https://github.com/scikit-learn/scikit-learn/issues/2691">#2691</a> not only the same error for RF and SVC</p>
<p dir="auto">here is a tiny script which reproduces the crash.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sklearn.datasets import load_iris
from sklearn import ensemble
from sklearn.cross_validation import train_test_split

iris = load_iris()
X, y = iris.data, iris.target
X, y = X[y &lt; 2], y[y &lt; 2]  # make it binary

X_train, X_test, y_train, y_test = train_test_split(X, y)

# Fit GBT init with RF
rf = ensemble.RandomForestClassifier()
clf = ensemble.GradientBoostingClassifier(init=rf)

clf.fit(X_train, y_train)
acc = clf.score(X_test, y_test)
print(&quot;Accuracy: {:.4f}&quot;.format(acc))"><pre class="notranslate"><code class="notranslate">from sklearn.datasets import load_iris
from sklearn import ensemble
from sklearn.cross_validation import train_test_split

iris = load_iris()
X, y = iris.data, iris.target
X, y = X[y &lt; 2], y[y &lt; 2]  # make it binary

X_train, X_test, y_train, y_test = train_test_split(X, y)

# Fit GBT init with RF
rf = ensemble.RandomForestClassifier()
clf = ensemble.GradientBoostingClassifier(init=rf)

clf.fit(X_train, y_train)
acc = clf.score(X_test, y_test)
print("Accuracy: {:.4f}".format(acc))
</code></pre></div>
<p dir="auto">It also seems that the init param in GradientBoostingClassifier is<br>
not really tested.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pprett/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pprett">@pprett</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/glouppe/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/glouppe">@glouppe</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ogrisel/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ogrisel">@ogrisel</a></p>