WQI_classification / test_model.py
Tariq349's picture
Upload 2 files
0b166ec verified
Raw
History Blame Contribute Delete
1.09 kB
import joblib
import sys
print("Python executable:", sys.executable)
try:
import lightgbm as lgb
print("LightGBM imported successfully!")
except ImportError as e:
print("LightGBM import failed:", e)
sys.exit(1)
try:
model = joblib.load("lightgbm_split2_best_model2 (1).pkl")
print("Model loaded successfully!")
print("Model type:", type(model))
if hasattr(model, "feature_name"):
print("Model features:", model.feature_name())
if hasattr(model, "n_features_in_"):
print("Model n_features_in_:", model.n_features_in_)
if hasattr(model, "classes_"):
print("Model classes:", model.classes_)
except Exception as e:
print("Model load failed:", e)
try:
scaler = joblib.load("robust_scaler (1).pkl")
print("Scaler loaded successfully!")
print("Scaler type:", type(scaler))
if hasattr(scaler, "center_"):
print("Scaler center (medians):", scaler.center_)
if hasattr(scaler, "scale_"):
print("Scaler scale (IQR):", scaler.scale_)
except Exception as e:
print("Scaler load failed:", e)