Created
July 12, 2018 18:44
-
-
Save monir-zaman/4c1eef833c05c79ff78f38a895f7d61d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Spyder Editor | |
This is a temporary script file. | |
""" | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
get_ipython().magic('matplotlib inline') | |
#import os | |
mydataset=pd.read_csv('student_data.csv') | |
#mydataset.head() | |
#sns.pairplot(data=mydataset, hue='species') | |
from sklearn.model_selection import train_test_split | |
x=mydataset.iloc[:,0:19] | |
y=mydataset.iloc[:,20] | |
print("y head is : \n") | |
print(y.head()) | |
x_train,x_test, y_train, y_test=train_test_split(x,y,test_size=0.30) | |
from sklearn.svm import SVC | |
model=SVC() | |
model.fit(x_train, y_train) | |
pred=model.predict(x_test) | |
from sklearn.metrics import classification_report, confusion_matrix | |
print(confusion_matrix(y_test,pred)) | |
print(classification_report(y_test, pred)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment