Spaces:
Runtime error
Runtime error
Commit
•
4e788f7
1
Parent(s):
5672f82
Update main.py
Browse files
main.py
CHANGED
@@ -143,9 +143,9 @@ def read_item(ticker: str):
|
|
143 |
df = data_manipolation(df,ticker)
|
144 |
df=df.round(2)
|
145 |
Xtrain, ytrain, Xtest, ytest = data_split_train_test(df,ticker)
|
146 |
-
forecast_value = xgb_training_forecast(Xtrain, ytrain, Xtest, ytest)
|
147 |
#result = forecast_value.to_json(orient="records")
|
148 |
-
return json.dumps(forecast_value, cls=NumpyEncoder)
|
149 |
|
150 |
class NumpyEncoder(json.JSONEncoder):
|
151 |
"""Custom encoder for numpy data types"""
|
|
|
143 |
df = data_manipolation(df,ticker)
|
144 |
df=df.round(2)
|
145 |
Xtrain, ytrain, Xtest, ytest = data_split_train_test(df,ticker)
|
146 |
+
forecast_value = xgb_training_forecast(Xtrain, ytrain, Xtest, ytest)
|
147 |
#result = forecast_value.to_json(orient="records")
|
148 |
+
return json.dumps(forecast_value.round(2), cls=NumpyEncoder)
|
149 |
|
150 |
class NumpyEncoder(json.JSONEncoder):
|
151 |
"""Custom encoder for numpy data types"""
|