The implementation between each model can be entire different, we are not going to go into details about each particular model, each model implementation in Python Bridge is a set of expected functions focus in functionality
Every model class must be under the package models, inside the Python Bridge folder, and must extended from the class ModelWrapper. An example of a model class with the bare minimum, can be found below
Code Block | ||||
---|---|---|---|---|
| ||||
from models.model_wrapper import ModelWrapper
class Test(ModelWrapper):
def __init__(self):
super().__init__()
def initialize(self, model_dir, **kwargs):
pass
def load(self, model_dir, name, version):
pass
def save(self):
pass
def clear(self):
pass
def feed(self, data):
pass
def train(self, **kwargs):
pass
def predict(self, data: list):
pass
def regress(self, data):
pass
def classify(self, data) -> (str, float):
pass
|
Code Block | ||||
---|---|---|---|---|
| ||||
def initialize(self, model_dir, **kwargs): |
...