Spaces:
Build error
Build error
Update inference/predict.py
Browse files- inference/predict.py +5 -1
inference/predict.py
CHANGED
|
@@ -1,20 +1,24 @@
|
|
| 1 |
import pandas as pd
|
| 2 |
#import lightgbm as lgb
|
| 3 |
#from sklearn.preprocessing import LabelEncoder
|
| 4 |
-
from scipy.stats import boxcox
|
| 5 |
import subprocess
|
| 6 |
import sys
|
| 7 |
|
| 8 |
try:
|
| 9 |
import lightgbm as lgb
|
| 10 |
from sklearn.preprocessing import LabelEncoder
|
|
|
|
|
|
|
| 11 |
|
| 12 |
except:
|
| 13 |
print("An exception occurred")
|
| 14 |
subprocess.run([sys.executable, "-m", "pip", "install", "lightgbm"])
|
|
|
|
| 15 |
subprocess.run([sys.executable, "-m", "pip", "install", "scikit-learn"])
|
| 16 |
from sklearn.preprocessing import LabelEncoder
|
| 17 |
import lightgbm as lgb
|
|
|
|
|
|
|
| 18 |
|
| 19 |
def preprocess_input(input_data):
|
| 20 |
# Preprocess the input data (assuming a similar preprocessing as in the training script)
|
|
|
|
| 1 |
import pandas as pd
|
| 2 |
#import lightgbm as lgb
|
| 3 |
#from sklearn.preprocessing import LabelEncoder
|
|
|
|
| 4 |
import subprocess
|
| 5 |
import sys
|
| 6 |
|
| 7 |
try:
|
| 8 |
import lightgbm as lgb
|
| 9 |
from sklearn.preprocessing import LabelEncoder
|
| 10 |
+
from scipy.stats import boxcox
|
| 11 |
+
|
| 12 |
|
| 13 |
except:
|
| 14 |
print("An exception occurred")
|
| 15 |
subprocess.run([sys.executable, "-m", "pip", "install", "lightgbm"])
|
| 16 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "scipy"])
|
| 17 |
subprocess.run([sys.executable, "-m", "pip", "install", "scikit-learn"])
|
| 18 |
from sklearn.preprocessing import LabelEncoder
|
| 19 |
import lightgbm as lgb
|
| 20 |
+
from scipy.stats import boxcox
|
| 21 |
+
|
| 22 |
|
| 23 |
def preprocess_input(input_data):
|
| 24 |
# Preprocess the input data (assuming a similar preprocessing as in the training script)
|