{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# SVM: Separating hyperplane for unbalanced classes\n\nFind the optimal separating hyperplane using an SVC for classes that\nare unbalanced.\n\nWe first find the separating plane with a plain SVC and then plot\n(dashed) the separating hyperplane with automatically correction for\nunbalanced classes.\n\n.. currentmodule:: sklearn.linear_model\n\n
This example will also work by replacing ``SVC(kernel=\"linear\")``\n with ``SGDClassifier(loss=\"hinge\")``. Setting the ``loss`` parameter\n of the :class:`SGDClassifier` equal to ``hinge`` will yield behaviour\n such as that of a SVC with a linear kernel.\n\n For example try instead of the ``SVC``::\n\n clf = SGDClassifier(n_iter=100, alpha=0.01)