26 lines
509 B
Python
26 lines
509 B
Python
import joblib
|
|
import numpy as np
|
|
|
|
|
|
def load_model(path):
|
|
gbm = joblib.load(path)
|
|
return gbm
|
|
|
|
def pv_forecast(inputs: np.ndarray, model):
|
|
"""_summary_
|
|
|
|
Args:
|
|
inputs (np.ndarray): 输入序列
|
|
model (_type_): _description_
|
|
"""
|
|
out = model.predict([inputs])
|
|
return out
|
|
|
|
|
|
# if __name__ == '__main__':
|
|
# model = load_model('models/pv_pred.joblib')
|
|
# inputs = np.random.randn(24)
|
|
#
|
|
# print(inputs.shape)
|
|
# out = pv_forecast(inputs, model)
|
|
# print(out) |