File size: 555 Bytes
6f4f21f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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