(res, index)
Compute confusion matrix

    Args:
        res (Orange.evaluation.Results): evaluation results
        index (int): model index

    Returns: Confusion matrix
Compute confusion matrix
Compute confusion matrix
def confusion_matrix(res, index):
    """
    Compute confusion matrix

    Args:
        res (Orange.evaluation.Results): evaluation results
        index (int): model index

    Returns: Confusion matrix
    """
    labels = np.arange(len(res.domain.class_var.values))
    if not res.actual.size:
        # scikit-learn will not return an zero matrix
        return np.zeros((len(labels), len(labels)))
    else:
        return skl_metrics.confusion_matrix(
            res.actual, res.predicted[index], labels=labels)
def confusion_matrix ( res , index ) : labels = np . arange ( len ( res . domain . class_var . values ) ) if not res . actual . size : # scikit-learn will not return an zero matrix return np . zeros ( ( len ( labels ) , len ( labels ) ) ) else : return skl_metrics . confusion_matrix ( res . actual , res . predicted [ index ] , labels = labels )