(self, data_instances)
return predict_result
Prediction of lr
        Parameters
        ----------
        data_instances: Table of Instance, input data

        Returns
        ----------
        Table
            include input data label, predict probably, label
Prediction of lr
        Parameters
        ----------
        data_instances: Table of Instance, input data
Prediction of lr Parameters ---------- data_instances : Table of Instance input data
def predict(self, data_instances):
        """
        Prediction of lr
        Parameters
        ----------
        data_instances: Table of Instance, input data

        Returns
        ----------
        Table
            include input data label, predict probably, label
        """
        LOGGER.info("Start predict is a one_vs_rest task: {}".format(self.need_one_vs_rest))
        self._abnormal_detection(data_instances)
        data_instances = self.align_data_header(data_instances, self.header)
        if self.need_one_vs_rest:
            predict_result = self.one_vs_rest_obj.predict(data_instances)
            return predict_result

        # data_features = self.transform(data_instances)
        pred_prob = self.compute_wx(data_instances, self.model_weights.coef_, self.model_weights.intercept_)
        host_probs = self.transfer_variable.host_prob.get(idx=-1)

        LOGGER.info("Get probability from Host")

        # guest probability
        for host_prob in host_probs:
            pred_prob = pred_prob.join(host_prob, lambda g, h: g + h)
        pred_prob = pred_prob.mapValues(lambda p: activation.sigmoid(p))
        threshold = self.model_param.predict_param.threshold

        # pred_label = pred_prob.mapValues(lambda x: 1 if x > threshold else 0)

        # predict_result = data_instances.mapValues(lambda x: x.label)
        # predict_result = predict_result.join(pred_prob, lambda x, y: (x, y))
        # predict_result = predict_result.join(pred_label, lambda x, y: [x[0], y, x[1],
        #                                                               {"0": (1 - x[1]), "1": x[1]}])
        predict_result = self.predict_score_to_output(data_instances, pred_prob, classes=[0, 1], threshold=threshold)

        return predict_result
def predict ( self , data_instances ) : LOGGER . info ( "Start predict is a one_vs_rest task: {}" . format ( self . need_one_vs_rest ) ) self . _abnormal_detection ( data_instances ) data_instances = self . align_data_header ( data_instances , self . header ) if self . need_one_vs_rest : predict_result = self . one_vs_rest_obj . predict ( data_instances ) return predict_result # data_features = self.transform(data_instances) pred_prob = self . compute_wx ( data_instances , self . model_weights . coef_ , self . model_weights . intercept_ ) host_probs = self . transfer_variable . host_prob . get ( idx = - 1 ) LOGGER . info ( "Get probability from Host" ) # guest probability for host_prob in host_probs : pred_prob = pred_prob . join ( host_prob , lambda g , h : g + h ) pred_prob = pred_prob . mapValues ( lambda p : activation . sigmoid ( p ) ) threshold = self . model_param . predict_param . threshold # pred_label = pred_prob.mapValues(lambda x: 1 if x > threshold else 0) # predict_result = data_instances.mapValues(lambda x: x.label) # predict_result = predict_result.join(pred_prob, lambda x, y: (x, y)) # predict_result = predict_result.join(pred_label, lambda x, y: [x[0], y, x[1], #                                                               {"0": (1 - x[1]), "1": x[1]}]) predict_result = self . predict_score_to_output ( data_instances , pred_prob , classes = [ 0 , 1 ] , threshold = threshold ) return predict_result