from the above image in outputwe can easily observe the "marginswithin the discriminative classifiers svm will choose the line that maximizes the margin nextwe will use scikit-learn' support vector classifier to train an svm model on this data herewe are using linear kernel to fit svm as followsfrom sklearn svm import svc "support vector classifiermodel svc(kernel='linear' = model fit(xythe output is as followssvc( = cache_size= class_weight=nonecoef = decision_function_shape='ovr'degree= gamma='auto_deprecated'kernel='linear'max_iter=- probability=falserandom_state=noneshrinking=truetol= verbose=falsenowfor better understandingthe following will plot the decision functions for svcdef decision_function(modelax=noneplot_support=true)if ax is noneax plt gca(xlim ax get_xlim(ylim ax get_ylim(for evaluating modelwe need to create grid as followsx np linspace(xlim[ ]xlim[ ] np linspace(ylim[ ]ylim[ ]