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 592 B

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