<div dir="ltr">I think he's asking whether returning the model is part of the API (i.e. is it a bug that SVM and NB don't return self?).</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 13, 2016 at 12:23 PM, Jacob Schreiber <span dir="ltr"><<a href="mailto:jmschreiber91@gmail.com" target="_blank">jmschreiber91@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The fit method returns the object itself, so regardless of which way you do it, it will work. The reason the fit method returns itself is so that you can chain methods, like "preds = clf.fit(X, y).predict(X)" </div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Dec 13, 2016 at 12:14 PM, Graham Arthur Mackenzie <span dir="ltr"><<a href="mailto:graham.arthur.mackenzie@gmail.com" target="_blank">graham.arthur.mackenzie@<wbr>gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><span style="font-size:12.8px">Hello All,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I hope this is the right way to ask a question about documentation.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">In <a href="http://scikit-learn.org/stable/modules/tree.html#tree" target="_blank">the doc for Decision Trees</a>, the fit statement is assigned back to the classifier:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">clf = clf.fit(X, Y)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Whereas, for <a href="http://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.GaussianNB.html" target="_blank">Naive Bayes</a> and <a href="http://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html" target="_blank">Support Vector Machines</a>, it's just:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">clf.fit(X, Y)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I assumed this was a typo, but thought I should try and verify such before proceeding under that assumption. I appreciate any feedback you can provide.<br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thank You and Be Well,</div><div style="font-size:12.8px">Graham</div></div>
<br></div></div>______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/scikit-learn</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/scikit-learn</a><br>
<br></blockquote></div><br></div>