Usuń 'src/rabbit.py'
This commit is contained in:
parent
dd3c53c82e
commit
51fa7c527d
@ -1,20 +0,0 @@
|
|||||||
from vowpalwabbit import pyvw
|
|
||||||
|
|
||||||
|
|
||||||
class Rabbit:
|
|
||||||
def __init__(self):
|
|
||||||
self.data = open('./../resources/simulations/learning_data.txt')
|
|
||||||
self.model = pyvw.vw(quiet=True)
|
|
||||||
self.train_set = self.data.read().splitlines()
|
|
||||||
self.learn()
|
|
||||||
|
|
||||||
def learn(self):
|
|
||||||
for example in self.train_set:
|
|
||||||
self.model.learn(example)
|
|
||||||
|
|
||||||
def check(self, matrix, x, y):
|
|
||||||
set = ["| price:", str(matrix.tile_worth(x, y)), "x:", str(x), "y:", str(y)]
|
|
||||||
test_sample = ' '.join(set)
|
|
||||||
prediction = self.model.predict(test_sample)
|
|
||||||
print(test_sample)
|
|
||||||
print(prediction)
|
|
Loading…
Reference in New Issue
Block a user