def evaluate(self, Xi, Xv, y_true):
    '\n        :param Xi: list of list of feature indices of each sample in the dataset\n        :param Xv: list of list of feature values of each sample in the dataset\n        :param y: label of each sample in the dataset\n        :return: metric of the evaluation\n        '
    size = y_true.shape[0]
    y_pred = self.predict(Xi, Xv)
    error = (y_true - y_pred)
    mse = ((error * error).sum() / size)
    y_pred_m = y_pred.copy()
    y_pred_m[(y_pred_m >= self.threshold)] = 1
    y_pred_m[(y_pred_m < self.threshold)] = 0
    cm = metrics.confusion_matrix(y_true, y_pred_m, labels=[1, 0])
    real_1_count = cm[0, :].sum()
    predict_1_count = cm[:, 0].sum()
    right_1_count = cm[(0, 0)]
    if (predict_1_count == 0):
        precision_1 = 0
    else:
        precision_1 = (right_1_count / predict_1_count)
    if (real_1_count == 0):
        recall_1 = 0
    else:
        recall_1 = (right_1_count / real_1_count)
    return {'size': size, 'acc': ((cm[(0, 0)] + cm[(1, 1)]) / size), 'precision_1': precision_1, 'recall_1': recall_1, 'auc': self.eval_metric(y_true, y_pred), 'mse': mse}
:param Xi: list of list of feature indices of each sample in the dataset
:param Xv: list of list of feature values of each sample in the dataset
:param y: label of each sample in the dataset
:return: metric of the evaluation
def evaluate(self, Xi, Xv, y_true):
    '\n        :param Xi: list of list of feature indices of each sample in the dataset\n        :param Xv: list of list of feature values of each sample in the dataset\n        :param y: label of each sample in the dataset\n        :return: metric of the evaluation\n        '
    size = y_true.shape[0]
    y_pred = self.predict(Xi, Xv)
    error = (y_true - y_pred)
    mse = ((error * error).sum() / size)
    y_pred_m = y_pred.copy()
    y_pred_m[(y_pred_m >= self.threshold)] = 1
    y_pred_m[(y_pred_m < self.threshold)] = 0
    cm = metrics.confusion_matrix(y_true, y_pred_m, labels=[1, 0])
    real_1_count = cm[0, :].sum()
    predict_1_count = cm[:, 0].sum()
    right_1_count = cm[(0, 0)]
    if (predict_1_count == 0):
        precision_1 = 0
    else:
        precision_1 = (right_1_count / predict_1_count)
    if (real_1_count == 0):
        recall_1 = 0
    else:
        recall_1 = (right_1_count / real_1_count)
    return {'size': size, 'acc': ((cm[(0, 0)] + cm[(1, 1)]) / size), 'precision_1': precision_1, 'recall_1': recall_1, 'auc': self.eval_metric(y_true, y_pred), 'mse': mse}