You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

example_init.py 558 B

1234567891011121314151617181920
  1. import os
  2. import joblib
  3. import numpy as np
  4. from learnware.model import BaseModel
  5. class Model(BaseModel):
  6. def __init__(self):
  7. super(Model, self).__init__(input_shape=(31,), output_shape=(1,))
  8. dir_path = os.path.dirname(os.path.abspath(__file__))
  9. self.model = joblib.load(os.path.join(dir_path, "model.out"))
  10. def fit(self, X: np.ndarray, y: np.ndarray):
  11. pass
  12. def predict(self, X: np.ndarray) -> np.ndarray:
  13. return self.model.predict(X)
  14. def finetune(self, X: np.ndarray, y: np.ndarray):
  15. pass