diff --git a/machine_learning/model_inference.py b/machine_learning/model_inference.py index 46b4e9a..8d18975 100644 --- a/machine_learning/model_inference.py +++ b/machine_learning/model_inference.py @@ -1,6 +1,7 @@ import os import joblib import pandas as pd +from sklearn.impute import SimpleImputer TEST_DATA_DIR = "datasets_test" @@ -15,6 +16,9 @@ for file in os.listdir(TEST_DATA_DIR): data_test = pd.concat(test_df_list, ignore_index=True).sample(frac=1, random_state=42) X_test = data_test.iloc[:, 1:-1].values +imputer = SimpleImputer(strategy='mean') +X_imputed = imputer.fit_transform(X_test) + model_filename = 'trained_model.pkl' model = joblib.load(model_filename)