Zaktualizuj 'injectCode.py'
This commit is contained in:
parent
525ec6cde1
commit
9c3d698f05
@ -3,14 +3,14 @@ import sys
|
|||||||
|
|
||||||
|
|
||||||
def prediction(warzywo, nawoz ,srodek, stan_wzrostu):
|
def prediction(warzywo, nawoz ,srodek, stan_wzrostu):
|
||||||
filename = 'pliki/decisionTree.sav'
|
filename = 'decisionTree.sav'
|
||||||
tree = pickle.load(open(filename, 'rb'))
|
tree = pickle.load(open(filename, 'rb'))
|
||||||
val = (tree.predict([[warzywo, nawoz, srodek, stan_wzrostu]]))
|
val = (tree.predict([[warzywo, nawoz, srodek, stan_wzrostu]]))
|
||||||
save(val)
|
save(val)
|
||||||
|
|
||||||
def save(prediction):
|
def save(prediction):
|
||||||
pred = str(prediction)
|
pred = str(prediction)
|
||||||
plik = open('pliki/dec.txt', 'w')
|
plik = open('dec.txt', 'w')
|
||||||
plik.write(pred[1])
|
plik.write(pred[1])
|
||||||
plik.close()
|
plik.close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user