(self, prediction_result)
return score_result
result_schema = {"header": ["label", "predict_result", "predict_score", "credit_score"],
                         "sid_name": schema.get('sid_name')}
result_schema = {"header": ["label", "predict_result", "predict_score", "credit_score"],
                         "sid_name": schema.get('sid_name')}
result_schema = { header : [ label predict_result predict_score credit_score ] sid_name : schema . get ( sid_name ) }
def fit(self, prediction_result):
        LOGGER.info(f"Start Scorecard Transform, method: {self.method}")

        offset, factor, factor_base = self.offset, self.factor, self.factor_base
        if factor_base != 2:
            LOGGER.warning(f"scorecard param 'factor_base' given is {factor_base}, which is not equal to 2.")
        upper_limit_value, lower_limit_value = self.upper_limit_ratio * offset, self.lower_limit_value
        if isinstance(prediction_result.first()[1], Instance):
            self.use_match_id = True
        score_result = prediction_result.mapValues(lambda v: Scorecard.compute_credit_score(v, offset, factor,
                                                                                            factor_base,
                                                                                            upper_limit_value,
                                                                                            lower_limit_value,
                                                                                            self.use_match_id))
        result_schema = copy.deepcopy(prediction_result.schema)
        result_schema["header"] = ["label", "predict_result", "predict_score", "credit_score"]
        """
        result_schema = {"header": ["label", "predict_result", "predict_score", "credit_score"],
                         "sid_name": schema.get('sid_name')}
        """
        score_result.schema = result_schema

        self._set_summary()
        LOGGER.info(f"Finish Scorecard Transform!")

        return score_result
def fit ( self , prediction_result ) : LOGGER . info ( f"Start Scorecard Transform, method: {self.method}" ) offset , factor , factor_base = self . offset , self . factor , self . factor_base if factor_base != 2 : LOGGER . warning ( f"scorecard param 'factor_base' given is {factor_base}, which is not equal to 2." ) upper_limit_value , lower_limit_value = self . upper_limit_ratio * offset , self . lower_limit_value if isinstance ( prediction_result . first ( ) [ 1 ] , Instance ) : self . use_match_id = True score_result = prediction_result . mapValues ( lambda v : Scorecard . compute_credit_score ( v , offset , factor , factor_base , upper_limit_value , lower_limit_value , self . use_match_id ) ) result_schema = copy . deepcopy ( prediction_result . schema ) result_schema [ "header" ] = [ "label" , "predict_result" , "predict_score" , "credit_score" ] score_result . schema = result_schema self . _set_summary ( ) LOGGER . info ( f"Finish Scorecard Transform!" ) return score_result