the number of samples they are also often used on very large datasetssimply because it' not feasible to train other models howeverin lower-dimensional spacesother models might yield better generalization performance we will look at some examples in which linear models fail in "kernelized support vector machineson page method chaining the fit method of all scikit-learn models returns self this allows you to write code like the followingwhich we've already used extensively in this in[ ]instantiate model and fit it in one line logreg logisticregression(fit(x_trainy_trainherewe used the return value of fit (which is selfto assign the trained model to the variable logreg this concatenation of method calls (here __init__ and then fitis known as method chaining another common application of method chaining in scikit-learn is to fit and predict in one linein[ ]logreg logisticregression(y_pred logreg fit(x_trainy_trainpredict(x_testfinallyyou can even do model instantiationfittingand predicting in one linein[ ]y_pred logisticregression(fit(x_trainy_trainpredict(x_testthis very short variant is not idealthough lot is happening in single linewhich might make the code hard to read additionallythe fitted logistic regression model isn' stored in any variableso we can' inspect it or use it to predict on any other data naive bayes classifiers naive bayes classifiers are family of classifiers that are quite similar to the linear models discussed in the previous section howeverthey tend to be even faster in training the price paid for this efficiency is that naive bayes models often provide generalization performance that is slightly worse than that of linear classifiers like logisticregression and linearsvc the reason that naive bayes models are so efficient is that they learn parameters by looking at each feature individually and collect simple per-class statistics from each feature there are three kinds of naive bayes classifiers implemented in scikit supervised learning