Created
April 24, 2018 23:38
-
-
Save llSourcell/b4c8396080143f47cf90da8788b20093 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import pandas | |
| from sklearn.tree import DecisionTreeClassifier | |
| #Read transaction data | |
| data=pd.read_csv('../input/creditcard.csv') | |
| x_train, x_test, y_train, y_test = train_test_split(data, target, train_size = 0.50) | |
| #train model | |
| model = DecisionTreeClassifier.fit(x_train,y_train) | |
| score = model.score(x_test, y_test) | |
| #print result | |
| print(score) | |
| #test, output fraud/not fraud | |
| model.predict(y_test[3]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment