Spaces:
Build error
Build error
| import pandas as pd | |
| import pickle | |
| class CATESimulationReady: | |
| def __init__(self, model_path, y_pred_path): | |
| self.model_path = model_path | |
| self.y_pred_path = y_pred_path | |
| # def get_model(self): | |
| # model = pd.read_csv(self.model_path) | |
| # return model | |
| def predict(self): | |
| with open(self.y_pred_path, 'rb') as f: | |
| y_pred = pickle.load(f) | |
| return y_pred | |
| def feature_importance(self, fi_path): | |
| fi = pd.read_csv(fi_path) | |
| fi.columns = ['feature', 'score'] | |
| return fi |