-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuffer.py
72 lines (54 loc) · 1.43 KB
/
buffer.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import numpy as np
import pandas as pd
# 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
game_state = [0,0,0,0,0,0,0,
0,0,0,0,0,0,0,
0,0,0,0,0,0,0,
0,0,0,0,0,0,0,
0,0,0,-1,0,0,0,
0,0,0,1,0,0,0]
game_state = [0,0,0,0,0,0,
0,0,0,0,0,0,
0,0,0,0,0,0,
1,-1,0,0,0,0,
0,0,0,0,0,0,
0,0,0,0,0,0,
0,0,0,0,0,0]
game_state2 = [1,-1,0,0,0,0,
0,0,0,0,0,0,
-1,0,0,0,0,0,
1,-1,0,0,0,0,
0,0,0,0,0,0,
0,0,0,0,0,0,
1,0,0,0,0,0]
game = dict()
i=1
for x in game_state:
if i<10:
game.update({"pos_0"+str(i):x})
else:
game.update({"pos_"+str(i):x})
i+=1
data_frame = pd.DataFrame(game,index=[0])
game2 = dict()
i=1
for x in game_state2:
if i<10:
game2.update({"pos_0"+str(i):x})
else:
game2.update({"pos_"+str(i):x})
i+=1
data_frame2 = pd.DataFrame(game2,index=[0])
from joblib import load
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
model_1 = load("PREDICTOR.joblib")
out = model_1.predict(data_frame)
print(out)
out = model_1.predict(data_frame2)
print(out)
model_1 = load("PREDICTOR3.joblib")
out = model_1.predict(data_frame)
print(out)
out = model_1.predict(data_frame2)
print(out)