Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import numpy as np
- from sklearn import preprocessing, cross_validation, neighbors, svm
- import matplotlib.pyplot as plt
- #Read Data
- df = pd.read_csv("poker.txt")
- full_data = df.astype(float).values.tolist()
- X = np.array(df.drop([df.columns[10]], 1))
- y = np.array(df[df.columns[10]])
- X_train, X_test, y_train, y_test = cross_validation.train_test_split(X, y, test_size = 0.4)
- svc = svm.SVC(kernel='poly', C=1, decision_function_shape='ovr').fit(X, y)
- confidence = svc.score(X_test, y_test)
- print(confidence)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement