Am 03.03.2016 um 13:43 schrieb Robert Pollak:
> Hello list!
> 
> I want to use parallel cross-validation and still get reproducible results. 
> In my code, I do
> 
> if __name__ == '__main__': # This is necessary to use n_jobs > 1.
>     [...]
>     clf = DecisionTreeClassifier(max_depth=5)
>     cross_validation = StratifiedKFold(y, n_folds=10, shuffle=True, 
> random_state=0)
>     cross_val_prediction = cross_val_predict(clf, X, y, cv=cross_validation, 
> n_jobs=6)
> 
> However, this gives different results than with n_jobs=1!

Oh, stupid me! I just forgot to set the random_state of the
DecisionTreeClassifier.


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to