Spaces:
Sleeping
Sleeping
Download prediction.py from IEEE/event-budget-prediction: direct link, hf CLI and curl.
- Browser
- Download file 544 Bytes
-
https://huggingface.co/spaces/IEEE/event-budget-prediction/resolve/main/prediction.py
- Command line
-
hf download hf://spaces/IEEE/event-budget-prediction/prediction.py
-
curl -L -o prediction.py https://huggingface.co/spaces/IEEE/event-budget-prediction/resolve/main/prediction.py
544 Bytes
| import numpy as np | |
| def inv_yeojohnson(value, lmbda): | |
| if value>= 0 and lmbda == 0: | |
| return np.exp(value) - 1 | |
| elif value >= 0 and lmbda != 0: | |
| return (value * lmbda + 1) ** (1 / lmbda) - 1 | |
| elif value < 0 and lmbda != 2: | |
| return 1 - (-(2 - lmbda) * value + 1) ** (1 / (2 - lmbda)) | |
| elif value < 0 and lmbda == 2: | |
| return 1 - np.exp(-value) | |
| def predict_income(model, df): | |
| return model.predict(df)[0] | |
| #def inverse_transform(value, lambdas): | |
| # return inv_yeojohnson(value, lambdas) |