示例#1
0
 def add_fold(self, predictions):
     def to_float(x):
         if x is None:
             return None
         return float(x)
     PredictionsMonitoringCore.add_fold(self, predictions)
     predictions_db = [PredictionsAlchemy(exp_id=self.exp.exp_id,
                                          instance_id=p.instance_id,
                                          value=p.value_to_str(),
                                          proba=to_float(p.proba))
                       for p in predictions.to_list()]
     self.exp.session.bulk_save_objects(predictions_db)
示例#2
0
 def init(self, features_ids):
     self.performance = PerformanceMonitoring(self.num_folds, self.conf)
     self.predictions = PredictionsMonitoring(self.conf, True)
     self.coefficients = None
     if self.interpretation:
         self.coefficients = Coefficients(self.num_folds, features_ids,
                                          self.conf, self.exp.session)
示例#3
0
    def final_computations(self):
        def to_float(x):
            return None if x is None else float(x)

        def to_int(x):
            return None if x is None else int(x)

        PredictionsMonitoringCore.final_computations(self)
        predictions_db = [
            PredictionsAlchemy(exp_id=self.exp.exp_id,
                               instance_id=to_int(p.instance_id),
                               value=p.value_to_str(),
                               proba=to_float(p.proba),
                               score=to_float(p.score),
                               rank=to_int(p.rank))
            for p in self.predictions.to_list()
        ]
        self.exp.session.bulk_save_objects(predictions_db)
示例#4
0
 def __init__(self, exp, num_folds):
     PredictionsMonitoringCore.__init__(self, exp.exp_conf.logger,
                                        num_folds)
     self.exp = exp
示例#5
0
 def __init__(self, exp):
     PredictionsMonitoringCore.__init__(self)
     self.exp = exp
示例#6
0
 def __init__(self, exp):
     PredictionsMonitoringCore.__init__(self, exp.exp_conf.logger)
     self.exp = exp