Change prediction input feature

This commit is contained in:
sosokker 2024-05-11 02:04:56 +07:00
parent 86e420bd0a
commit db2cc6862f

View File

@ -2,7 +2,7 @@ import joblib
class XgboostIndoorModel:
MODEL_PATH = 'xgboost_model.pkl'
MODEL_PATH = 'analytic/health/xgboost_model.pkl'
def __init__(self):
self.__model = joblib.load(self.MODEL_PATH)
@ -13,7 +13,7 @@ class XgboostIndoorModel:
Input order : ['outdoor_temp', 'outdoor_feels_like', 'outdoor_pressure',
'outdoor_humidity', 'outdoor_pm25', 'outdoor_pm10']
"""
if len(X) != 6:
if len(X) != 4:
raise ValueError(f"Expected 6 features, got {len(X)}")
return self.__model.predict([X])[0]