linear models are also extensively used for classification let' look at binary classification first in this casea prediction is made using the following formulay [ [ [ [ [px[pb the formula looks very similar to the one for linear regressionbut instead of just returning the weighted sum of the featureswe threshold the predicted value at zero if the function is smaller than zerowe predict the class - if it is larger than zerowe predict the class + this prediction rule is common to all linear models for classification againthere are many different ways to find the coefficients (wand the intercept (bfor linear models for regressionthe outputyis linear function of the featuresa lineplaneor hyperplane (in higher dimensionsfor linear models for classificationthe decision boundary is linear function of the input in other wordsa (binarylinear classifier is classifier that separates two classes using linea planeor hyperplane we will see examples of that in this section there are many algorithms for learning linear models these algorithms all differ in the following two waysthe way in which they measure how well particular combination of coefficients and intercept fits the training data if and what kind of regularization they use different algorithms choose different ways to measure what "fitting the training set wellmeans for technical mathematical reasonsit is not possible to adjust and to minimize the number of misclassifications the algorithms produceas one might hope for our purposesand many applicationsthe different choices for item in the preceding list (called loss functionsare of little significance the two most common linear classification algorithms are logistic regressionimplemented in linear_model logisticregressionand linear support vector machines (linear svms)implemented in svm linearsvc (svc stands for support vector classifierdespite its namelogisticregression is classification algorithm and not regression algorithmand it should not be confused with linearregression we can apply the logisticregression and linearsvc models to the forge datasetand visualize the decision boundary as found by the linear models (figure - ) supervised learning