-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcredit cardtest1.py
53 lines (44 loc) · 1.04 KB
/
credit cardtest1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import tensorflow as tf
import pandas as pd
import numpy as np
from tensorflow.contrib import rnn
from sklearn.model_selection import train_test_split
from sklearn.metrics import f1_score, accuracy_score, recall_score, precision_score
data = pd.read_csv('creditcard.csv', skiprows=[0], header=None)
rows_list = []
index = 0
print(data.head(20))
dict1 = {}
# get input row in dictionary format
# key = col_name
dict1.update(data.iloc[[0]])
rows_list.append(dict1)
l = data.iloc[:, -1]
# for temp in l:
# if temp == 1:
# data_0 =
# print(data_0)
# index += 1
#
# print(index)
# print(Data)
# print(Data.shape)
# for row in l:
# if row == 1:
#
# dict1 = {}
# # get input row in dictionary format
# # key = col_name
# dict1.update(data.iloc[[index]])
# rows_list.append(dict1)
# index += 1
#
# df = pd.DataFrame(rows_list)
# print(df)
# print(df.shape)
#
# features = df.iloc[:, 1:30]
# labels = df.iloc[:, -1]
#
# print(np.array(features.head(10)))
# print(np.array(labels.head(10)))