Skip to content
JarJuicy edited this page Mar 16, 2019 · 5 revisions

Documentation for Best Average Algorithm

Before you start, remember to copy the src.py file to your code directory.
Now, import the module and initialize the algorithm

from src import main
alg = main()

First, to train the algorithm (Since this is a lazy learning algorithm, there isn't really train, this just gets the dataset initialized)

alg.train({(1, 1, 1):(4, 6, 9), (5, 6, 7):(3, 4, 5), (6, 6, 5):(2, 4, 5), (6, 5, 6):(2, 3, 5), (5, 6, 6):(2, 7, 5)})

As described in README, the dataset should be a dictionary of the coordinates in tuple and their corresponding values in tuple.
Then we can predict some values using the predict() function.

print(alg.predict([(6, 6, 6)], 3, 1.1))
# (2.0, 4.666666666666667, 5.0)

Clone this wiki locally