cole wilson

Bayan Machine Learning

Bayan is a small simple Python module to analyze files and strings.


Below is an example of a program that learns to differentiate between pictures of cats and dogs.

It is assumed that you have downloaded in the same diectory as your program.

import bayan as b


f = b.getfile('') #Get file from URL and string it.
b.train(f,'cat') #Train cat1.jpg to slot 1

f = b.getfile('') #Get file from URL and string it.
b.train(f,'dog') #Train dog1.jpg to slot 2

f = b.getfile('')#Get file to test.
result = b.analyze(f)

print(result) #Returns 'cat'

Of course, you must provide it with more exmples.

Advanced Options

The higher the number, the more precise. Lower numbers are more inaccurate, but high numbers are too specific.