From 8abc46535913ada500ab6a5a53e6d803c633dc90 Mon Sep 17 00:00:00 2001 From: Vikram Vikrant <50881531+VikramVikrant@users.noreply.github.com> Date: Wed, 12 Jun 2019 18:22:16 +0530 Subject: [PATCH] Create svm.py --- very_simple_examples/svm.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 very_simple_examples/svm.py diff --git a/very_simple_examples/svm.py b/very_simple_examples/svm.py new file mode 100644 index 0000000..f96fb7e --- /dev/null +++ b/very_simple_examples/svm.py @@ -0,0 +1,17 @@ +# Using Support Vector Machines (SVM) in scikit learn +from sklearn import svm + +clf= svm.SVC(gamma='scale') + +# height , weight, shoesize of 11 persons +X=[[180,70,8],[160,45,5],[120,60,5],[190,90,10],[200,85,11],[100,60,5],[250,150,12],[120,55,6],[140,60,7],\ + [150,70,9],[90,55,3]] + +# Gender of 11 persons of planet earth +Y=['male','female','female','male','male','female','male','female','male','male','female'] + +clf= clf.fit(X,Y) + +prediction= clf.predict([[140,60,7]]) + +print(prediction)