{
    "file_diffs": [
        {
            "old_file_content": "\"\"\"\nMethods for scoring prediction results (CA, AUC, ...).\n\nExamples\n--------\n>>> import Orange\n>>> data = Orange.data.Table('iris')\n>>> learner = Orange.classification.LogisticRegressionLearner()\n>>> results = Orange.evaluation.TestOnTrainingData(data, [learner])\n\n\"\"\"\n\nimport math\n\nimport numpy as np\nimport sklearn.metrics as skl_metrics\nfrom sklearn.metrics import confusion_matrix\n\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain\nfrom Orange.misc.wrapper_meta import WrapperMeta\n\n__all__ = [\"CA\", \"Precision\", \"Recall\", \"F1\", \"PrecisionRecallFSupport\", \"AUC\",\n           \"MSE\", \"RMSE\", \"MAE\", \"R2\", \"compute_CD\", \"graph_ranks\", \"LogLoss\"]\n\n\nclass ScoreMetaType(WrapperMeta):\n    \"\"\"\n    Maintain a registry of non-abstract subclasses and assign the default\n    value of `name`.\n\n    The existing meta class Registry cannot be used since a meta class cannot\n    have multiple inherited __new__ methods.\"\"\"\n    def __new__(mcs, name, bases, dict_, **kwargs):\n        cls = WrapperMeta.__new__(mcs, name, bases, dict_)\n        # Essentially `if cls is not Score`, except that Score may not exist yet\n        if hasattr(cls, \"registry\"):\n            if not kwargs.get(\"abstract\"):\n                # Don't use inherited names, look into dict_\n                cls.name = dict_.get(\"name\", name)\n                cls.registry[name] = cls\n        else:\n            cls.registry = {}\n        return cls\n\n    def __init__(cls, *args, **_):\n        WrapperMeta.__init__(cls, *args)\n\n\nclass Score(metaclass=ScoreMetaType):\n    \"\"\"\n    ${sklpar}\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n    \"\"\"\n    __wraps__ = None\n\n    separate_folds = False\n    is_scalar = True\n    is_binary = False  #: If true, compute_score accepts `target` and `average`\n    #: If the class doesn't explicitly contain `abstract=True`, it is not\n    #: abstract; essentially, this attribute is not inherited\n    abstract = True\n    class_types = ()\n    name = None\n    long_name = None  #: A short user-readable name (e.g. a few words)\n\n    def __new__(cls, results=None, **kwargs):\n        self = super().__new__(cls)\n        if results is not None:\n            self.__init__()\n            return self(results, **kwargs)\n        else:\n            return self\n\n    def __call__(self, results, **kwargs):\n        if self.separate_folds and results.score_by_folds and results.folds:\n            scores = self.scores_by_folds(results, **kwargs)\n            return self.average(scores)\n\n        return self.compute_score(results, **kwargs)\n\n    def average(self, scores):\n        if self.is_scalar:\n            return np.mean(scores, axis=0)\n        return NotImplementedError\n\n    def scores_by_folds(self, results, **kwargs):\n        nfolds = len(results.folds)\n        nmodels = len(results.predicted)\n        if self.is_scalar:\n            scores = np.empty((nfolds, nmodels), dtype=np.float64)\n        else:\n            scores = [None] * nfolds\n        for fold in range(nfolds):\n            fold_results = results.get_fold(fold)\n            scores[fold] = self.compute_score(fold_results, **kwargs)\n        return scores\n\n    def compute_score(self, results):\n        wraps = type(self).__wraps__  # self.__wraps__ is invisible\n        if wraps:\n            return self.from_predicted(results, wraps)\n        else:\n            return NotImplementedError\n\n    @staticmethod\n    def from_predicted(results, score_function, **kwargs):\n        return np.fromiter(\n            (score_function(results.actual, predicted, **kwargs)\n             for predicted in results.predicted),\n            dtype=np.float64, count=len(results.predicted))\n\n    @staticmethod\n    def is_compatible(domain: Domain) -> bool:\n        raise NotImplementedError\n\n\nclass ClassificationScore(Score, abstract=True):\n    class_types = (DiscreteVariable, )\n\n    @staticmethod\n    def is_compatible(domain: Domain) -> bool:\n        return domain.has_discrete_class\n\n\nclass RegressionScore(Score, abstract=True):\n    class_types = (ContinuousVariable, )\n\n    @staticmethod\n    def is_compatible(domain: Domain) -> bool:\n        return domain.has_continuous_class\n\n\n# pylint: disable=invalid-name\nclass CA(ClassificationScore):\n    __wraps__ = skl_metrics.accuracy_score\n    long_name = \"Classification accuracy\"\n\n\nclass PrecisionRecallFSupport(ClassificationScore):\n    __wraps__ = skl_metrics.precision_recall_fscore_support\n    is_scalar = False\n\n\nclass TargetScore(ClassificationScore):\n    \"\"\"\n    Base class for scorers that need a target value (a \"positive\" class).\n\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n\n    target : int, optional (default=None)\n        Target class value.\n        When None:\n          - if averaging is specified, use all classes and average results\n          - if average is 'binary' and class variable has exactly 2 values,\n            use the value '1' as the positive class\n\n    average: str, method for averaging (default='binary')\n        Default requires a binary class or target to be set.\n        Options: 'weighted', 'macro', 'micro', None\n\n    \"\"\"\n    is_binary = True\n    abstract = True\n    __wraps__ = None  # Subclasses should set the scoring function\n\n    def compute_score(self, results, target=None, average='binary'):\n        if average == 'binary':\n            if target is None:\n                if len(results.domain.class_var.values) > 2:\n                    raise ValueError(\n                        \"Multiclass data: specify target class or select \"\n                        \"averaging ('weighted', 'macro', 'micro')\")\n                target = 1  # Default: use 1 as \"positive\" class\n            average = None\n        labels = None if target is None else [target]\n        return self.from_predicted(\n            results, type(self).__wraps__, labels=labels, average=average)\n\n\nclass Precision(TargetScore):\n    __wraps__ = skl_metrics.precision_score\n\n\nclass Recall(TargetScore):\n    __wraps__ = skl_metrics.recall_score\n\n\nclass F1(TargetScore):\n    __wraps__ = skl_metrics.f1_score\n\n\nclass AUC(ClassificationScore):\n    \"\"\"\n    ${sklpar}\n\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n\n    target : int, optional (default=None)\n        Value of class to report.\n    \"\"\"\n    __wraps__ = skl_metrics.roc_auc_score\n    separate_folds = True\n    is_binary = True\n    long_name = \"Area under ROC curve\"\n\n    @staticmethod\n    def calculate_weights(results):\n        classes = np.unique(results.actual)\n        class_cases = [sum(results.actual == class_)\n                       for class_ in classes]\n        N = results.actual.shape[0]\n        weights = np.array([c * (N - c) for c in class_cases])\n        wsum = np.sum(weights)\n        if wsum == 0:\n            raise ValueError(\"Class variable has less than two values\")\n        else:\n            return weights / wsum\n\n    @staticmethod\n    def single_class_auc(results, target):\n        y = np.array(results.actual == target, dtype=int)\n        return np.fromiter(\n            (skl_metrics.roc_auc_score(y, probabilities[:, int(target)])\n             for probabilities in results.probabilities),\n            dtype=np.float64, count=len(results.predicted))\n\n    def multi_class_auc(self, results):\n        classes = np.unique(results.actual)\n        weights = self.calculate_weights(results)\n        auc_array = np.array([self.single_class_auc(results, class_)\n                              for class_ in classes])\n        return np.sum(auc_array.T * weights, axis=1)\n\n    def compute_score(self, results, target=None, average=None):\n        domain = results.domain\n        n_classes = len(domain.class_var.values)\n\n        if n_classes < 2:\n            raise ValueError(\"Class variable has less than two values\")\n        elif n_classes == 2:\n            return self.single_class_auc(results, 1)\n        else:\n            if target is None:\n                return self.multi_class_auc(results)\n            else:\n                return self.single_class_auc(results, target)\n\n\nclass LogLoss(ClassificationScore):\n    \"\"\"\n    ${sklpar}\n\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n\n    eps : float\n        Log loss is undefined for p=0 or p=1, so probabilities are\n        clipped to max(eps, min(1 - eps, p)).\n\n    normalize : bool, optional (default=True)\n        If true, return the mean loss per sample.\n        Otherwise, return the sum of the per-sample losses.\n\n    sample_weight : array-like of shape = [n_samples], optional\n        Sample weights.\n\n    Examples\n    --------\n    >>> Orange.evaluation.LogLoss(results)\n    array([ 0.3...])\n\n    \"\"\"\n    __wraps__ = skl_metrics.log_loss\n\n    def compute_score(self, results, eps=1e-15, normalize=True,\n                      sample_weight=None):\n        return np.fromiter(\n            (skl_metrics.log_loss(results.actual,\n                                  probabilities,\n                                  eps=eps,\n                                  normalize=normalize,\n                                  sample_weight=sample_weight)\n             for probabilities in results.probabilities),\n            dtype=np.float64, count=len(results.probabilities))\n\n\nclass Specificity(ClassificationScore):\n    is_binary = True\n\n    @staticmethod\n    def calculate_weights(results):\n        classes, counts = np.unique(results.actual, return_counts=True)\n        n = np.array(results.actual).shape[0]\n        return counts / n, classes\n\n    @staticmethod\n    def specificity(y_true, y_pred):\n        tn, fp, _, _ = confusion_matrix(y_true, y_pred).ravel()\n        return tn / (tn + fp)\n\n    def single_class_specificity(self, results, target):\n        y_true = (np.array(results.actual) == target).astype(int)\n        return np.fromiter(\n            (self.specificity(y_true,\n                              np.array(predicted == target, dtype=int))\n             for predicted in results.predicted),\n            dtype=np.float64, count=len(results.predicted))\n\n    def multi_class_specificity(self, results):\n        weights, classes = self.calculate_weights(results)\n        scores = np.array([self.single_class_specificity(results, class_)\n                           for class_ in classes])\n        return np.sum(scores.T * weights, axis=1)\n\n    def compute_score(self, results, target=None, average=\"binary\"):\n        domain = results.domain\n        n_classes = len(domain.class_var.values)\n\n        if target is None:\n            if average == \"weighted\":\n                return self.multi_class_specificity(results)\n            elif average == \"binary\":  # average is binary\n                if n_classes != 2:\n                    raise ValueError(\n                        \"Binary averaging needs two classes in data: \"\n                        \"specify target class or use \"\n                        \"weighted averaging.\")\n                return self.single_class_specificity(results, 1)\n            else:\n                raise ValueError(\n                    \"Wrong parameters: For averaging select one of the \"\n                    \"following values: ('weighted', 'binary')\")\n        elif target is not None:\n            return self.single_class_specificity(results, target)\n\n# Regression scores\n\n\nclass MSE(RegressionScore):\n    __wraps__ = skl_metrics.mean_squared_error\n    long_name = \"Mean square error\"\n\n\nclass RMSE(RegressionScore):\n    long_name = \"Root mean square error\"\n\n    def compute_score(self, results):\n        return np.sqrt(MSE(results))\n\n\nclass MAE(RegressionScore):\n    __wraps__ = skl_metrics.mean_absolute_error\n    long_name = \"Mean absolute error\"\n\n\n# pylint: disable=invalid-name\nclass R2(RegressionScore):\n    __wraps__ = skl_metrics.r2_score\n    long_name = \"Coefficient of determination\"\n\n\nclass CVRMSE(RegressionScore):\n    long_name = \"Coefficient of variation of the RMSE\"\n\n    def compute_score(self, results):\n        mean = np.nanmean(results.actual)\n        if mean < 1e-10:\n            raise ValueError(\"Mean value is too small\")\n        return RMSE(results) / mean * 100\n\n\n# CD scores and plot\n\ndef compute_CD(avranks, n, alpha=\"0.05\", test=\"nemenyi\"):\n    \"\"\"\n    Returns critical difference for Nemenyi or Bonferroni-Dunn test\n    according to given alpha (either alpha=\"0.05\" or alpha=\"0.1\") for average\n    ranks and number of tested datasets N. Test can be either \"nemenyi\" for\n    for Nemenyi two tailed test or \"bonferroni-dunn\" for Bonferroni-Dunn test.\n    \"\"\"\n    k = len(avranks)\n    d = {(\"nemenyi\", \"0.05\"): [0, 0, 1.959964, 2.343701, 2.569032, 2.727774,\n                               2.849705, 2.94832, 3.030879, 3.101730, 3.163684,\n                               3.218654, 3.268004, 3.312739, 3.353618, 3.39123,\n                               3.426041, 3.458425, 3.488685, 3.517073,\n                               3.543799],\n         (\"nemenyi\", \"0.1\"): [0, 0, 1.644854, 2.052293, 2.291341, 2.459516,\n                              2.588521, 2.692732, 2.779884, 2.854606, 2.919889,\n                              2.977768, 3.029694, 3.076733, 3.119693, 3.159199,\n                              3.195743, 3.229723, 3.261461, 3.291224, 3.319233],\n         (\"bonferroni-dunn\", \"0.05\"): [0, 0, 1.960, 2.241, 2.394, 2.498, 2.576,\n                                       2.638, 2.690, 2.724, 2.773],\n         (\"bonferroni-dunn\", \"0.1\"): [0, 0, 1.645, 1.960, 2.128, 2.241, 2.326,\n                                      2.394, 2.450, 2.498, 2.539]}\n    q = d[(test, alpha)]\n    cd = q[k] * (k * (k + 1) / (6.0 * n)) ** 0.5\n    return cd\n\n\ndef graph_ranks(avranks, names, cd=None, cdmethod=None, lowv=None, highv=None,\n                width=6, textspace=1, reverse=False, filename=None, **kwargs):\n    \"\"\"\n    Draws a CD graph, which is used to display  the differences in methods'\n    performance. See Janez Demsar, Statistical Comparisons of Classifiers over\n    Multiple Data Sets, 7(Jan):1--30, 2006.\n\n    Needs matplotlib to work.\n\n    The image is ploted on `plt` imported using\n    `import matplotlib.pyplot as plt`.\n\n    Args:\n        avranks (list of float): average ranks of methods.\n        names (list of str): names of methods.\n        cd (float): Critical difference used for statistically significance of\n            difference between methods.\n        cdmethod (int, optional): the method that is compared with other methods\n            If omitted, show pairwise comparison of methods\n        lowv (int, optional): the lowest shown rank\n        highv (int, optional): the highest shown rank\n        width (int, optional): default width in inches (default: 6)\n        textspace (int, optional): space on figure sides (in inches) for the\n            method names (default: 1)\n        reverse (bool, optional):  if set to `True`, the lowest rank is on the\n            right (default: `False`)\n        filename (str, optional): output file name (with extension). If not\n            given, the function does not write a file.\n    \"\"\"\n    try:\n        import matplotlib.pyplot as plt\n        from matplotlib.backends.backend_agg import FigureCanvasAgg\n    except ImportError:\n        raise ImportError(\"Function graph_ranks requires matplotlib.\")\n\n    width = float(width)\n    textspace = float(textspace)\n\n    def nth(l, n):\n        \"\"\"\n        Returns only nth elemnt in a list.\n        \"\"\"\n        n = lloc(l, n)\n        return [a[n] for a in l]\n\n    def lloc(l, n):\n        \"\"\"\n        List location in list of list structure.\n        Enable the use of negative locations:\n        -1 is the last element, -2 second last...\n        \"\"\"\n        if n < 0:\n            return len(l[0]) + n\n        else:\n            return n\n\n    def mxrange(lr):\n        \"\"\"\n        Multiple xranges. Can be used to traverse matrices.\n        This function is very slow due to unknown number of\n        parameters.\n\n        >>> mxrange([3,5])\n        [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]\n\n        >>> mxrange([[3,5,1],[9,0,-3]])\n        [(3, 9), (3, 6), (3, 3), (4, 9), (4, 6), (4, 3)]\n\n        \"\"\"\n        if not len(lr):\n            yield ()\n        else:\n            # it can work with single numbers\n            index = lr[0]\n            if isinstance(index, int):\n                index = [index]\n            for a in range(*index):\n                for b in mxrange(lr[1:]):\n                    yield tuple([a] + list(b))\n\n    def print_figure(fig, *args, **kwargs):\n        canvas = FigureCanvasAgg(fig)\n        canvas.print_figure(*args, **kwargs)\n\n    sums = avranks\n\n    tempsort = sorted([(a, i) for i, a in enumerate(sums)], reverse=reverse)\n    ssums = nth(tempsort, 0)\n    sortidx = nth(tempsort, 1)\n    nnames = [names[x] for x in sortidx]\n\n    if lowv is None:\n        lowv = min(1, int(math.floor(min(ssums))))\n    if highv is None:\n        highv = max(len(avranks), int(math.ceil(max(ssums))))\n\n    cline = 0.4\n\n    k = len(sums)\n\n    lines = None\n\n    linesblank = 0\n    scalewidth = width - 2 * textspace\n\n    def rankpos(rank):\n        if not reverse:\n            a = rank - lowv\n        else:\n            a = highv - rank\n        return textspace + scalewidth / (highv - lowv) * a\n\n    distanceh = 0.25\n\n    if cd and cdmethod is None:\n        # get pairs of non significant methods\n\n        def get_lines(sums, hsd):\n            # get all pairs\n            lsums = len(sums)\n            allpairs = [(i, j) for i, j in mxrange([[lsums], [lsums]]) if j > i]\n            # remove not significant\n            notSig = [(i, j) for i, j in allpairs\n                      if abs(sums[i] - sums[j]) <= hsd]\n            # keep only longest\n\n            def no_longer(ij_tuple, notSig):\n                i, j = ij_tuple\n                for i1, j1 in notSig:\n                    if (i1 <= i and j1 > j) or (i1 < i and j1 >= j):\n                        return False\n                return True\n\n            longest = [(i, j) for i, j in notSig if no_longer((i, j), notSig)]\n\n            return longest\n\n        lines = get_lines(ssums, cd)\n        linesblank = 0.2 + 0.2 + (len(lines) - 1) * 0.1\n\n        # add scale\n        distanceh = 0.25\n        cline += distanceh\n\n    # calculate height needed height of an image\n    minnotsignificant = max(2 * 0.2, linesblank)\n    height = cline + ((k + 1) / 2) * 0.2 + minnotsignificant\n\n    fig = plt.figure(figsize=(width, height))\n    fig.set_facecolor('white')\n    ax = fig.add_axes([0, 0, 1, 1])  # reverse y axis\n    ax.set_axis_off()\n\n    hf = 1. / height  # height factor\n    wf = 1. / width\n\n    def hfl(l):\n        return [a * hf for a in l]\n\n    def wfl(l):\n        return [a * wf for a in l]\n\n\n    # Upper left corner is (0,0).\n    ax.plot([0, 1], [0, 1], c=\"w\")\n    ax.set_xlim(0, 1)\n    ax.set_ylim(1, 0)\n\n    def line(l, color='k', **kwargs):\n        \"\"\"\n        Input is a list of pairs of points.\n        \"\"\"\n        ax.plot(wfl(nth(l, 0)), hfl(nth(l, 1)), color=color, **kwargs)\n\n    def text(x, y, s, *args, **kwargs):\n        ax.text(wf * x, hf * y, s, *args, **kwargs)\n\n    line([(textspace, cline), (width - textspace, cline)], linewidth=0.7)\n\n    bigtick = 0.1\n    smalltick = 0.05\n\n    tick = None\n    for a in list(np.arange(lowv, highv, 0.5)) + [highv]:\n        tick = smalltick\n        if a == int(a):\n            tick = bigtick\n        line([(rankpos(a), cline - tick / 2),\n              (rankpos(a), cline)],\n             linewidth=0.7)\n\n    for a in range(lowv, highv + 1):\n        text(rankpos(a), cline - tick / 2 - 0.05, str(a),\n             ha=\"center\", va=\"bottom\")\n\n    k = len(ssums)\n\n    for i in range(math.ceil(k / 2)):\n        chei = cline + minnotsignificant + i * 0.2\n        line([(rankpos(ssums[i]), cline),\n              (rankpos(ssums[i]), chei),\n              (textspace - 0.1, chei)],\n             linewidth=0.7)\n        text(textspace - 0.2, chei, nnames[i], ha=\"right\", va=\"center\")\n\n    for i in range(math.ceil(k / 2), k):\n        chei = cline + minnotsignificant + (k - i - 1) * 0.2\n        line([(rankpos(ssums[i]), cline),\n              (rankpos(ssums[i]), chei),\n              (textspace + scalewidth + 0.1, chei)],\n             linewidth=0.7)\n        text(textspace + scalewidth + 0.2, chei, nnames[i],\n             ha=\"left\", va=\"center\")\n\n    if cd and cdmethod is None:\n        # upper scale\n        if not reverse:\n            begin, end = rankpos(lowv), rankpos(lowv + cd)\n        else:\n            begin, end = rankpos(highv), rankpos(highv - cd)\n\n        line([(begin, distanceh), (end, distanceh)], linewidth=0.7)\n        line([(begin, distanceh + bigtick / 2),\n              (begin, distanceh - bigtick / 2)],\n             linewidth=0.7)\n        line([(end, distanceh + bigtick / 2),\n              (end, distanceh - bigtick / 2)],\n             linewidth=0.7)\n        text((begin + end) / 2, distanceh - 0.05, \"CD\",\n             ha=\"center\", va=\"bottom\")\n\n        # no-significance lines\n        def draw_lines(lines, side=0.05, height=0.1):\n            start = cline + 0.2\n            for l, r in lines:\n                line([(rankpos(ssums[l]) - side, start),\n                      (rankpos(ssums[r]) + side, start)],\n                     linewidth=2.5)\n                start += height\n\n        draw_lines(lines)\n\n    elif cd:\n        begin = rankpos(avranks[cdmethod] - cd)\n        end = rankpos(avranks[cdmethod] + cd)\n        line([(begin, cline), (end, cline)],\n             linewidth=2.5)\n        line([(begin, cline + bigtick / 2),\n              (begin, cline - bigtick / 2)],\n             linewidth=2.5)\n        line([(end, cline + bigtick / 2),\n              (end, cline - bigtick / 2)],\n             linewidth=2.5)\n\n    if filename:\n        print_figure(fig, filename, **kwargs)\n",
            "new_file_content": "\"\"\"\nMethods for scoring prediction results (CA, AUC, ...).\n\nExamples\n--------\n>>> import Orange\n>>> data = Orange.data.Table('iris')\n>>> learner = Orange.classification.LogisticRegressionLearner()\n>>> results = Orange.evaluation.TestOnTrainingData(data, [learner])\n\n\"\"\"\n\nimport math\nimport warnings\n\nimport numpy as np\nimport sklearn.metrics as skl_metrics\nfrom sklearn.metrics import confusion_matrix\n\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain\nfrom Orange.misc.wrapper_meta import WrapperMeta\n\n__all__ = [\"CA\", \"Precision\", \"Recall\", \"F1\", \"PrecisionRecallFSupport\", \"AUC\",\n           \"MSE\", \"RMSE\", \"MAE\", \"R2\", \"compute_CD\", \"graph_ranks\", \"LogLoss\"]\n\nfrom Orange.util import OrangeDeprecationWarning\n\n\nclass ScoreMetaType(WrapperMeta):\n    \"\"\"\n    Maintain a registry of non-abstract subclasses and assign the default\n    value of `name`.\n\n    The existing meta class Registry cannot be used since a meta class cannot\n    have multiple inherited __new__ methods.\"\"\"\n    def __new__(mcs, name, bases, dict_, **kwargs):\n        cls = WrapperMeta.__new__(mcs, name, bases, dict_)\n        # Essentially `if cls is not Score`, except that Score may not exist yet\n        if hasattr(cls, \"registry\"):\n            if not kwargs.get(\"abstract\"):\n                # Don't use inherited names, look into dict_\n                cls.name = dict_.get(\"name\", name)\n                cls.registry[name] = cls\n        else:\n            cls.registry = {}\n        return cls\n\n    def __init__(cls, *args, **_):\n        WrapperMeta.__init__(cls, *args)\n\n\nclass Score(metaclass=ScoreMetaType):\n    \"\"\"\n    ${sklpar}\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n    \"\"\"\n    __wraps__ = None\n\n    separate_folds = False\n    is_scalar = True\n    is_binary = False  #: If true, compute_score accepts `target` and `average`\n    #: If the class doesn't explicitly contain `abstract=True`, it is not\n    #: abstract; essentially, this attribute is not inherited\n    abstract = True\n    class_types = ()\n    name = None\n    long_name = None  #: A short user-readable name (e.g. a few words)\n\n    def __new__(cls, results=None, **kwargs):\n        self = super().__new__(cls)\n        if results is not None:\n            self.__init__()\n            return self(results, **kwargs)\n        else:\n            return self\n\n    def __call__(self, results, **kwargs):\n        if self.separate_folds and results.score_by_folds and results.folds:\n            scores = self.scores_by_folds(results, **kwargs)\n            return self.average(scores)\n\n        return self.compute_score(results, **kwargs)\n\n    def average(self, scores):\n        if self.is_scalar:\n            return np.mean(scores, axis=0)\n        return NotImplementedError\n\n    def scores_by_folds(self, results, **kwargs):\n        nfolds = len(results.folds)\n        nmodels = len(results.predicted)\n        if self.is_scalar:\n            scores = np.empty((nfolds, nmodels), dtype=np.float64)\n        else:\n            scores = [None] * nfolds\n        for fold in range(nfolds):\n            fold_results = results.get_fold(fold)\n            scores[fold] = self.compute_score(fold_results, **kwargs)\n        return scores\n\n    def compute_score(self, results):\n        wraps = type(self).__wraps__  # self.__wraps__ is invisible\n        if wraps:\n            return self.from_predicted(results, wraps)\n        else:\n            return NotImplementedError\n\n    @staticmethod\n    def from_predicted(results, score_function, **kwargs):\n        return np.fromiter(\n            (score_function(results.actual, predicted, **kwargs)\n             for predicted in results.predicted),\n            dtype=np.float64, count=len(results.predicted))\n\n    @staticmethod\n    def is_compatible(domain: Domain) -> bool:\n        raise NotImplementedError\n\n\nclass ClassificationScore(Score, abstract=True):\n    class_types = (DiscreteVariable, )\n\n    @staticmethod\n    def is_compatible(domain: Domain) -> bool:\n        return domain.has_discrete_class\n\n\nclass RegressionScore(Score, abstract=True):\n    class_types = (ContinuousVariable, )\n\n    @staticmethod\n    def is_compatible(domain: Domain) -> bool:\n        return domain.has_continuous_class\n\n\n# pylint: disable=invalid-name\nclass CA(ClassificationScore):\n    __wraps__ = skl_metrics.accuracy_score\n    long_name = \"Classification accuracy\"\n\n\nclass PrecisionRecallFSupport(ClassificationScore):\n    __wraps__ = skl_metrics.precision_recall_fscore_support\n    is_scalar = False\n\n\nclass TargetScore(ClassificationScore):\n    \"\"\"\n    Base class for scorers that need a target value (a \"positive\" class).\n\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n\n    target : int, optional (default=None)\n        Target class value.\n        When None:\n          - if averaging is specified, use all classes and average results\n          - if average is 'binary' and class variable has exactly 2 values,\n            use the value '1' as the positive class\n\n    average: str, method for averaging (default='binary')\n        Default requires a binary class or target to be set.\n        Options: 'weighted', 'macro', 'micro', None\n\n    \"\"\"\n    is_binary = True\n    abstract = True\n    __wraps__ = None  # Subclasses should set the scoring function\n\n    def compute_score(self, results, target=None, average='binary'):\n        if average == 'binary':\n            if target is None:\n                if len(results.domain.class_var.values) > 2:\n                    raise ValueError(\n                        \"Multiclass data: specify target class or select \"\n                        \"averaging ('weighted', 'macro', 'micro')\")\n                target = 1  # Default: use 1 as \"positive\" class\n            average = None\n        labels = None if target is None else [target]\n        return self.from_predicted(\n            results, type(self).__wraps__, labels=labels, average=average)\n\n\nclass Precision(TargetScore):\n    __wraps__ = skl_metrics.precision_score\n\n\nclass Recall(TargetScore):\n    __wraps__ = skl_metrics.recall_score\n\n\nclass F1(TargetScore):\n    __wraps__ = skl_metrics.f1_score\n\n\nclass AUC(ClassificationScore):\n    \"\"\"\n    ${sklpar}\n\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n\n    target : int, optional (default=None)\n        Value of class to report.\n    \"\"\"\n    __wraps__ = skl_metrics.roc_auc_score\n    separate_folds = True\n    is_binary = True\n    long_name = \"Area under ROC curve\"\n\n    @staticmethod\n    def calculate_weights(results):\n        classes = np.unique(results.actual)\n        class_cases = [sum(results.actual == class_)\n                       for class_ in classes]\n        N = results.actual.shape[0]\n        weights = np.array([c * (N - c) for c in class_cases])\n        wsum = np.sum(weights)\n        if wsum == 0:\n            raise ValueError(\"Class variable has less than two values\")\n        else:\n            return weights / wsum\n\n    @staticmethod\n    def single_class_auc(results, target):\n        y = np.array(results.actual == target, dtype=int)\n        return np.fromiter(\n            (skl_metrics.roc_auc_score(y, probabilities[:, int(target)])\n             for probabilities in results.probabilities),\n            dtype=np.float64, count=len(results.predicted))\n\n    def multi_class_auc(self, results):\n        classes = np.unique(results.actual)\n        weights = self.calculate_weights(results)\n        auc_array = np.array([self.single_class_auc(results, class_)\n                              for class_ in classes])\n        return np.sum(auc_array.T * weights, axis=1)\n\n    def compute_score(self, results, target=None, average=None):\n        domain = results.domain\n        n_classes = len(domain.class_var.values)\n\n        if n_classes < 2:\n            raise ValueError(\"Class variable has less than two values\")\n        elif n_classes == 2:\n            return self.single_class_auc(results, 1)\n        else:\n            if target is None:\n                return self.multi_class_auc(results)\n            else:\n                return self.single_class_auc(results, target)\n\n\nclass LogLoss(ClassificationScore):\n    \"\"\"\n    ${sklpar}\n\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n\n    eps : float\n        Log loss is undefined for p=0 or p=1, so probabilities are\n        clipped to max(eps, min(1 - eps, p)).\n\n    normalize : bool, optional (default=True)\n        If true, return the mean loss per sample.\n        Otherwise, return the sum of the per-sample losses.\n\n    sample_weight : array-like of shape = [n_samples], optional\n        Sample weights.\n\n    Examples\n    --------\n    >>> Orange.evaluation.LogLoss(results)\n    array([ 0.3...])\n\n    \"\"\"\n    __wraps__ = skl_metrics.log_loss\n\n    def compute_score(self, results, eps=1e-15, normalize=True,\n                      sample_weight=None):\n        return np.fromiter(\n            (skl_metrics.log_loss(results.actual,\n                                  probabilities,\n                                  eps=eps,\n                                  normalize=normalize,\n                                  sample_weight=sample_weight)\n             for probabilities in results.probabilities),\n            dtype=np.float64, count=len(results.probabilities))\n\n\nclass Specificity(ClassificationScore):\n    is_binary = True\n\n    @staticmethod\n    def calculate_weights(results):\n        classes, counts = np.unique(results.actual, return_counts=True)\n        n = np.array(results.actual).shape[0]\n        return counts / n, classes\n\n    @staticmethod\n    def specificity(y_true, y_pred):\n        tn, fp, _, _ = confusion_matrix(y_true, y_pred).ravel()\n        return tn / (tn + fp)\n\n    def single_class_specificity(self, results, target):\n        y_true = (np.array(results.actual) == target).astype(int)\n        return np.fromiter(\n            (self.specificity(y_true,\n                              np.array(predicted == target, dtype=int))\n             for predicted in results.predicted),\n            dtype=np.float64, count=len(results.predicted))\n\n    def multi_class_specificity(self, results):\n        weights, classes = self.calculate_weights(results)\n        scores = np.array([self.single_class_specificity(results, class_)\n                           for class_ in classes])\n        return np.sum(scores.T * weights, axis=1)\n\n    def compute_score(self, results, target=None, average=\"binary\"):\n        domain = results.domain\n        n_classes = len(domain.class_var.values)\n\n        if target is None:\n            if average == \"weighted\":\n                return self.multi_class_specificity(results)\n            elif average == \"binary\":  # average is binary\n                if n_classes != 2:\n                    raise ValueError(\n                        \"Binary averaging needs two classes in data: \"\n                        \"specify target class or use \"\n                        \"weighted averaging.\")\n                return self.single_class_specificity(results, 1)\n            else:\n                raise ValueError(\n                    \"Wrong parameters: For averaging select one of the \"\n                    \"following values: ('weighted', 'binary')\")\n        elif target is not None:\n            return self.single_class_specificity(results, target)\n\n# Regression scores\n\n\nclass MSE(RegressionScore):\n    __wraps__ = skl_metrics.mean_squared_error\n    long_name = \"Mean square error\"\n\n\nclass RMSE(RegressionScore):\n    long_name = \"Root mean square error\"\n\n    def compute_score(self, results):\n        return np.sqrt(MSE(results))\n\n\nclass MAE(RegressionScore):\n    __wraps__ = skl_metrics.mean_absolute_error\n    long_name = \"Mean absolute error\"\n\n\n# pylint: disable=invalid-name\nclass R2(RegressionScore):\n    __wraps__ = skl_metrics.r2_score\n    long_name = \"Coefficient of determination\"\n\n\nclass CVRMSE(RegressionScore):\n    long_name = \"Coefficient of variation of the RMSE\"\n\n    def compute_score(self, results):\n        mean = np.nanmean(results.actual)\n        if mean < 1e-10:\n            raise ValueError(\"Mean value is too small\")\n        return RMSE(results) / mean * 100\n\n\n# CD scores and plot\n\ndef compute_CD(avranks, n, alpha=\"0.05\", test=\"nemenyi\"):\n    \"\"\"\n    Returns critical difference for Nemenyi or Bonferroni-Dunn test\n    according to given alpha (either alpha=\"0.05\" or alpha=\"0.1\") for average\n    ranks and number of tested datasets N. Test can be either \"nemenyi\" for\n    for Nemenyi two tailed test or \"bonferroni-dunn\" for Bonferroni-Dunn test.\n\n    This function is deprecated and will be removed in Orange 3.34.\n    \"\"\"\n    warnings.warn(\"compute_CD is deprecated and will be removed in Orange 3.34.\",\n                  OrangeDeprecationWarning, stacklevel=2)\n    k = len(avranks)\n    d = {(\"nemenyi\", \"0.05\"): [0, 0, 1.959964, 2.343701, 2.569032, 2.727774,\n                               2.849705, 2.94832, 3.030879, 3.101730, 3.163684,\n                               3.218654, 3.268004, 3.312739, 3.353618, 3.39123,\n                               3.426041, 3.458425, 3.488685, 3.517073,\n                               3.543799],\n         (\"nemenyi\", \"0.1\"): [0, 0, 1.644854, 2.052293, 2.291341, 2.459516,\n                              2.588521, 2.692732, 2.779884, 2.854606, 2.919889,\n                              2.977768, 3.029694, 3.076733, 3.119693, 3.159199,\n                              3.195743, 3.229723, 3.261461, 3.291224, 3.319233],\n         (\"bonferroni-dunn\", \"0.05\"): [0, 0, 1.960, 2.241, 2.394, 2.498, 2.576,\n                                       2.638, 2.690, 2.724, 2.773],\n         (\"bonferroni-dunn\", \"0.1\"): [0, 0, 1.645, 1.960, 2.128, 2.241, 2.326,\n                                      2.394, 2.450, 2.498, 2.539]}\n    q = d[(test, alpha)]\n    cd = q[k] * (k * (k + 1) / (6.0 * n)) ** 0.5\n    return cd\n\n\ndef graph_ranks(avranks, names, cd=None, cdmethod=None, lowv=None, highv=None,\n                width=6, textspace=1, reverse=False, filename=None, **kwargs):\n    \"\"\"\n    Draws a CD graph, which is used to display  the differences in methods'\n    performance. See Janez Demsar, Statistical Comparisons of Classifiers over\n    Multiple Data Sets, 7(Jan):1--30, 2006.\n\n    Needs matplotlib to work.\n\n    The image is ploted on `plt` imported using\n    `import matplotlib.pyplot as plt`.\n\n    This function is deprecated and will be removed in Orange 3.34.\n\n    Args:\n        avranks (list of float): average ranks of methods.\n        names (list of str): names of methods.\n        cd (float): Critical difference used for statistically significance of\n            difference between methods.\n        cdmethod (int, optional): the method that is compared with other methods\n            If omitted, show pairwise comparison of methods\n        lowv (int, optional): the lowest shown rank\n        highv (int, optional): the highest shown rank\n        width (int, optional): default width in inches (default: 6)\n        textspace (int, optional): space on figure sides (in inches) for the\n            method names (default: 1)\n        reverse (bool, optional):  if set to `True`, the lowest rank is on the\n            right (default: `False`)\n        filename (str, optional): output file name (with extension). If not\n            given, the function does not write a file.\n    \"\"\"\n    warnings.warn(\"graph_ranks is deprecated and will be removed in Orange 3.34.\",\n                  OrangeDeprecationWarning, stacklevel=2)\n    try:\n        import matplotlib.pyplot as plt\n        from matplotlib.backends.backend_agg import FigureCanvasAgg\n    except ImportError:\n        raise ImportError(\"Function graph_ranks requires matplotlib.\")\n\n    width = float(width)\n    textspace = float(textspace)\n\n    def nth(l, n):\n        \"\"\"\n        Returns only nth elemnt in a list.\n        \"\"\"\n        n = lloc(l, n)\n        return [a[n] for a in l]\n\n    def lloc(l, n):\n        \"\"\"\n        List location in list of list structure.\n        Enable the use of negative locations:\n        -1 is the last element, -2 second last...\n        \"\"\"\n        if n < 0:\n            return len(l[0]) + n\n        else:\n            return n\n\n    def mxrange(lr):\n        \"\"\"\n        Multiple xranges. Can be used to traverse matrices.\n        This function is very slow due to unknown number of\n        parameters.\n\n        >>> mxrange([3,5])\n        [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]\n\n        >>> mxrange([[3,5,1],[9,0,-3]])\n        [(3, 9), (3, 6), (3, 3), (4, 9), (4, 6), (4, 3)]\n\n        \"\"\"\n        if not len(lr):\n            yield ()\n        else:\n            # it can work with single numbers\n            index = lr[0]\n            if isinstance(index, int):\n                index = [index]\n            for a in range(*index):\n                for b in mxrange(lr[1:]):\n                    yield tuple([a] + list(b))\n\n    def print_figure(fig, *args, **kwargs):\n        canvas = FigureCanvasAgg(fig)\n        canvas.print_figure(*args, **kwargs)\n\n    sums = avranks\n\n    tempsort = sorted([(a, i) for i, a in enumerate(sums)], reverse=reverse)\n    ssums = nth(tempsort, 0)\n    sortidx = nth(tempsort, 1)\n    nnames = [names[x] for x in sortidx]\n\n    if lowv is None:\n        lowv = min(1, int(math.floor(min(ssums))))\n    if highv is None:\n        highv = max(len(avranks), int(math.ceil(max(ssums))))\n\n    cline = 0.4\n\n    k = len(sums)\n\n    lines = None\n\n    linesblank = 0\n    scalewidth = width - 2 * textspace\n\n    def rankpos(rank):\n        if not reverse:\n            a = rank - lowv\n        else:\n            a = highv - rank\n        return textspace + scalewidth / (highv - lowv) * a\n\n    distanceh = 0.25\n\n    if cd and cdmethod is None:\n        # get pairs of non significant methods\n\n        def get_lines(sums, hsd):\n            # get all pairs\n            lsums = len(sums)\n            allpairs = [(i, j) for i, j in mxrange([[lsums], [lsums]]) if j > i]\n            # remove not significant\n            notSig = [(i, j) for i, j in allpairs\n                      if abs(sums[i] - sums[j]) <= hsd]\n            # keep only longest\n\n            def no_longer(ij_tuple, notSig):\n                i, j = ij_tuple\n                for i1, j1 in notSig:\n                    if (i1 <= i and j1 > j) or (i1 < i and j1 >= j):\n                        return False\n                return True\n\n            longest = [(i, j) for i, j in notSig if no_longer((i, j), notSig)]\n\n            return longest\n\n        lines = get_lines(ssums, cd)\n        linesblank = 0.2 + 0.2 + (len(lines) - 1) * 0.1\n\n        # add scale\n        distanceh = 0.25\n        cline += distanceh\n\n    # calculate height needed height of an image\n    minnotsignificant = max(2 * 0.2, linesblank)\n    height = cline + ((k + 1) / 2) * 0.2 + minnotsignificant\n\n    fig = plt.figure(figsize=(width, height))\n    fig.set_facecolor('white')\n    ax = fig.add_axes([0, 0, 1, 1])  # reverse y axis\n    ax.set_axis_off()\n\n    hf = 1. / height  # height factor\n    wf = 1. / width\n\n    def hfl(l):\n        return [a * hf for a in l]\n\n    def wfl(l):\n        return [a * wf for a in l]\n\n\n    # Upper left corner is (0,0).\n    ax.plot([0, 1], [0, 1], c=\"w\")\n    ax.set_xlim(0, 1)\n    ax.set_ylim(1, 0)\n\n    def line(l, color='k', **kwargs):\n        \"\"\"\n        Input is a list of pairs of points.\n        \"\"\"\n        ax.plot(wfl(nth(l, 0)), hfl(nth(l, 1)), color=color, **kwargs)\n\n    def text(x, y, s, *args, **kwargs):\n        ax.text(wf * x, hf * y, s, *args, **kwargs)\n\n    line([(textspace, cline), (width - textspace, cline)], linewidth=0.7)\n\n    bigtick = 0.1\n    smalltick = 0.05\n\n    tick = None\n    for a in list(np.arange(lowv, highv, 0.5)) + [highv]:\n        tick = smalltick\n        if a == int(a):\n            tick = bigtick\n        line([(rankpos(a), cline - tick / 2),\n              (rankpos(a), cline)],\n             linewidth=0.7)\n\n    for a in range(lowv, highv + 1):\n        text(rankpos(a), cline - tick / 2 - 0.05, str(a),\n             ha=\"center\", va=\"bottom\")\n\n    k = len(ssums)\n\n    for i in range(math.ceil(k / 2)):\n        chei = cline + minnotsignificant + i * 0.2\n        line([(rankpos(ssums[i]), cline),\n              (rankpos(ssums[i]), chei),\n              (textspace - 0.1, chei)],\n             linewidth=0.7)\n        text(textspace - 0.2, chei, nnames[i], ha=\"right\", va=\"center\")\n\n    for i in range(math.ceil(k / 2), k):\n        chei = cline + minnotsignificant + (k - i - 1) * 0.2\n        line([(rankpos(ssums[i]), cline),\n              (rankpos(ssums[i]), chei),\n              (textspace + scalewidth + 0.1, chei)],\n             linewidth=0.7)\n        text(textspace + scalewidth + 0.2, chei, nnames[i],\n             ha=\"left\", va=\"center\")\n\n    if cd and cdmethod is None:\n        # upper scale\n        if not reverse:\n            begin, end = rankpos(lowv), rankpos(lowv + cd)\n        else:\n            begin, end = rankpos(highv), rankpos(highv - cd)\n\n        line([(begin, distanceh), (end, distanceh)], linewidth=0.7)\n        line([(begin, distanceh + bigtick / 2),\n              (begin, distanceh - bigtick / 2)],\n             linewidth=0.7)\n        line([(end, distanceh + bigtick / 2),\n              (end, distanceh - bigtick / 2)],\n             linewidth=0.7)\n        text((begin + end) / 2, distanceh - 0.05, \"CD\",\n             ha=\"center\", va=\"bottom\")\n\n        # no-significance lines\n        def draw_lines(lines, side=0.05, height=0.1):\n            start = cline + 0.2\n            for l, r in lines:\n                line([(rankpos(ssums[l]) - side, start),\n                      (rankpos(ssums[r]) + side, start)],\n                     linewidth=2.5)\n                start += height\n\n        draw_lines(lines)\n\n    elif cd:\n        begin = rankpos(avranks[cdmethod] - cd)\n        end = rankpos(avranks[cdmethod] + cd)\n        line([(begin, cline), (end, cline)],\n             linewidth=2.5)\n        line([(begin, cline + bigtick / 2),\n              (begin, cline - bigtick / 2)],\n             linewidth=2.5)\n        line([(end, cline + bigtick / 2),\n              (end, cline - bigtick / 2)],\n             linewidth=2.5)\n\n    if filename:\n        print_figure(fig, filename, **kwargs)\n",
            "header": {
                "file": {
                    "path": "Orange/evaluation/scoring.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "6d8aabd9e",
                "new_commit_hash": "89c82a28d",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/evaluation/scoring.py"
            },
            "plus_file": {
                "path": "b/Orange/evaluation/scoring.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 11,
                            "length": 6
                        },
                        "new_range": {
                            "start": 11,
                            "length": 7
                        },
                        "section": "Examples"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "\"\"\"",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "import math",
                                "type": "context"
                            },
                            {
                                "content": "import warnings",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "import numpy as np",
                                "type": "context"
                            },
                            {
                                "content": "import sklearn.metrics as skl_metrics",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/evaluation/scoring.py",
                            "type": "import",
                            "name": "warnings",
                            "content": "import warnings",
                            "ast_type_str": "Import",
                            "start_lineno": 14,
                            "end_lineno": 14,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 22,
                            "length": 6
                        },
                        "new_range": {
                            "start": 23,
                            "length": 8
                        },
                        "section": "from Orange.misc.wrapper_meta import WrapperMeta"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "__all__ = [\"CA\", \"Precision\", \"Recall\", \"F1\", \"PrecisionRecallFSupport\", \"AUC\",",
                                "type": "context"
                            },
                            {
                                "content": "           \"MSE\", \"RMSE\", \"MAE\", \"R2\", \"compute_CD\", \"graph_ranks\", \"LogLoss\"]",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.util import OrangeDeprecationWarning",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "class ScoreMetaType(WrapperMeta):",
                                "type": "context"
                            },
                            {
                                "content": "    \"\"\"",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/evaluation/scoring.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.util import OrangeDeprecationWarning",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 26,
                            "end_lineno": 26,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 388,
                            "length": 7
                        },
                        "new_range": {
                            "start": 391,
                            "length": 11
                        },
                        "section": "def compute_CD(avranks, n, alpha=\"0.05\", test=\"nemenyi\"):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "    according to given alpha (either alpha=\"0.05\" or alpha=\"0.1\") for average",
                                "type": "context"
                            },
                            {
                                "content": "    ranks and number of tested datasets N. Test can be either \"nemenyi\" for",
                                "type": "context"
                            },
                            {
                                "content": "    for Nemenyi two tailed test or \"bonferroni-dunn\" for Bonferroni-Dunn test.",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    This function is deprecated and will be removed in Orange 3.34.",
                                "type": "added"
                            },
                            {
                                "content": "    \"\"\"",
                                "type": "context"
                            },
                            {
                                "content": "    warnings.warn(\"compute_CD is deprecated and will be removed in Orange 3.34.\",",
                                "type": "added"
                            },
                            {
                                "content": "                  OrangeDeprecationWarning, stacklevel=2)",
                                "type": "added"
                            },
                            {
                                "content": "    k = len(avranks)",
                                "type": "context"
                            },
                            {
                                "content": "    d = {(\"nemenyi\", \"0.05\"): [0, 0, 1.959964, 2.343701, 2.569032, 2.727774,",
                                "type": "context"
                            },
                            {
                                "content": "                               2.849705, 2.94832, 3.030879, 3.101730, 3.163684,",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/evaluation/scoring.py",
                            "type": "function",
                            "name": "compute_CD",
                            "content": "def compute_CD(avranks, n, alpha=\"0.05\", test=\"nemenyi\"):\n    \"\"\"\n    Returns critical difference for Nemenyi or Bonferroni-Dunn test\n    according to given alpha (either alpha=\"0.05\" or alpha=\"0.1\") for average\n    ranks and number of tested datasets N. Test can be either \"nemenyi\" for\n    for Nemenyi two tailed test or \"bonferroni-dunn\" for Bonferroni-Dunn test.\n\n    This function is deprecated and will be removed in Orange 3.34.\n    \"\"\"\n    warnings.warn(\"compute_CD is deprecated and will be removed in Orange 3.34.\",\n                  OrangeDeprecationWarning, stacklevel=2)\n    k = len(avranks)\n    d = {(\"nemenyi\", \"0.05\"): [0, 0, 1.959964, 2.343701, 2.569032, 2.727774,\n                               2.849705, 2.94832, 3.030879, 3.101730, 3.163684,\n                               3.218654, 3.268004, 3.312739, 3.353618, 3.39123,\n                               3.426041, 3.458425, 3.488685, 3.517073,\n                               3.543799],\n         (\"nemenyi\", \"0.1\"): [0, 0, 1.644854, 2.052293, 2.291341, 2.459516,\n                              2.588521, 2.692732, 2.779884, 2.854606, 2.919889,\n                              2.977768, 3.029694, 3.076733, 3.119693, 3.159199,\n                              3.195743, 3.229723, 3.261461, 3.291224, 3.319233],\n         (\"bonferroni-dunn\", \"0.05\"): [0, 0, 1.960, 2.241, 2.394, 2.498, 2.576,\n                                       2.638, 2.690, 2.724, 2.773],\n         (\"bonferroni-dunn\", \"0.1\"): [0, 0, 1.645, 1.960, 2.128, 2.241, 2.326,\n                                      2.394, 2.450, 2.498, 2.539]}\n    q = d[(test, alpha)]\n    cd = q[k] * (k * (k + 1) / (6.0 * n)) ** 0.5\n    return cd",
                            "ast_type_str": "FunctionDef",
                            "start_lineno": 388,
                            "end_lineno": 415,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 420,
                            "length": 6
                        },
                        "new_range": {
                            "start": 427,
                            "length": 8
                        },
                        "section": "def graph_ranks(avranks, names, cd=None, cdmethod=None, lowv=None, highv=None,"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "    The image is ploted on `plt` imported using",
                                "type": "context"
                            },
                            {
                                "content": "    `import matplotlib.pyplot as plt`.",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    This function is deprecated and will be removed in Orange 3.34.",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    Args:",
                                "type": "context"
                            },
                            {
                                "content": "        avranks (list of float): average ranks of methods.",
                                "type": "context"
                            },
                            {
                                "content": "        names (list of str): names of methods.",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/evaluation/scoring.py",
                            "type": "function",
                            "name": "graph_ranks",
                            "content": "def graph_ranks(avranks, names, cd=None, cdmethod=None, lowv=None, highv=None,\n                width=6, textspace=1, reverse=False, filename=None, **kwargs):\n    \"\"\"\n    Draws a CD graph, which is used to display  the differences in methods'\n    performance. See Janez Demsar, Statistical Comparisons of Classifiers over\n    Multiple Data Sets, 7(Jan):1--30, 2006.\n\n    Needs matplotlib to work.\n\n    The image is ploted on `plt` imported using\n    `import matplotlib.pyplot as plt`.\n\n    This function is deprecated and will be removed in Orange 3.34.\n\n    Args:\n        avranks (list of float): average ranks of methods.\n        names (list of str): names of methods.\n        cd (float): Critical difference used for statistically significance of\n            difference between methods.\n        cdmethod (int, optional): the method that is compared with other methods\n            If omitted, show pairwise comparison of methods\n        lowv (int, optional): the lowest shown rank\n        highv (int, optional): the highest shown rank\n        width (int, optional): default width in inches (default: 6)\n        textspace (int, optional): space on figure sides (in inches) for the\n            method names (default: 1)\n        reverse (bool, optional):  if set to `True`, the lowest rank is on the\n            right (default: `False`)\n        filename (str, optional): output file name (with extension). If not\n            given, the function does not write a file.\n    \"\"\"\n    warnings.warn(\"graph_ranks is deprecated and will be removed in Orange 3.34.\",\n                  OrangeDeprecationWarning, stacklevel=2)\n    try:\n        import matplotlib.pyplot as plt\n        from matplotlib.backends.backend_agg import FigureCanvasAgg\n    except ImportError:\n        raise ImportError(\"Function graph_ranks requires matplotlib.\")\n\n    width = float(width)\n    textspace = float(textspace)\n\n    def nth(l, n):\n        \"\"\"\n        Returns only nth elemnt in a list.\n        \"\"\"\n        n = lloc(l, n)\n        return [a[n] for a in l]\n\n    def lloc(l, n):\n        \"\"\"\n        List location in list of list structure.\n        Enable the use of negative locations:\n        -1 is the last element, -2 second last...\n        \"\"\"\n        if n < 0:\n            return len(l[0]) + n\n        else:\n            return n\n\n    def mxrange(lr):\n        \"\"\"\n        Multiple xranges. Can be used to traverse matrices.\n        This function is very slow due to unknown number of\n        parameters.\n\n        >>> mxrange([3,5])\n        [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]\n\n        >>> mxrange([[3,5,1],[9,0,-3]])\n        [(3, 9), (3, 6), (3, 3), (4, 9), (4, 6), (4, 3)]\n\n        \"\"\"\n        if not len(lr):\n            yield ()\n        else:\n            # it can work with single numbers\n            index = lr[0]\n            if isinstance(index, int):\n                index = [index]\n            for a in range(*index):\n                for b in mxrange(lr[1:]):\n                    yield tuple([a] + list(b))\n\n    def print_figure(fig, *args, **kwargs):\n        canvas = FigureCanvasAgg(fig)\n        canvas.print_figure(*args, **kwargs)\n\n    sums = avranks\n\n    tempsort = sorted([(a, i) for i, a in enumerate(sums)], reverse=reverse)\n    ssums = nth(tempsort, 0)\n    sortidx = nth(tempsort, 1)\n    nnames = [names[x] for x in sortidx]\n\n    if lowv is None:\n        lowv = min(1, int(math.floor(min(ssums))))\n    if highv is None:\n        highv = max(len(avranks), int(math.ceil(max(ssums))))\n\n    cline = 0.4\n\n    k = len(sums)\n\n    lines = None\n\n    linesblank = 0\n    scalewidth = width - 2 * textspace\n\n    def rankpos(rank):\n        if not reverse:\n            a = rank - lowv\n        else:\n            a = highv - rank\n        return textspace + scalewidth / (highv - lowv) * a\n\n    distanceh = 0.25\n\n    if cd and cdmethod is None:\n        # get pairs of non significant methods\n\n        def get_lines(sums, hsd):\n            # get all pairs\n            lsums = len(sums)\n            allpairs = [(i, j) for i, j in mxrange([[lsums], [lsums]]) if j > i]\n            # remove not significant\n            notSig = [(i, j) for i, j in allpairs\n                      if abs(sums[i] - sums[j]) <= hsd]\n            # keep only longest\n\n            def no_longer(ij_tuple, notSig):\n                i, j = ij_tuple\n                for i1, j1 in notSig:\n                    if (i1 <= i and j1 > j) or (i1 < i and j1 >= j):\n                        return False\n                return True\n\n            longest = [(i, j) for i, j in notSig if no_longer((i, j), notSig)]\n\n            return longest\n\n        lines = get_lines(ssums, cd)\n        linesblank = 0.2 + 0.2 + (len(lines) - 1) * 0.1\n\n        # add scale\n        distanceh = 0.25\n        cline += distanceh\n\n    # calculate height needed height of an image\n    minnotsignificant = max(2 * 0.2, linesblank)\n    height = cline + ((k + 1) / 2) * 0.2 + minnotsignificant\n\n    fig = plt.figure(figsize=(width, height))\n    fig.set_facecolor('white')\n    ax = fig.add_axes([0, 0, 1, 1])  # reverse y axis\n    ax.set_axis_off()\n\n    hf = 1. / height  # height factor\n    wf = 1. / width\n\n    def hfl(l):\n        return [a * hf for a in l]\n\n    def wfl(l):\n        return [a * wf for a in l]\n\n\n    # Upper left corner is (0,0).\n    ax.plot([0, 1], [0, 1], c=\"w\")\n    ax.set_xlim(0, 1)\n    ax.set_ylim(1, 0)\n\n    def line(l, color='k', **kwargs):\n        \"\"\"\n        Input is a list of pairs of points.\n        \"\"\"\n        ax.plot(wfl(nth(l, 0)), hfl(nth(l, 1)), color=color, **kwargs)\n\n    def text(x, y, s, *args, **kwargs):\n        ax.text(wf * x, hf * y, s, *args, **kwargs)\n\n    line([(textspace, cline), (width - textspace, cline)], linewidth=0.7)\n\n    bigtick = 0.1\n    smalltick = 0.05\n\n    tick = None\n    for a in list(np.arange(lowv, highv, 0.5)) + [highv]:\n        tick = smalltick\n        if a == int(a):\n            tick = bigtick\n        line([(rankpos(a), cline - tick / 2),\n              (rankpos(a), cline)],\n             linewidth=0.7)\n\n    for a in range(lowv, highv + 1):\n        text(rankpos(a), cline - tick / 2 - 0.05, str(a),\n             ha=\"center\", va=\"bottom\")\n\n    k = len(ssums)\n\n    for i in range(math.ceil(k / 2)):\n        chei = cline + minnotsignificant + i * 0.2\n        line([(rankpos(ssums[i]), cline),\n              (rankpos(ssums[i]), chei),\n              (textspace - 0.1, chei)],\n             linewidth=0.7)\n        text(textspace - 0.2, chei, nnames[i], ha=\"right\", va=\"center\")\n\n    for i in range(math.ceil(k / 2), k):\n        chei = cline + minnotsignificant + (k - i - 1) * 0.2\n        line([(rankpos(ssums[i]), cline),\n              (rankpos(ssums[i]), chei),\n              (textspace + scalewidth + 0.1, chei)],\n             linewidth=0.7)\n        text(textspace + scalewidth + 0.2, chei, nnames[i],\n             ha=\"left\", va=\"center\")\n\n    if cd and cdmethod is None:\n        # upper scale\n        if not reverse:\n            begin, end = rankpos(lowv), rankpos(lowv + cd)\n        else:\n            begin, end = rankpos(highv), rankpos(highv - cd)\n\n        line([(begin, distanceh), (end, distanceh)], linewidth=0.7)\n        line([(begin, distanceh + bigtick / 2),\n              (begin, distanceh - bigtick / 2)],\n             linewidth=0.7)\n        line([(end, distanceh + bigtick / 2),\n              (end, distanceh - bigtick / 2)],\n             linewidth=0.7)\n        text((begin + end) / 2, distanceh - 0.05, \"CD\",\n             ha=\"center\", va=\"bottom\")\n\n        # no-significance lines\n        def draw_lines(lines, side=0.05, height=0.1):\n            start = cline + 0.2\n            for l, r in lines:\n                line([(rankpos(ssums[l]) - side, start),\n                      (rankpos(ssums[r]) + side, start)],\n                     linewidth=2.5)\n                start += height\n\n        draw_lines(lines)\n\n    elif cd:\n        begin = rankpos(avranks[cdmethod] - cd)\n        end = rankpos(avranks[cdmethod] + cd)\n        line([(begin, cline), (end, cline)],\n             linewidth=2.5)\n        line([(begin, cline + bigtick / 2),\n              (begin, cline - bigtick / 2)],\n             linewidth=2.5)\n        line([(end, cline + bigtick / 2),\n              (end, cline - bigtick / 2)],\n             linewidth=2.5)\n\n    if filename:\n        print_figure(fig, filename, **kwargs)",
                            "ast_type_str": "FunctionDef",
                            "start_lineno": 418,
                            "end_lineno": 677,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 437,
                            "length": 6
                        },
                        "new_range": {
                            "start": 446,
                            "length": 8
                        },
                        "section": "def graph_ranks(avranks, names, cd=None, cdmethod=None, lowv=None, highv=None,"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        filename (str, optional): output file name (with extension). If not",
                                "type": "context"
                            },
                            {
                                "content": "            given, the function does not write a file.",
                                "type": "context"
                            },
                            {
                                "content": "    \"\"\"",
                                "type": "context"
                            },
                            {
                                "content": "    warnings.warn(\"graph_ranks is deprecated and will be removed in Orange 3.34.\",",
                                "type": "added"
                            },
                            {
                                "content": "                  OrangeDeprecationWarning, stacklevel=2)",
                                "type": "added"
                            },
                            {
                                "content": "    try:",
                                "type": "context"
                            },
                            {
                                "content": "        import matplotlib.pyplot as plt",
                                "type": "context"
                            },
                            {
                                "content": "        from matplotlib.backends.backend_agg import FigureCanvasAgg",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/evaluation/scoring.py",
                            "type": "function",
                            "name": "graph_ranks",
                            "content": "def graph_ranks(avranks, names, cd=None, cdmethod=None, lowv=None, highv=None,\n                width=6, textspace=1, reverse=False, filename=None, **kwargs):\n    \"\"\"\n    Draws a CD graph, which is used to display  the differences in methods'\n    performance. See Janez Demsar, Statistical Comparisons of Classifiers over\n    Multiple Data Sets, 7(Jan):1--30, 2006.\n\n    Needs matplotlib to work.\n\n    The image is ploted on `plt` imported using\n    `import matplotlib.pyplot as plt`.\n\n    This function is deprecated and will be removed in Orange 3.34.\n\n    Args:\n        avranks (list of float): average ranks of methods.\n        names (list of str): names of methods.\n        cd (float): Critical difference used for statistically significance of\n            difference between methods.\n        cdmethod (int, optional): the method that is compared with other methods\n            If omitted, show pairwise comparison of methods\n        lowv (int, optional): the lowest shown rank\n        highv (int, optional): the highest shown rank\n        width (int, optional): default width in inches (default: 6)\n        textspace (int, optional): space on figure sides (in inches) for the\n            method names (default: 1)\n        reverse (bool, optional):  if set to `True`, the lowest rank is on the\n            right (default: `False`)\n        filename (str, optional): output file name (with extension). If not\n            given, the function does not write a file.\n    \"\"\"\n    warnings.warn(\"graph_ranks is deprecated and will be removed in Orange 3.34.\",\n                  OrangeDeprecationWarning, stacklevel=2)\n    try:\n        import matplotlib.pyplot as plt\n        from matplotlib.backends.backend_agg import FigureCanvasAgg\n    except ImportError:\n        raise ImportError(\"Function graph_ranks requires matplotlib.\")\n\n    width = float(width)\n    textspace = float(textspace)\n\n    def nth(l, n):\n        \"\"\"\n        Returns only nth elemnt in a list.\n        \"\"\"\n        n = lloc(l, n)\n        return [a[n] for a in l]\n\n    def lloc(l, n):\n        \"\"\"\n        List location in list of list structure.\n        Enable the use of negative locations:\n        -1 is the last element, -2 second last...\n        \"\"\"\n        if n < 0:\n            return len(l[0]) + n\n        else:\n            return n\n\n    def mxrange(lr):\n        \"\"\"\n        Multiple xranges. Can be used to traverse matrices.\n        This function is very slow due to unknown number of\n        parameters.\n\n        >>> mxrange([3,5])\n        [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]\n\n        >>> mxrange([[3,5,1],[9,0,-3]])\n        [(3, 9), (3, 6), (3, 3), (4, 9), (4, 6), (4, 3)]\n\n        \"\"\"\n        if not len(lr):\n            yield ()\n        else:\n            # it can work with single numbers\n            index = lr[0]\n            if isinstance(index, int):\n                index = [index]\n            for a in range(*index):\n                for b in mxrange(lr[1:]):\n                    yield tuple([a] + list(b))\n\n    def print_figure(fig, *args, **kwargs):\n        canvas = FigureCanvasAgg(fig)\n        canvas.print_figure(*args, **kwargs)\n\n    sums = avranks\n\n    tempsort = sorted([(a, i) for i, a in enumerate(sums)], reverse=reverse)\n    ssums = nth(tempsort, 0)\n    sortidx = nth(tempsort, 1)\n    nnames = [names[x] for x in sortidx]\n\n    if lowv is None:\n        lowv = min(1, int(math.floor(min(ssums))))\n    if highv is None:\n        highv = max(len(avranks), int(math.ceil(max(ssums))))\n\n    cline = 0.4\n\n    k = len(sums)\n\n    lines = None\n\n    linesblank = 0\n    scalewidth = width - 2 * textspace\n\n    def rankpos(rank):\n        if not reverse:\n            a = rank - lowv\n        else:\n            a = highv - rank\n        return textspace + scalewidth / (highv - lowv) * a\n\n    distanceh = 0.25\n\n    if cd and cdmethod is None:\n        # get pairs of non significant methods\n\n        def get_lines(sums, hsd):\n            # get all pairs\n            lsums = len(sums)\n            allpairs = [(i, j) for i, j in mxrange([[lsums], [lsums]]) if j > i]\n            # remove not significant\n            notSig = [(i, j) for i, j in allpairs\n                      if abs(sums[i] - sums[j]) <= hsd]\n            # keep only longest\n\n            def no_longer(ij_tuple, notSig):\n                i, j = ij_tuple\n                for i1, j1 in notSig:\n                    if (i1 <= i and j1 > j) or (i1 < i and j1 >= j):\n                        return False\n                return True\n\n            longest = [(i, j) for i, j in notSig if no_longer((i, j), notSig)]\n\n            return longest\n\n        lines = get_lines(ssums, cd)\n        linesblank = 0.2 + 0.2 + (len(lines) - 1) * 0.1\n\n        # add scale\n        distanceh = 0.25\n        cline += distanceh\n\n    # calculate height needed height of an image\n    minnotsignificant = max(2 * 0.2, linesblank)\n    height = cline + ((k + 1) / 2) * 0.2 + minnotsignificant\n\n    fig = plt.figure(figsize=(width, height))\n    fig.set_facecolor('white')\n    ax = fig.add_axes([0, 0, 1, 1])  # reverse y axis\n    ax.set_axis_off()\n\n    hf = 1. / height  # height factor\n    wf = 1. / width\n\n    def hfl(l):\n        return [a * hf for a in l]\n\n    def wfl(l):\n        return [a * wf for a in l]\n\n\n    # Upper left corner is (0,0).\n    ax.plot([0, 1], [0, 1], c=\"w\")\n    ax.set_xlim(0, 1)\n    ax.set_ylim(1, 0)\n\n    def line(l, color='k', **kwargs):\n        \"\"\"\n        Input is a list of pairs of points.\n        \"\"\"\n        ax.plot(wfl(nth(l, 0)), hfl(nth(l, 1)), color=color, **kwargs)\n\n    def text(x, y, s, *args, **kwargs):\n        ax.text(wf * x, hf * y, s, *args, **kwargs)\n\n    line([(textspace, cline), (width - textspace, cline)], linewidth=0.7)\n\n    bigtick = 0.1\n    smalltick = 0.05\n\n    tick = None\n    for a in list(np.arange(lowv, highv, 0.5)) + [highv]:\n        tick = smalltick\n        if a == int(a):\n            tick = bigtick\n        line([(rankpos(a), cline - tick / 2),\n              (rankpos(a), cline)],\n             linewidth=0.7)\n\n    for a in range(lowv, highv + 1):\n        text(rankpos(a), cline - tick / 2 - 0.05, str(a),\n             ha=\"center\", va=\"bottom\")\n\n    k = len(ssums)\n\n    for i in range(math.ceil(k / 2)):\n        chei = cline + minnotsignificant + i * 0.2\n        line([(rankpos(ssums[i]), cline),\n              (rankpos(ssums[i]), chei),\n              (textspace - 0.1, chei)],\n             linewidth=0.7)\n        text(textspace - 0.2, chei, nnames[i], ha=\"right\", va=\"center\")\n\n    for i in range(math.ceil(k / 2), k):\n        chei = cline + minnotsignificant + (k - i - 1) * 0.2\n        line([(rankpos(ssums[i]), cline),\n              (rankpos(ssums[i]), chei),\n              (textspace + scalewidth + 0.1, chei)],\n             linewidth=0.7)\n        text(textspace + scalewidth + 0.2, chei, nnames[i],\n             ha=\"left\", va=\"center\")\n\n    if cd and cdmethod is None:\n        # upper scale\n        if not reverse:\n            begin, end = rankpos(lowv), rankpos(lowv + cd)\n        else:\n            begin, end = rankpos(highv), rankpos(highv - cd)\n\n        line([(begin, distanceh), (end, distanceh)], linewidth=0.7)\n        line([(begin, distanceh + bigtick / 2),\n              (begin, distanceh - bigtick / 2)],\n             linewidth=0.7)\n        line([(end, distanceh + bigtick / 2),\n              (end, distanceh - bigtick / 2)],\n             linewidth=0.7)\n        text((begin + end) / 2, distanceh - 0.05, \"CD\",\n             ha=\"center\", va=\"bottom\")\n\n        # no-significance lines\n        def draw_lines(lines, side=0.05, height=0.1):\n            start = cline + 0.2\n            for l, r in lines:\n                line([(rankpos(ssums[l]) - side, start),\n                      (rankpos(ssums[r]) + side, start)],\n                     linewidth=2.5)\n                start += height\n\n        draw_lines(lines)\n\n    elif cd:\n        begin = rankpos(avranks[cdmethod] - cd)\n        end = rankpos(avranks[cdmethod] + cd)\n        line([(begin, cline), (end, cline)],\n             linewidth=2.5)\n        line([(begin, cline + bigtick / 2),\n              (begin, cline - bigtick / 2)],\n             linewidth=2.5)\n        line([(end, cline + bigtick / 2),\n              (end, cline - bigtick / 2)],\n             linewidth=2.5)\n\n    if filename:\n        print_figure(fig, filename, **kwargs)",
                            "ast_type_str": "FunctionDef",
                            "start_lineno": 418,
                            "end_lineno": 677,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\n\nimport unittest\nimport numpy as np\n\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain\nfrom Orange.data import Table\nfrom Orange.classification import LogisticRegressionLearner, SklTreeLearner, NaiveBayesLearner,\\\n                                  MajorityLearner\nfrom Orange.evaluation import AUC, CA, Results, Recall, \\\n    Precision, TestOnTrainingData, scoring, LogLoss, F1, CrossValidation\nfrom Orange.evaluation.scoring import Specificity\nfrom Orange.preprocess import discretize, Discretize\nfrom Orange.tests import test_filename\n\n\nclass TestScoreMetaType(unittest.TestCase):\n    class BaseScore(metaclass=scoring.ScoreMetaType):\n        pass\n\n    class Score1(BaseScore, abstract=True):\n        class_types = (DiscreteVariable,)\n\n    class Score2(Score1):\n        pass\n\n    class Score3(Score2):\n        name = \"foo\"\n\n    class Score4(Score2):\n        pass\n\n    class Score5(BaseScore):\n        class_types = (DiscreteVariable, ContinuousVariable)\n\n    def test_registry(self):\n        \"\"\"All non-abstract classes appear in the registry\"\"\"\n        self.assertEqual(\n            self.BaseScore.registry,\n            {\"Score2\": self.Score2, \"Score3\": self.Score3,\n             \"Score4\": self.Score4, \"Score5\": self.Score5})\n\n    def test_names(self):\n        \"\"\"Attribute `name` defaults to class and is not inherited\"\"\"\n        self.assertEqual(self.Score2.name, \"Score2\")\n        self.assertEqual(self.Score3.name, \"foo\")\n        self.assertEqual(self.Score4.name, \"Score4\")\n        self.assertEqual(self.Score5.name, \"Score5\")\n\n\nclass TestPrecision(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = Precision()\n\n    def test_precision_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreater(self.score(res, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=1)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average=None)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=0, average=None)[0], 0.99)\n        self.assertGreater(self.score(res, target=2, average=None)[0], 0.94)\n\n    def test_precision_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.78333, 5)\n\n        for target, prob in ((0, 2 / 3),\n                             (1, 1 / 4),\n                             (2, 1 / 1),\n                             (3, 1 / 1),\n                             (4, 1 / 1)):\n            res = self.score(results, target=target, average=None)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_precision_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 0]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 4 / 6)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 3 / 4)\n        res_target = self.score(results, average='macro')\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], (4 / 6 + 3 / 4) / 2)\n\n\nclass TestRecall(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = Recall()\n\n    def test_recall_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreater(self.score(res, average='weighted')[0], 0.96)\n        self.assertGreater(self.score(res, target=1)[0], 0.9)\n        self.assertGreater(self.score(res, target=1, average=None)[0], 0.9)\n        self.assertGreater(self.score(res, target=1, average='weighted')[0], 0.9)\n        self.assertGreater(self.score(res, target=0, average=None)[0], 0.99)\n        self.assertGreater(self.score(res, target=2, average=None)[0], 0.97)\n\n    def test_recall_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.6)\n\n        for target, prob in ((0, 2 / 2),\n                             (1, 1 / 2),\n                             (2, 1 / 3),\n                             (3, 1 / 1),\n                             (4, 1 / 2)):\n            res = self.score(results, target=target)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_recall_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 0]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 4 / 5)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 3 / 5)\n        res_target = self.score(results, average='macro')\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], (4 / 5 + 3 / 5) / 2)\n\n\nclass TestF1(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = F1()\n\n    def test_recall_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreater(self.score(res, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=1)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average=None)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=0, average=None)[0], 0.99)\n        self.assertGreater(self.score(res, target=2, average=None)[0], 0.95)\n\n    def test_F1_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.61)\n\n        for target, prob in ((0, 4 / 5),\n                             (1, 1 / 3),\n                             (2, 1 / 2),\n                             (3, 1.),\n                             (4, 2 / 3)):\n            res = self.score(results, target=target)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_F1_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 1]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 5 / 6)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 3 / 4)\n\n\nclass TestCA(unittest.TestCase):\n    def test_init(self):\n        res = Results(nmethods=2, nrows=100)\n        res.actual[:50] = 0\n        res.actual[50:] = 1\n        res.predicted = np.vstack((res.actual, res.actual))\n        np.testing.assert_almost_equal(CA(res), [1, 1])\n\n        res.predicted[0][0] = 1\n        np.testing.assert_almost_equal(CA(res), [0.99, 1])\n\n        res.predicted[1] = 1 - res.predicted[1]\n        np.testing.assert_almost_equal(CA(res), [0.99, 0])\n\n    def test_call(self):\n        res = Results(nmethods=2, nrows=100)\n        res.actual[:50] = 0\n        res.actual[50:] = 1\n        res.predicted = np.vstack((res.actual, res.actual))\n        ca = CA()\n        np.testing.assert_almost_equal(ca(res), [1, 1])\n\n        res.predicted[0][0] = 1\n        np.testing.assert_almost_equal(ca(res), [0.99, 1])\n\n        res.predicted[1] = 1 - res.predicted[1]\n        np.testing.assert_almost_equal(ca(res), [0.99, 0])\n\n    def test_bayes(self):\n        x = np.random.randint(2, size=(100, 5))\n        col = np.random.randint(5)\n        y = x[:, col].reshape(100, 1).copy()\n        t = Table.from_numpy(None, x, y)\n        t = Discretize(\n            method=discretize.EqualWidth(n=3))(t)\n        nb = NaiveBayesLearner()\n        res = TestOnTrainingData()(t, [nb])\n        np.testing.assert_almost_equal(CA(res), [1])\n\n        t = Table.from_numpy(None, t.X, t.Y.copy())\n        with t.unlocked():\n            t.Y[-20:] = 1 - t.Y[-20:]\n        res = TestOnTrainingData()(t, [nb])\n        self.assertGreaterEqual(CA(res)[0], 0.75)\n        self.assertLess(CA(res)[0], 1)\n\n\nclass TestAUC(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n\n    def test_tree(self):\n        tree = SklTreeLearner()\n        res = CrossValidation(k=2)(self.iris, [tree])\n        self.assertGreater(AUC(res)[0], 0.8)\n        self.assertLess(AUC(res)[0], 1.)\n\n    def test_constant_prob(self):\n        maj = MajorityLearner()\n        res = TestOnTrainingData()(self.iris, [maj])\n        self.assertEqual(AUC(res)[0], 0.5)\n\n    def test_multiclass_auc_multi_learners(self):\n        learners = [LogisticRegressionLearner(),\n                    MajorityLearner()]\n        res = CrossValidation(k=10)(self.iris, learners)\n        self.assertGreater(AUC(res)[0], 0.6)\n        self.assertLess(AUC(res)[1], 0.6)\n        self.assertGreater(AUC(res)[1], 0.4)\n\n    def test_auc_on_multiclass_data_returns_1d_array(self):\n        titanic = Table('titanic')[:100]\n        lenses = Table(test_filename('datasets/lenses.tab'))[:100]\n        majority = MajorityLearner()\n\n        results = TestOnTrainingData()(lenses, [majority])\n        auc = AUC(results)\n        self.assertEqual(auc.ndim, 1)\n\n        results = TestOnTrainingData()(titanic, [majority])\n        auc = AUC(results)\n        self.assertEqual(auc.ndim, 1)\n\n    def test_auc_scores(self):\n        actual = np.array([0., 0., 0., 1., 1., 1.])\n        for predicted, auc in (([1., 1., 1., 0., 0., 0.], 0.),      # All wrong\n                               ([0., 0., 0., 0., 0., 0.], 0.5),     # All with same probability\n                               ([0., 0., 0., 1., 1., 1.], 1.),      # All correct\n                               ([0., 0., 0., 1., 1., 0.], 5 / 6),   # One wrong\n                               ([1., 1., 0., 1., 1., 1.], 4 / 6),   # Two wrong\n                               ([1., 1., 0., 1., 1., 0.], 3 / 6)):  # Three wrong\n            self.assertAlmostEqual(self.compute_auc(actual, predicted), auc)\n\n    def compute_auc(self, actual, predicted):\n        predicted = np.array(predicted).reshape(1, -1)\n        probabilities = np.zeros((1, predicted.shape[1], 2))\n        probabilities[0, :, 1] = predicted[0]\n        probabilities[0, :, 0] = 1 - predicted[0]\n        results = Results(\n            nmethods=1, domain=Domain([], [DiscreteVariable(\"x\", values='01')]),\n            actual=actual, predicted=predicted)\n        results.probabilities = probabilities\n        return AUC(results)[0]\n\n\nclass TestComputeCD(unittest.TestCase):\n    def test_compute_CD(self):\n        avranks = [1.9, 3.2, 2.8, 3.3]\n        cd = scoring.compute_CD(avranks, 30)\n        np.testing.assert_almost_equal(cd, 0.856344)\n\n        cd = scoring.compute_CD(avranks, 30, test=\"bonferroni-dunn\")\n        np.testing.assert_almost_equal(cd, 0.798)\n\n        # Do what you will, just don't crash\n        scoring.graph_ranks(avranks, \"abcd\", cd)\n        scoring.graph_ranks(avranks, \"abcd\", cd, cdmethod=0)\n\n\nclass TestLogLoss(unittest.TestCase):\n    def test_log_loss(self):\n        data = Table('iris')\n        majority = MajorityLearner()\n        results = TestOnTrainingData()(data, [majority])\n        ll = LogLoss(results)\n        self.assertAlmostEqual(ll[0], - np.log(1 / 3))\n\n    def _log_loss(self, act, prob):\n        ll = np.dot(np.log(prob[:, 0]), act[:, 0]) + \\\n             np.dot(np.log(prob[:, 1]), act[:, 1])\n        return - ll / len(act)\n\n    def test_log_loss_calc(self):\n        data = Table('titanic')\n        learner = LogisticRegressionLearner()\n        results = TestOnTrainingData()(data, [learner])\n\n        actual = np.copy(results.actual)\n        actual = actual.reshape(actual.shape[0], 1)\n        actual = np.hstack((1 - actual, actual))\n        probab = results.probabilities[0]\n\n        ll_calc = self._log_loss(actual, probab)\n        ll_orange = LogLoss(results)\n        self.assertAlmostEqual(ll_calc, ll_orange[0])\n\n\nclass TestSpecificity(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = Specificity()\n\n    def test_specificity_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreaterEqual(\n            self.score(res, average='weighted')[0], (1 + 0.99 + 0.95) / 3\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=1)[0], 99 / (99 + 1)\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=1, average=None)[0],  99 / (99 + 1)\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=1, average='weighted')[0], 99 / (99 + 1)\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=0, average=None)[0], 1\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=2, average=None)[0], 95 / (95 + 5)\n        )\n\n    def test_precision_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.9, 5)\n\n        for target, prob in ((0, 7 / 8),\n                             (1, 5 / 8),\n                             (2, 1),\n                             (3, 1),\n                             (4, 1)):\n            res = self.score(results, target=target, average=None)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_precision_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 0]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 3 / 5)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 4 / 5)\n\n    def test_errors(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n\n        # binary average does not work for number of classes different than 2\n        self.assertRaises(ValueError, self.score, res, average=\"binary\")\n\n        # implemented only weighted and binary averaging\n        self.assertRaises(ValueError, self.score, res, average=\"abc\")\n\n\nif __name__ == '__main__':\n    unittest.main()\n    del TestScoreMetaType\n",
            "new_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\n\nimport unittest\nfrom distutils.version import LooseVersion\n\nimport numpy as np\n\nimport Orange\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain\nfrom Orange.data import Table\nfrom Orange.classification import LogisticRegressionLearner, SklTreeLearner, NaiveBayesLearner,\\\n                                  MajorityLearner\nfrom Orange.evaluation import AUC, CA, Results, Recall, \\\n    Precision, TestOnTrainingData, scoring, LogLoss, F1, CrossValidation\nfrom Orange.evaluation.scoring import Specificity\nfrom Orange.preprocess import discretize, Discretize\nfrom Orange.tests import test_filename\nfrom Orange.util import OrangeDeprecationWarning\n\n\nclass TestScoreMetaType(unittest.TestCase):\n    class BaseScore(metaclass=scoring.ScoreMetaType):\n        pass\n\n    class Score1(BaseScore, abstract=True):\n        class_types = (DiscreteVariable,)\n\n    class Score2(Score1):\n        pass\n\n    class Score3(Score2):\n        name = \"foo\"\n\n    class Score4(Score2):\n        pass\n\n    class Score5(BaseScore):\n        class_types = (DiscreteVariable, ContinuousVariable)\n\n    def test_registry(self):\n        \"\"\"All non-abstract classes appear in the registry\"\"\"\n        self.assertEqual(\n            self.BaseScore.registry,\n            {\"Score2\": self.Score2, \"Score3\": self.Score3,\n             \"Score4\": self.Score4, \"Score5\": self.Score5})\n\n    def test_names(self):\n        \"\"\"Attribute `name` defaults to class and is not inherited\"\"\"\n        self.assertEqual(self.Score2.name, \"Score2\")\n        self.assertEqual(self.Score3.name, \"foo\")\n        self.assertEqual(self.Score4.name, \"Score4\")\n        self.assertEqual(self.Score5.name, \"Score5\")\n\n\nclass TestPrecision(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = Precision()\n\n    def test_precision_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreater(self.score(res, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=1)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average=None)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=0, average=None)[0], 0.99)\n        self.assertGreater(self.score(res, target=2, average=None)[0], 0.94)\n\n    def test_precision_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.78333, 5)\n\n        for target, prob in ((0, 2 / 3),\n                             (1, 1 / 4),\n                             (2, 1 / 1),\n                             (3, 1 / 1),\n                             (4, 1 / 1)):\n            res = self.score(results, target=target, average=None)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_precision_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 0]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 4 / 6)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 3 / 4)\n        res_target = self.score(results, average='macro')\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], (4 / 6 + 3 / 4) / 2)\n\n\nclass TestRecall(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = Recall()\n\n    def test_recall_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreater(self.score(res, average='weighted')[0], 0.96)\n        self.assertGreater(self.score(res, target=1)[0], 0.9)\n        self.assertGreater(self.score(res, target=1, average=None)[0], 0.9)\n        self.assertGreater(self.score(res, target=1, average='weighted')[0], 0.9)\n        self.assertGreater(self.score(res, target=0, average=None)[0], 0.99)\n        self.assertGreater(self.score(res, target=2, average=None)[0], 0.97)\n\n    def test_recall_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.6)\n\n        for target, prob in ((0, 2 / 2),\n                             (1, 1 / 2),\n                             (2, 1 / 3),\n                             (3, 1 / 1),\n                             (4, 1 / 2)):\n            res = self.score(results, target=target)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_recall_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 0]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 4 / 5)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 3 / 5)\n        res_target = self.score(results, average='macro')\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], (4 / 5 + 3 / 5) / 2)\n\n\nclass TestF1(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = F1()\n\n    def test_recall_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreater(self.score(res, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=1)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average=None)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=0, average=None)[0], 0.99)\n        self.assertGreater(self.score(res, target=2, average=None)[0], 0.95)\n\n    def test_F1_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.61)\n\n        for target, prob in ((0, 4 / 5),\n                             (1, 1 / 3),\n                             (2, 1 / 2),\n                             (3, 1.),\n                             (4, 2 / 3)):\n            res = self.score(results, target=target)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_F1_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 1]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 5 / 6)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 3 / 4)\n\n\nclass TestCA(unittest.TestCase):\n    def test_init(self):\n        res = Results(nmethods=2, nrows=100)\n        res.actual[:50] = 0\n        res.actual[50:] = 1\n        res.predicted = np.vstack((res.actual, res.actual))\n        np.testing.assert_almost_equal(CA(res), [1, 1])\n\n        res.predicted[0][0] = 1\n        np.testing.assert_almost_equal(CA(res), [0.99, 1])\n\n        res.predicted[1] = 1 - res.predicted[1]\n        np.testing.assert_almost_equal(CA(res), [0.99, 0])\n\n    def test_call(self):\n        res = Results(nmethods=2, nrows=100)\n        res.actual[:50] = 0\n        res.actual[50:] = 1\n        res.predicted = np.vstack((res.actual, res.actual))\n        ca = CA()\n        np.testing.assert_almost_equal(ca(res), [1, 1])\n\n        res.predicted[0][0] = 1\n        np.testing.assert_almost_equal(ca(res), [0.99, 1])\n\n        res.predicted[1] = 1 - res.predicted[1]\n        np.testing.assert_almost_equal(ca(res), [0.99, 0])\n\n    def test_bayes(self):\n        x = np.random.randint(2, size=(100, 5))\n        col = np.random.randint(5)\n        y = x[:, col].reshape(100, 1).copy()\n        t = Table.from_numpy(None, x, y)\n        t = Discretize(\n            method=discretize.EqualWidth(n=3))(t)\n        nb = NaiveBayesLearner()\n        res = TestOnTrainingData()(t, [nb])\n        np.testing.assert_almost_equal(CA(res), [1])\n\n        t = Table.from_numpy(None, t.X, t.Y.copy())\n        with t.unlocked():\n            t.Y[-20:] = 1 - t.Y[-20:]\n        res = TestOnTrainingData()(t, [nb])\n        self.assertGreaterEqual(CA(res)[0], 0.75)\n        self.assertLess(CA(res)[0], 1)\n\n\nclass TestAUC(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n\n    def test_tree(self):\n        tree = SklTreeLearner()\n        res = CrossValidation(k=2)(self.iris, [tree])\n        self.assertGreater(AUC(res)[0], 0.8)\n        self.assertLess(AUC(res)[0], 1.)\n\n    def test_constant_prob(self):\n        maj = MajorityLearner()\n        res = TestOnTrainingData()(self.iris, [maj])\n        self.assertEqual(AUC(res)[0], 0.5)\n\n    def test_multiclass_auc_multi_learners(self):\n        learners = [LogisticRegressionLearner(),\n                    MajorityLearner()]\n        res = CrossValidation(k=10)(self.iris, learners)\n        self.assertGreater(AUC(res)[0], 0.6)\n        self.assertLess(AUC(res)[1], 0.6)\n        self.assertGreater(AUC(res)[1], 0.4)\n\n    def test_auc_on_multiclass_data_returns_1d_array(self):\n        titanic = Table('titanic')[:100]\n        lenses = Table(test_filename('datasets/lenses.tab'))[:100]\n        majority = MajorityLearner()\n\n        results = TestOnTrainingData()(lenses, [majority])\n        auc = AUC(results)\n        self.assertEqual(auc.ndim, 1)\n\n        results = TestOnTrainingData()(titanic, [majority])\n        auc = AUC(results)\n        self.assertEqual(auc.ndim, 1)\n\n    def test_auc_scores(self):\n        actual = np.array([0., 0., 0., 1., 1., 1.])\n        for predicted, auc in (([1., 1., 1., 0., 0., 0.], 0.),      # All wrong\n                               ([0., 0., 0., 0., 0., 0.], 0.5),     # All with same probability\n                               ([0., 0., 0., 1., 1., 1.], 1.),      # All correct\n                               ([0., 0., 0., 1., 1., 0.], 5 / 6),   # One wrong\n                               ([1., 1., 0., 1., 1., 1.], 4 / 6),   # Two wrong\n                               ([1., 1., 0., 1., 1., 0.], 3 / 6)):  # Three wrong\n            self.assertAlmostEqual(self.compute_auc(actual, predicted), auc)\n\n    def compute_auc(self, actual, predicted):\n        predicted = np.array(predicted).reshape(1, -1)\n        probabilities = np.zeros((1, predicted.shape[1], 2))\n        probabilities[0, :, 1] = predicted[0]\n        probabilities[0, :, 0] = 1 - predicted[0]\n        results = Results(\n            nmethods=1, domain=Domain([], [DiscreteVariable(\"x\", values='01')]),\n            actual=actual, predicted=predicted)\n        results.probabilities = probabilities\n        return AUC(results)[0]\n\n\nclass TestComputeCD(unittest.TestCase):\n    def test_compute_CD(self):\n        avranks = [1.9, 3.2, 2.8, 3.3]\n        with self.assertWarns(OrangeDeprecationWarning):\n            cd = scoring.compute_CD(avranks, 30)\n        np.testing.assert_almost_equal(cd, 0.856344)\n\n        with self.assertWarns(OrangeDeprecationWarning):\n            cd = scoring.compute_CD(avranks, 30, test=\"bonferroni-dunn\")\n        np.testing.assert_almost_equal(cd, 0.798)\n\n    def test_CD_deprecated(self):\n        if LooseVersion(Orange.__version__) >= LooseVersion(\"3.34\"):\n            self.fail(\n                \"`scoring.compute_CD` and `scoring.graph_ranks` were deprecated in \"\n                \"version 3.33. Please remove the deprecated methods, TestComputeCD, \"\n                \"and references in documentation.\"\n            )\n\n\nclass TestLogLoss(unittest.TestCase):\n    def test_log_loss(self):\n        data = Table('iris')\n        majority = MajorityLearner()\n        results = TestOnTrainingData()(data, [majority])\n        ll = LogLoss(results)\n        self.assertAlmostEqual(ll[0], - np.log(1 / 3))\n\n    def _log_loss(self, act, prob):\n        ll = np.dot(np.log(prob[:, 0]), act[:, 0]) + \\\n             np.dot(np.log(prob[:, 1]), act[:, 1])\n        return - ll / len(act)\n\n    def test_log_loss_calc(self):\n        data = Table('titanic')\n        learner = LogisticRegressionLearner()\n        results = TestOnTrainingData()(data, [learner])\n\n        actual = np.copy(results.actual)\n        actual = actual.reshape(actual.shape[0], 1)\n        actual = np.hstack((1 - actual, actual))\n        probab = results.probabilities[0]\n\n        ll_calc = self._log_loss(actual, probab)\n        ll_orange = LogLoss(results)\n        self.assertAlmostEqual(ll_calc, ll_orange[0])\n\n\nclass TestSpecificity(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = Specificity()\n\n    def test_specificity_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreaterEqual(\n            self.score(res, average='weighted')[0], (1 + 0.99 + 0.95) / 3\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=1)[0], 99 / (99 + 1)\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=1, average=None)[0],  99 / (99 + 1)\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=1, average='weighted')[0], 99 / (99 + 1)\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=0, average=None)[0], 1\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=2, average=None)[0], 95 / (95 + 5)\n        )\n\n    def test_precision_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.9, 5)\n\n        for target, prob in ((0, 7 / 8),\n                             (1, 5 / 8),\n                             (2, 1),\n                             (3, 1),\n                             (4, 1)):\n            res = self.score(results, target=target, average=None)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_precision_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 0]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 3 / 5)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 4 / 5)\n\n    def test_errors(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n\n        # binary average does not work for number of classes different than 2\n        self.assertRaises(ValueError, self.score, res, average=\"binary\")\n\n        # implemented only weighted and binary averaging\n        self.assertRaises(ValueError, self.score, res, average=\"abc\")\n\n\nif __name__ == '__main__':\n    unittest.main()\n    del TestScoreMetaType\n",
            "header": {
                "file": {
                    "path": "Orange/tests/test_evaluation_scoring.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "0fe8950c7",
                "new_commit_hash": "95488051b",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/tests/test_evaluation_scoring.py"
            },
            "plus_file": {
                "path": "b/Orange/tests/test_evaluation_scoring.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 2,
                            "length": 8
                        },
                        "new_range": {
                            "start": 2,
                            "length": 11
                        },
                        "section": ""
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "# pylint: disable=missing-docstring",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "import unittest",
                                "type": "context"
                            },
                            {
                                "content": "from distutils.version import LooseVersion",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "import numpy as np",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "import Orange",
                                "type": "added"
                            },
                            {
                                "content": "from Orange.data import DiscreteVariable, ContinuousVariable, Domain",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.data import Table",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.classification import LogisticRegressionLearner, SklTreeLearner, NaiveBayesLearner,\\",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/tests/test_evaluation_scoring.py",
                            "type": "import",
                            "name": "Orange",
                            "content": "import Orange",
                            "ast_type_str": "Import",
                            "start_lineno": 9,
                            "end_lineno": 9,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/tests/test_evaluation_scoring.py",
                            "type": "statement",
                            "name": "",
                            "content": "from distutils.version import LooseVersion",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 5,
                            "end_lineno": 5,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 13,
                            "length": 6
                        },
                        "new_range": {
                            "start": 16,
                            "length": 7
                        },
                        "section": "from Orange.evaluation import AUC, CA, Results, Recall, \\"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "from Orange.evaluation.scoring import Specificity",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.preprocess import discretize, Discretize",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.tests import test_filename",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.util import OrangeDeprecationWarning",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "class TestScoreMetaType(unittest.TestCase):",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/tests/test_evaluation_scoring.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.util import OrangeDeprecationWarning",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 19,
                            "end_lineno": 19,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 320,
                            "length": 15
                        },
                        "new_range": {
                            "start": 324,
                            "length": 21
                        },
                        "section": "class TestAUC(unittest.TestCase):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "class TestComputeCD(unittest.TestCase):",
                                "type": "context"
                            },
                            {
                                "content": "    def test_compute_CD(self):",
                                "type": "context"
                            },
                            {
                                "content": "        avranks = [1.9, 3.2, 2.8, 3.3]",
                                "type": "context"
                            },
                            {
                                "content": "        cd = scoring.compute_CD(avranks, 30)",
                                "type": "deleted"
                            },
                            {
                                "content": "        with self.assertWarns(OrangeDeprecationWarning):",
                                "type": "added"
                            },
                            {
                                "content": "            cd = scoring.compute_CD(avranks, 30)",
                                "type": "added"
                            },
                            {
                                "content": "        np.testing.assert_almost_equal(cd, 0.856344)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        cd = scoring.compute_CD(avranks, 30, test=\"bonferroni-dunn\")",
                                "type": "deleted"
                            },
                            {
                                "content": "        with self.assertWarns(OrangeDeprecationWarning):",
                                "type": "added"
                            },
                            {
                                "content": "            cd = scoring.compute_CD(avranks, 30, test=\"bonferroni-dunn\")",
                                "type": "added"
                            },
                            {
                                "content": "        np.testing.assert_almost_equal(cd, 0.798)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        # Do what you will, just don't crash",
                                "type": "deleted"
                            },
                            {
                                "content": "        scoring.graph_ranks(avranks, \"abcd\", cd)",
                                "type": "deleted"
                            },
                            {
                                "content": "        scoring.graph_ranks(avranks, \"abcd\", cd, cdmethod=0)",
                                "type": "deleted"
                            },
                            {
                                "content": "    def test_CD_deprecated(self):",
                                "type": "added"
                            },
                            {
                                "content": "        if LooseVersion(Orange.__version__) >= LooseVersion(\"3.34\"):",
                                "type": "added"
                            },
                            {
                                "content": "            self.fail(",
                                "type": "added"
                            },
                            {
                                "content": "                \"`scoring.compute_CD` and `scoring.graph_ranks` were deprecated in \"",
                                "type": "added"
                            },
                            {
                                "content": "                \"version 3.33. Please remove the deprecated methods, TestComputeCD, \"",
                                "type": "added"
                            },
                            {
                                "content": "                \"and references in documentation.\"",
                                "type": "added"
                            },
                            {
                                "content": "            )",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "class TestLogLoss(unittest.TestCase):",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/tests/test_evaluation_scoring.py",
                            "type": "method",
                            "name": "TestComputeCD.test_compute_CD",
                            "content": "class TestComputeCD(unittest.TestCase):\n    def test_compute_CD(self):\n        avranks = [1.9, 3.2, 2.8, 3.3]\n        cd = scoring.compute_CD(avranks, 30)\n        np.testing.assert_almost_equal(cd, 0.856344)\n\n        cd = scoring.compute_CD(avranks, 30, test=\"bonferroni-dunn\")\n        np.testing.assert_almost_equal(cd, 0.798)\n\n        # Do what you will, just don't crash\n        scoring.graph_ranks(avranks, \"abcd\", cd)\n        scoring.graph_ranks(avranks, \"abcd\", cd, cdmethod=0)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 321,
                            "end_lineno": 331,
                            "parent": {
                                "file_name": "Orange/tests/test_evaluation_scoring.py",
                                "type": "class",
                                "name": "TestComputeCD",
                                "content": "class TestComputeCD(unittest.TestCase):\n    def test_compute_CD(self):\n        avranks = [1.9, 3.2, 2.8, 3.3]\n        cd = scoring.compute_CD(avranks, 30)\n        np.testing.assert_almost_equal(cd, 0.856344)\n\n        cd = scoring.compute_CD(avranks, 30, test=\"bonferroni-dunn\")\n        np.testing.assert_almost_equal(cd, 0.798)\n\n        # Do what you will, just don't crash\n        scoring.graph_ranks(avranks, \"abcd\", cd)\n        scoring.graph_ranks(avranks, \"abcd\", cd, cdmethod=0)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 320,
                                "end_lineno": 331,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/tests/test_evaluation_scoring.py",
                            "type": "class",
                            "name": "TestComputeCD",
                            "content": "class TestComputeCD(unittest.TestCase):\n    def test_compute_CD(self):\n        avranks = [1.9, 3.2, 2.8, 3.3]\n        cd = scoring.compute_CD(avranks, 30)\n        np.testing.assert_almost_equal(cd, 0.856344)\n\n        cd = scoring.compute_CD(avranks, 30, test=\"bonferroni-dunn\")\n        np.testing.assert_almost_equal(cd, 0.798)\n\n        # Do what you will, just don't crash\n        scoring.graph_ranks(avranks, \"abcd\", cd)\n        scoring.graph_ranks(avranks, \"abcd\", cd, cdmethod=0)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 320,
                            "end_lineno": 331,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/tests/test_evaluation_scoring.py",
                            "type": "method",
                            "name": "TestComputeCD.test_CD_deprecated",
                            "content": "class TestComputeCD(unittest.TestCase):\n    def test_compute_CD(self):\n        avranks = [1.9, 3.2, 2.8, 3.3]\n        with self.assertWarns(OrangeDeprecationWarning):\n            cd = scoring.compute_CD(avranks, 30)\n        np.testing.assert_almost_equal(cd, 0.856344)\n\n        with self.assertWarns(OrangeDeprecationWarning):\n            cd = scoring.compute_CD(avranks, 30, test=\"bonferroni-dunn\")\n        np.testing.assert_almost_equal(cd, 0.798)\n\n    def test_CD_deprecated(self):\n        if LooseVersion(Orange.__version__) >= LooseVersion(\"3.34\"):\n            self.fail(\n                \"`scoring.compute_CD` and `scoring.graph_ranks` were deprecated in \"\n                \"version 3.33. Please remove the deprecated methods, TestComputeCD, \"\n                \"and references in documentation.\"\n            )",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 335,
                            "end_lineno": 341,
                            "parent": {
                                "file_name": "Orange/tests/test_evaluation_scoring.py",
                                "type": "class",
                                "name": "TestComputeCD",
                                "content": "class TestComputeCD(unittest.TestCase):\n    def test_compute_CD(self):\n        avranks = [1.9, 3.2, 2.8, 3.3]\n        with self.assertWarns(OrangeDeprecationWarning):\n            cd = scoring.compute_CD(avranks, 30)\n        np.testing.assert_almost_equal(cd, 0.856344)\n\n        with self.assertWarns(OrangeDeprecationWarning):\n            cd = scoring.compute_CD(avranks, 30, test=\"bonferroni-dunn\")\n        np.testing.assert_almost_equal(cd, 0.798)\n\n    def test_CD_deprecated(self):\n        if LooseVersion(Orange.__version__) >= LooseVersion(\"3.34\"):\n            self.fail(\n                \"`scoring.compute_CD` and `scoring.graph_ranks` were deprecated in \"\n                \"version 3.33. Please remove the deprecated methods, TestComputeCD, \"\n                \"and references in documentation.\"\n            )",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 324,
                                "end_lineno": 341,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f^",
    "new_commit_hash": "9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f",
    "commit_message": "Merge pull request #6062 from markotoplak/remove-cd\n\nDeprecate CD diagrams",
    "commit_date": "2022-08-19T10:49:45+02:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f",
    "test_file_codes": [
        "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\n\nimport unittest\nfrom distutils.version import LooseVersion\n\nimport numpy as np\n\nimport Orange\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain\nfrom Orange.data import Table\nfrom Orange.classification import LogisticRegressionLearner, SklTreeLearner, NaiveBayesLearner,\\\n                                  MajorityLearner\nfrom Orange.evaluation import AUC, CA, Results, Recall, \\\n    Precision, TestOnTrainingData, scoring, LogLoss, F1, CrossValidation\nfrom Orange.evaluation.scoring import Specificity\nfrom Orange.preprocess import discretize, Discretize\nfrom Orange.tests import test_filename\nfrom Orange.util import OrangeDeprecationWarning\n\n\nclass TestScoreMetaType(unittest.TestCase):\n    class BaseScore(metaclass=scoring.ScoreMetaType):\n        pass\n\n    class Score1(BaseScore, abstract=True):\n        class_types = (DiscreteVariable,)\n\n    class Score2(Score1):\n        pass\n\n    class Score3(Score2):\n        name = \"foo\"\n\n    class Score4(Score2):\n        pass\n\n    class Score5(BaseScore):\n        class_types = (DiscreteVariable, ContinuousVariable)\n\n    def test_registry(self):\n        \"\"\"All non-abstract classes appear in the registry\"\"\"\n        self.assertEqual(\n            self.BaseScore.registry,\n            {\"Score2\": self.Score2, \"Score3\": self.Score3,\n             \"Score4\": self.Score4, \"Score5\": self.Score5})\n\n    def test_names(self):\n        \"\"\"Attribute `name` defaults to class and is not inherited\"\"\"\n        self.assertEqual(self.Score2.name, \"Score2\")\n        self.assertEqual(self.Score3.name, \"foo\")\n        self.assertEqual(self.Score4.name, \"Score4\")\n        self.assertEqual(self.Score5.name, \"Score5\")\n\n\nclass TestPrecision(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = Precision()\n\n    def test_precision_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreater(self.score(res, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=1)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average=None)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=0, average=None)[0], 0.99)\n        self.assertGreater(self.score(res, target=2, average=None)[0], 0.94)\n\n    def test_precision_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.78333, 5)\n\n        for target, prob in ((0, 2 / 3),\n                             (1, 1 / 4),\n                             (2, 1 / 1),\n                             (3, 1 / 1),\n                             (4, 1 / 1)):\n            res = self.score(results, target=target, average=None)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_precision_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 0]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 4 / 6)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 3 / 4)\n        res_target = self.score(results, average='macro')\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], (4 / 6 + 3 / 4) / 2)\n\n\nclass TestRecall(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = Recall()\n\n    def test_recall_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreater(self.score(res, average='weighted')[0], 0.96)\n        self.assertGreater(self.score(res, target=1)[0], 0.9)\n        self.assertGreater(self.score(res, target=1, average=None)[0], 0.9)\n        self.assertGreater(self.score(res, target=1, average='weighted')[0], 0.9)\n        self.assertGreater(self.score(res, target=0, average=None)[0], 0.99)\n        self.assertGreater(self.score(res, target=2, average=None)[0], 0.97)\n\n    def test_recall_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.6)\n\n        for target, prob in ((0, 2 / 2),\n                             (1, 1 / 2),\n                             (2, 1 / 3),\n                             (3, 1 / 1),\n                             (4, 1 / 2)):\n            res = self.score(results, target=target)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_recall_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 0]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 4 / 5)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 3 / 5)\n        res_target = self.score(results, average='macro')\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], (4 / 5 + 3 / 5) / 2)\n\n\nclass TestF1(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = F1()\n\n    def test_recall_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreater(self.score(res, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=1)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average=None)[0], 0.95)\n        self.assertGreater(self.score(res, target=1, average='weighted')[0], 0.95)\n        self.assertGreater(self.score(res, target=0, average=None)[0], 0.99)\n        self.assertGreater(self.score(res, target=2, average=None)[0], 0.95)\n\n    def test_F1_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.61)\n\n        for target, prob in ((0, 4 / 5),\n                             (1, 1 / 3),\n                             (2, 1 / 2),\n                             (3, 1.),\n                             (4, 2 / 3)):\n            res = self.score(results, target=target)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_F1_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 1]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 5 / 6)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 3 / 4)\n\n\nclass TestCA(unittest.TestCase):\n    def test_init(self):\n        res = Results(nmethods=2, nrows=100)\n        res.actual[:50] = 0\n        res.actual[50:] = 1\n        res.predicted = np.vstack((res.actual, res.actual))\n        np.testing.assert_almost_equal(CA(res), [1, 1])\n\n        res.predicted[0][0] = 1\n        np.testing.assert_almost_equal(CA(res), [0.99, 1])\n\n        res.predicted[1] = 1 - res.predicted[1]\n        np.testing.assert_almost_equal(CA(res), [0.99, 0])\n\n    def test_call(self):\n        res = Results(nmethods=2, nrows=100)\n        res.actual[:50] = 0\n        res.actual[50:] = 1\n        res.predicted = np.vstack((res.actual, res.actual))\n        ca = CA()\n        np.testing.assert_almost_equal(ca(res), [1, 1])\n\n        res.predicted[0][0] = 1\n        np.testing.assert_almost_equal(ca(res), [0.99, 1])\n\n        res.predicted[1] = 1 - res.predicted[1]\n        np.testing.assert_almost_equal(ca(res), [0.99, 0])\n\n    def test_bayes(self):\n        x = np.random.randint(2, size=(100, 5))\n        col = np.random.randint(5)\n        y = x[:, col].reshape(100, 1).copy()\n        t = Table.from_numpy(None, x, y)\n        t = Discretize(\n            method=discretize.EqualWidth(n=3))(t)\n        nb = NaiveBayesLearner()\n        res = TestOnTrainingData()(t, [nb])\n        np.testing.assert_almost_equal(CA(res), [1])\n\n        t = Table.from_numpy(None, t.X, t.Y.copy())\n        with t.unlocked():\n            t.Y[-20:] = 1 - t.Y[-20:]\n        res = TestOnTrainingData()(t, [nb])\n        self.assertGreaterEqual(CA(res)[0], 0.75)\n        self.assertLess(CA(res)[0], 1)\n\n\nclass TestAUC(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n\n    def test_tree(self):\n        tree = SklTreeLearner()\n        res = CrossValidation(k=2)(self.iris, [tree])\n        self.assertGreater(AUC(res)[0], 0.8)\n        self.assertLess(AUC(res)[0], 1.)\n\n    def test_constant_prob(self):\n        maj = MajorityLearner()\n        res = TestOnTrainingData()(self.iris, [maj])\n        self.assertEqual(AUC(res)[0], 0.5)\n\n    def test_multiclass_auc_multi_learners(self):\n        learners = [LogisticRegressionLearner(),\n                    MajorityLearner()]\n        res = CrossValidation(k=10)(self.iris, learners)\n        self.assertGreater(AUC(res)[0], 0.6)\n        self.assertLess(AUC(res)[1], 0.6)\n        self.assertGreater(AUC(res)[1], 0.4)\n\n    def test_auc_on_multiclass_data_returns_1d_array(self):\n        titanic = Table('titanic')[:100]\n        lenses = Table(test_filename('datasets/lenses.tab'))[:100]\n        majority = MajorityLearner()\n\n        results = TestOnTrainingData()(lenses, [majority])\n        auc = AUC(results)\n        self.assertEqual(auc.ndim, 1)\n\n        results = TestOnTrainingData()(titanic, [majority])\n        auc = AUC(results)\n        self.assertEqual(auc.ndim, 1)\n\n    def test_auc_scores(self):\n        actual = np.array([0., 0., 0., 1., 1., 1.])\n        for predicted, auc in (([1., 1., 1., 0., 0., 0.], 0.),      # All wrong\n                               ([0., 0., 0., 0., 0., 0.], 0.5),     # All with same probability\n                               ([0., 0., 0., 1., 1., 1.], 1.),      # All correct\n                               ([0., 0., 0., 1., 1., 0.], 5 / 6),   # One wrong\n                               ([1., 1., 0., 1., 1., 1.], 4 / 6),   # Two wrong\n                               ([1., 1., 0., 1., 1., 0.], 3 / 6)):  # Three wrong\n            self.assertAlmostEqual(self.compute_auc(actual, predicted), auc)\n\n    def compute_auc(self, actual, predicted):\n        predicted = np.array(predicted).reshape(1, -1)\n        probabilities = np.zeros((1, predicted.shape[1], 2))\n        probabilities[0, :, 1] = predicted[0]\n        probabilities[0, :, 0] = 1 - predicted[0]\n        results = Results(\n            nmethods=1, domain=Domain([], [DiscreteVariable(\"x\", values='01')]),\n            actual=actual, predicted=predicted)\n        results.probabilities = probabilities\n        return AUC(results)[0]\n\n\nclass TestComputeCD(unittest.TestCase):\n    def test_compute_CD(self):\n        avranks = [1.9, 3.2, 2.8, 3.3]\n        with self.assertWarns(OrangeDeprecationWarning):\n            cd = scoring.compute_CD(avranks, 30)\n        np.testing.assert_almost_equal(cd, 0.856344)\n\n        with self.assertWarns(OrangeDeprecationWarning):\n            cd = scoring.compute_CD(avranks, 30, test=\"bonferroni-dunn\")\n        np.testing.assert_almost_equal(cd, 0.798)\n\n    def test_CD_deprecated(self):\n        if LooseVersion(Orange.__version__) >= LooseVersion(\"3.34\"):\n            self.fail(\n                \"`scoring.compute_CD` and `scoring.graph_ranks` were deprecated in \"\n                \"version 3.33. Please remove the deprecated methods, TestComputeCD, \"\n                \"and references in documentation.\"\n            )\n\n\nclass TestLogLoss(unittest.TestCase):\n    def test_log_loss(self):\n        data = Table('iris')\n        majority = MajorityLearner()\n        results = TestOnTrainingData()(data, [majority])\n        ll = LogLoss(results)\n        self.assertAlmostEqual(ll[0], - np.log(1 / 3))\n\n    def _log_loss(self, act, prob):\n        ll = np.dot(np.log(prob[:, 0]), act[:, 0]) + \\\n             np.dot(np.log(prob[:, 1]), act[:, 1])\n        return - ll / len(act)\n\n    def test_log_loss_calc(self):\n        data = Table('titanic')\n        learner = LogisticRegressionLearner()\n        results = TestOnTrainingData()(data, [learner])\n\n        actual = np.copy(results.actual)\n        actual = actual.reshape(actual.shape[0], 1)\n        actual = np.hstack((1 - actual, actual))\n        probab = results.probabilities[0]\n\n        ll_calc = self._log_loss(actual, probab)\n        ll_orange = LogLoss(results)\n        self.assertAlmostEqual(ll_calc, ll_orange[0])\n\n\nclass TestSpecificity(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.iris = Table('iris')\n        cls.score = Specificity()\n\n    def test_specificity_iris(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n        self.assertGreaterEqual(\n            self.score(res, average='weighted')[0], (1 + 0.99 + 0.95) / 3\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=1)[0], 99 / (99 + 1)\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=1, average=None)[0],  99 / (99 + 1)\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=1, average='weighted')[0], 99 / (99 + 1)\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=0, average=None)[0], 1\n        )\n        self.assertGreaterEqual(\n            self.score(res, target=2, average=None)[0], 95 / (95 + 5)\n        )\n\n    def test_precision_multiclass(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01234\")),\n            actual=[0, 4, 4, 1, 2, 0, 1, 2, 3, 2])\n        results.predicted = np.array([[0, 4, 4, 1, 2, 0, 1, 2, 3, 2],\n                                      [0, 1, 4, 1, 1, 0, 0, 2, 3, 1]])\n        res = self.score(results, average='weighted')\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 0.9, 5)\n\n        for target, prob in ((0, 7 / 8),\n                             (1, 5 / 8),\n                             (2, 1),\n                             (3, 1),\n                             (4, 1)):\n            res = self.score(results, target=target, average=None)\n            self.assertEqual(res[0], 1.)\n            self.assertEqual(res[1], prob)\n\n    def test_precision_binary(self):\n        results = Results(\n            domain=Domain([], DiscreteVariable(name=\"y\", values=\"01\")),\n            actual=[0, 1, 1, 1, 0, 0, 1, 0, 0, 1])\n        results.predicted = np.array([[0, 1, 1, 1, 0, 0, 1, 0, 0, 1],\n                                      [0, 1, 1, 1, 0, 0, 1, 1, 1, 0]])\n        res = self.score(results)\n        self.assertEqual(res[0], 1.)\n        self.assertAlmostEqual(res[1], 3 / 5)\n        res_target = self.score(results, target=1)\n        self.assertEqual(res[0], res_target[0])\n        self.assertEqual(res[1], res_target[1])\n        res_target = self.score(results, target=0)\n        self.assertEqual(res_target[0], 1.)\n        self.assertAlmostEqual(res_target[1], 4 / 5)\n\n    def test_errors(self):\n        learner = LogisticRegressionLearner(preprocessors=[])\n        res = TestOnTrainingData()(self.iris, [learner])\n\n        # binary average does not work for number of classes different than 2\n        self.assertRaises(ValueError, self.score, res, average=\"binary\")\n\n        # implemented only weighted and binary averaging\n        self.assertRaises(ValueError, self.score, res, average=\"abc\")\n\n\nif __name__ == '__main__':\n    unittest.main()\n    del TestScoreMetaType\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nrunning build_ext\nCompiling Orange/classification/_tree_scorers.pyx because it changed.\nCompiling Orange/data/_contingency.pyx because it changed.\nCompiling Orange/data/_io.pyx because it changed.\nCompiling Orange/data/_valuecount.pyx because it changed.\nCompiling Orange/data/_variable.pyx because it changed.\nCompiling Orange/distance/_distance.pyx because it changed.\nCompiling Orange/preprocess/_discretize.pyx because it changed.\nCompiling Orange/preprocess/_relieff.pyx because it changed.\nCompiling Orange/projection/_som.pyx because it changed.\n[1/9] Cythonizing Orange/classification/_tree_scorers.pyx\n[2/9] Cythonizing Orange/data/_contingency.pyx\n[3/9] Cythonizing Orange/data/_io.pyx\n[4/9] Cythonizing Orange/data/_valuecount.pyx\n[5/9] Cythonizing Orange/data/_variable.pyx\n[6/9] Cythonizing Orange/distance/_distance.pyx\n[7/9] Cythonizing Orange/preprocess/_discretize.pyx\n[8/9] Cythonizing Orange/preprocess/_relieff.pyx\n[9/9] Cythonizing Orange/projection/_som.pyx\nbuilding 'Orange.classification._tree_scorers' extension\ncreating build\ncreating build/temp.linux-x86_64-3.7\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o\ncreating build/lib.linux-x86_64-3.7\ncreating build/lib.linux-x86_64-3.7/Orange\ncreating build/lib.linux-x86_64-3.7/Orange/classification\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_contingency.c -o build/temp.linux-x86_64-3.7/Orange/data/_contingency.o\ncreating build/lib.linux-x86_64-3.7/Orange/data\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_io.c -o build/temp.linux-x86_64-3.7/Orange/data/_io.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_valuecount.c -o build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_variable.c -o build/temp.linux-x86_64-3.7/Orange/data/_variable.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncreating build/temp.linux-x86_64-3.7/Orange/distance\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/distance/_distance.c -o build/temp.linux-x86_64-3.7/Orange/distance/_distance.o\ncreating build/lib.linux-x86_64-3.7/Orange/distance\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncreating build/temp.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_discretize.c -o build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o\ncreating build/lib.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_relieff.cpp -o build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncreating build/temp.linux-x86_64-3.7/Orange/projection\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/projection/_som.c -o build/temp.linux-x86_64-3.7/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-3.7/Orange/projection\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._simple_tree' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-3.7/Orange/widgets\ncreating build/lib.linux-x86_64-3.7/Orange/widgets/utils\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nrunning develop\nrunning egg_info\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.33.0.dev0+9b2e5b0 to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f\nProcessing dependencies for Orange3==3.33.0.dev0+9b2e5b0\nSearching for XlsxWriter==3.2.0\nBest match: XlsxWriter 3.2.0\nAdding XlsxWriter 3.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for xlrd==2.0.1\nBest match: xlrd 2.0.1\nAdding xlrd 2.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for setuptools==59.8.0\nBest match: setuptools 59.8.0\nAdding setuptools 59.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for serverfiles==0.3.1\nBest match: serverfiles 0.3.1\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for scipy==1.7.3\nBest match: scipy 1.7.3\nAdding scipy 1.7.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for scikit-learn==1.0.2\nBest match: scikit-learn 1.0.2\nAdding scikit-learn 1.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for requests==2.31.0\nBest match: requests 2.31.0\nAdding requests 2.31.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for qtconsole==5.4.4\nBest match: qtconsole 5.4.4\nAdding qtconsole 5.4.4 to easy-install.pth file\nInstalling jupyter-qtconsole script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for PyYAML==6.0.1\nBest match: PyYAML 6.0.1\nAdding PyYAML 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for python-louvain==0.16\nBest match: python-louvain 0.16\nAdding python-louvain 0.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for pyqtgraph==0.12.3\nBest match: pyqtgraph 0.12.3\nAdding pyqtgraph 0.12.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for pygments==2.17.2\nBest match: pygments 2.17.2\nAdding pygments 2.17.2 to easy-install.pth file\nInstalling pygmentize script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for pip==24.0\nBest match: pip 24.0\nAdding pip 24.0 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling pip3.10 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for pandas==1.3.5\nBest match: pandas 1.3.5\nAdding pandas 1.3.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for orange-widget-base==4.22.0\nBest match: orange-widget-base 4.22.0\nAdding orange-widget-base 4.22.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for orange-canvas-core==0.1.35\nBest match: orange-canvas-core 0.1.35\nAdding orange-canvas-core 0.1.35 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for openpyxl==3.1.3\nBest match: openpyxl 3.1.3\nAdding openpyxl 3.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for openTSNE==1.0.1\nBest match: openTSNE 1.0.1\nAdding openTSNE 1.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for numpy==1.17.5\nBest match: numpy 1.17.5\nAdding numpy 1.17.5 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling f2py3.7 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for networkx==2.6.3\nBest match: networkx 2.6.3\nAdding networkx 2.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for matplotlib==3.5.3\nBest match: matplotlib 3.5.3\nAdding matplotlib 3.5.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for keyrings.alt==4.2.0\nBest match: keyrings.alt 4.2.0\nAdding keyrings.alt 4.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for keyring==24.1.1\nBest match: keyring 24.1.1\nAdding keyring 24.1.1 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for joblib==1.3.2\nBest match: joblib 1.3.2\nAdding joblib 1.3.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for httpx==0.24.1\nBest match: httpx 0.24.1\nAdding httpx 0.24.1 to easy-install.pth file\nInstalling httpx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for chardet==5.2.0\nBest match: chardet 5.2.0\nAdding chardet 5.2.0 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for Bottleneck==1.4.0\nBest match: Bottleneck 1.4.0\nAdding Bottleneck 1.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for baycomp==1.0.3\nBest match: baycomp 1.0.3\nAdding baycomp 1.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine==5.15.6\nBest match: PyQtWebEngine 5.15.6\nAdding PyQtWebEngine 5.15.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for PyQt5==5.15.10\nBest match: PyQt5 5.15.10\nAdding PyQt5 5.15.10 to easy-install.pth file\nInstalling pylupdate5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling pyrcc5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling pyuic5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for AnyQt==0.2.0\nBest match: AnyQt 0.2.0\nAdding AnyQt 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for threadpoolctl==3.1.0\nBest match: threadpoolctl 3.1.0\nAdding threadpoolctl 3.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for certifi==2024.12.14\nBest match: certifi 2024.12.14\nAdding certifi 2024.12.14 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for idna==3.10\nBest match: idna 3.10\nAdding idna 3.10 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for charset-normalizer==3.4.1\nBest match: charset-normalizer 3.4.1\nAdding charset-normalizer 3.4.1 to easy-install.pth file\nInstalling normalizer script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for urllib3==2.0.7\nBest match: urllib3 2.0.7\nAdding urllib3 2.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for jupyter-core==4.12.0\nBest match: jupyter-core 4.12.0\nAdding jupyter-core 4.12.0 to easy-install.pth file\nInstalling jupyter script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling jupyter-migrate script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling jupyter-troubleshoot script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for traitlets==5.9.0\nBest match: traitlets 5.9.0\nAdding traitlets 5.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for ipykernel==6.16.2\nBest match: ipykernel 6.16.2\nAdding ipykernel 6.16.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for ipython-genutils==0.2.0\nBest match: ipython-genutils 0.2.0\nAdding ipython-genutils 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for packaging==24.0\nBest match: packaging 24.0\nAdding packaging 24.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for pyzmq==26.2.0\nBest match: pyzmq 26.2.0\nAdding pyzmq 26.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for QtPy==2.4.2\nBest match: QtPy 2.4.2\nAdding QtPy 2.4.2 to easy-install.pth file\nInstalling qtpy script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for jupyter-client==7.4.9\nBest match: jupyter-client 7.4.9\nAdding jupyter-client 7.4.9 to easy-install.pth file\nInstalling jupyter-kernel script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling jupyter-kernelspec script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling jupyter-run script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for python-dateutil==2.9.0.post0\nBest match: python-dateutil 2.9.0.post0\nAdding python-dateutil 2.9.0.post0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for pytz==2024.2\nBest match: pytz 2024.2\nAdding pytz 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for typing-extensions==4.7.1\nBest match: typing-extensions 4.7.1\nAdding typing-extensions 4.7.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for importlib-metadata==6.7.0\nBest match: importlib-metadata 6.7.0\nAdding importlib-metadata 6.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for qasync==0.25.0\nBest match: qasync 0.25.0\nAdding qasync 0.25.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for commonmark==0.9.1\nBest match: commonmark 0.9.1\nAdding commonmark 0.9.1 to easy-install.pth file\nInstalling cmark script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for requests-cache==1.1.1\nBest match: requests-cache 1.1.1\nAdding requests-cache 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for docutils==0.20.1\nBest match: docutils 0.20.1\nAdding docutils 0.20.1 to easy-install.pth file\nInstalling docutils script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for dictdiffer==0.9.0\nBest match: dictdiffer 0.9.0\nAdding dictdiffer 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for et-xmlfile==1.1.0\nBest match: et-xmlfile 1.1.0\nAdding et-xmlfile 1.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for fonttools==4.38.0\nBest match: fonttools 4.38.0\nAdding fonttools 4.38.0 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for kiwisolver==1.4.5\nBest match: kiwisolver 1.4.5\nAdding kiwisolver 1.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for cycler==0.11.0\nBest match: cycler 0.11.0\nAdding cycler 0.11.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for Pillow==9.5.0\nBest match: Pillow 9.5.0\nAdding Pillow 9.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for pyparsing==3.1.4\nBest match: pyparsing 3.1.4\nAdding pyparsing 3.1.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for jaraco.classes==3.2.3\nBest match: jaraco.classes 3.2.3\nAdding jaraco.classes 3.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for jeepney==0.8.0\nBest match: jeepney 0.8.0\nAdding jeepney 0.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for SecretStorage==3.3.3\nBest match: SecretStorage 3.3.3\nAdding SecretStorage 3.3.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for importlib-resources==5.12.0\nBest match: importlib-resources 5.12.0\nAdding importlib-resources 5.12.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for sniffio==1.3.1\nBest match: sniffio 1.3.1\nAdding sniffio 1.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for httpcore==0.17.3\nBest match: httpcore 0.17.3\nAdding httpcore 0.17.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine-Qt5==5.15.16\nBest match: PyQtWebEngine-Qt5 5.15.16\nAdding PyQtWebEngine-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for PyQt5-sip==12.13.0\nBest match: PyQt5-sip 12.13.0\nAdding PyQt5-sip 12.13.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for PyQt5-Qt5==5.15.16\nBest match: PyQt5-Qt5 5.15.16\nAdding PyQt5-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for debugpy==1.7.0\nBest match: debugpy 1.7.0\nAdding debugpy 1.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for ipython==7.34.0\nBest match: ipython 7.34.0\nAdding ipython 7.34.0 to easy-install.pth file\nInstalling iptest script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling iptest3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling ipython script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\nInstalling ipython3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for nest-asyncio==1.6.0\nBest match: nest-asyncio 1.6.0\nAdding nest-asyncio 1.6.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for psutil==6.1.1\nBest match: psutil 6.1.1\nAdding psutil 6.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for matplotlib-inline==0.1.6\nBest match: matplotlib-inline 0.1.6\nAdding matplotlib-inline 0.1.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for tornado==6.2\nBest match: tornado 6.2\nAdding tornado 6.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for entrypoints==0.4\nBest match: entrypoints 0.4\nAdding entrypoints 0.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for six==1.17.0\nBest match: six 1.17.0\nAdding six 1.17.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for zipp==3.15.0\nBest match: zipp 3.15.0\nAdding zipp 3.15.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for platformdirs==4.0.0\nBest match: platformdirs 4.0.0\nAdding platformdirs 4.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for cattrs==23.1.2\nBest match: cattrs 23.1.2\nAdding cattrs 23.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for attrs==24.2.0\nBest match: attrs 24.2.0\nAdding attrs 24.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for url-normalize==1.4.3\nBest match: url-normalize 1.4.3\nAdding url-normalize 1.4.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for more-itertools==9.1.0\nBest match: more-itertools 9.1.0\nAdding more-itertools 9.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for cryptography==44.0.0\nBest match: cryptography 44.0.0\nAdding cryptography 44.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for h11==0.14.0\nBest match: h11 0.14.0\nAdding h11 0.14.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for anyio==3.7.1\nBest match: anyio 3.7.1\nAdding anyio 3.7.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for jedi==0.19.2\nBest match: jedi 0.19.2\nAdding jedi 0.19.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for pickleshare==0.7.5\nBest match: pickleshare 0.7.5\nAdding pickleshare 0.7.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for pexpect==4.9.0\nBest match: pexpect 4.9.0\nAdding pexpect 4.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for prompt-toolkit==3.0.48\nBest match: prompt-toolkit 3.0.48\nAdding prompt-toolkit 3.0.48 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for decorator==5.1.1\nBest match: decorator 5.1.1\nAdding decorator 5.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for backcall==0.2.0\nBest match: backcall 0.2.0\nAdding backcall 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for exceptiongroup==1.2.2\nBest match: exceptiongroup 1.2.2\nAdding exceptiongroup 1.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for cffi==1.15.1\nBest match: cffi 1.15.1\nAdding cffi 1.15.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for parso==0.8.4\nBest match: parso 0.8.4\nAdding parso 0.8.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for ptyprocess==0.7.0\nBest match: ptyprocess 0.7.0\nAdding ptyprocess 0.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for wcwidth==0.2.13\nBest match: wcwidth 0.2.13\nAdding wcwidth 0.2.13 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nSearching for pycparser==2.21\nBest match: pycparser 2.21\nAdding pycparser 2.21 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages\nFinished processing dependencies for Orange3==3.33.0.dev0+9b2e5b0\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.7\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 63ms\nPrepared 18 packages in 19ms\nInstalled 18 packages in 189ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\nResolved 54 packages in 580ms\nInstalled 47 packages in 778ms\n + anyio==3.7.1\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + certifi==2024.12.14\n + cffi==1.15.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + cryptography==44.0.0\n + cycler==0.11.0\n + et-xmlfile==1.1.0\n + fonttools==4.38.0\n + h11==0.14.0\n + httpcore==0.17.3\n + httpx==0.24.1\n + idna==3.10\n + importlib-resources==5.12.0\n + jaraco-classes==3.2.3\n + jeepney==0.8.0\n + joblib==1.3.2\n + keyring==24.1.1\n + keyrings-alt==4.2.0\n + kiwisolver==1.4.5\n + matplotlib==3.5.3\n + more-itertools==9.1.0\n + networkx==2.6.3\n + openpyxl==3.1.3\n + opentsne==1.0.1\n + pandas==1.3.5\n + pillow==9.5.0\n + pip==24.0\n + pycparser==2.21\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.1\n + requests==2.31.0\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + threadpoolctl==3.1.0\n + urllib3==2.0.7\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\nResolved 59 packages in 319ms\nInstalled 38 packages in 407ms\n + anyqt==0.2.0\n + attrs==24.2.0\n + backcall==0.2.0\n + cattrs==23.1.2\n + commonmark==0.9.1\n + debugpy==1.7.0\n + decorator==5.1.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + entrypoints==0.4\n + ipykernel==6.16.2\n + ipython==7.34.0\n + ipython-genutils==0.2.0\n + jedi==0.19.2\n + jupyter-client==7.4.9\n + jupyter-core==4.12.0\n + matplotlib-inline==0.1.6\n + nest-asyncio==1.6.0\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + parso==0.8.4\n + pexpect==4.9.0\n + pickleshare==0.7.5\n + platformdirs==4.0.0\n + prompt-toolkit==3.0.48\n + psutil==6.1.1\n + ptyprocess==0.7.0\n + pygments==2.17.2\n + pyqtgraph==0.12.3\n + pyzmq==26.2.0\n + qasync==0.25.0\n + qtconsole==5.4.4\n + qtpy==2.4.2\n + requests-cache==1.1.1\n + tornado==6.2\n + traitlets==5.9.0\n + url-normalize==1.4.3\n + wcwidth==0.2.13\nResolved 2 packages in 3ms\nInstalled 2 packages in 27ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 19 packages in 56ms\nInstalled 5 packages in 1.26s\n + catboost==1.2.7\n + graphviz==0.20.1\n + plotly==5.18.0\n + tenacity==8.2.3\n + xgboost==1.6.2\nAudited 2 packages in 3ms\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/classification/_tree_scorers.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3427:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3427 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4883:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4883 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5629:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5629 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5750:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5750 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5756:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5756 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7217:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7217 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7874:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7874 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7934:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7934 |               __pyx_t_16 = (((*((__pyx_t_5numpy_int32_t const  *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                                      ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_contingency.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:4120:43: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4120 |           __pyx_v_value = ((__pyx_v_value * __pyx_v_decs) + (__pyx_v_c & 0xf));\n      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/data/_io.c:4318:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4318 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:683:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  683 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1590:7: note: ‘__pyx_v_attr_index’ was declared here\n 1590 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:3183:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3183 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_valuecount.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/distance/_distance.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_discretize.c:774:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_relieff.cpp:790:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/projection/_som.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3863:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3863 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3862:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3862 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:4934:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4934 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4933:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4933 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4732:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4732 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4307:7: note: ‘__pyx_v_win_y’ was declared here\n 4307 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4721:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4721 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4306:7: note: ‘__pyx_v_win_x’ was declared here\n 4306 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5682:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5682 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5681:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5681 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3184:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3184 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2887:7: note: ‘__pyx_v_win_y’ was declared here\n 2887 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3173:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3173 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2886:7: note: ‘__pyx_v_win_x’ was declared here\n 2886 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3357:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3357 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/setuptools/command/easy_install.py:159: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.\n  EasyInstallDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n",
    "new_commit_res_code": 1,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f\nplugins: anyio-3.7.1\ncollected 28 items\n\nr2e_tests/test_1.py E...........................                         [100%]\n\n==================================== ERRORS ====================================\n_______________________ ERROR at setup of test_filename ________________________\nfile /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/Orange/tests/__init__.py, line 68\n  def test_filename(path):\nE       fixture 'path' not found\n>       available fixtures: anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory\n>       use 'pytest --fixtures [testpath]' for help on them.\n\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/Orange/tests/__init__.py:68\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestScoreMetaType::test_names\nPASSED r2e_tests/test_1.py::TestScoreMetaType::test_registry\nPASSED r2e_tests/test_1.py::TestPrecision::test_precision_binary\nPASSED r2e_tests/test_1.py::TestPrecision::test_precision_iris\nPASSED r2e_tests/test_1.py::TestPrecision::test_precision_multiclass\nPASSED r2e_tests/test_1.py::TestRecall::test_recall_binary\nPASSED r2e_tests/test_1.py::TestRecall::test_recall_iris\nPASSED r2e_tests/test_1.py::TestRecall::test_recall_multiclass\nPASSED r2e_tests/test_1.py::TestF1::test_F1_binary\nPASSED r2e_tests/test_1.py::TestF1::test_F1_multiclass\nPASSED r2e_tests/test_1.py::TestF1::test_recall_iris\nPASSED r2e_tests/test_1.py::TestCA::test_bayes\nPASSED r2e_tests/test_1.py::TestCA::test_call\nPASSED r2e_tests/test_1.py::TestCA::test_init\nPASSED r2e_tests/test_1.py::TestAUC::test_auc_on_multiclass_data_returns_1d_array\nPASSED r2e_tests/test_1.py::TestAUC::test_auc_scores\nPASSED r2e_tests/test_1.py::TestAUC::test_constant_prob\nPASSED r2e_tests/test_1.py::TestAUC::test_multiclass_auc_multi_learners\nPASSED r2e_tests/test_1.py::TestAUC::test_tree\nPASSED r2e_tests/test_1.py::TestComputeCD::test_CD_deprecated\nPASSED r2e_tests/test_1.py::TestComputeCD::test_compute_CD\nPASSED r2e_tests/test_1.py::TestLogLoss::test_log_loss\nPASSED r2e_tests/test_1.py::TestLogLoss::test_log_loss_calc\nPASSED r2e_tests/test_1.py::TestSpecificity::test_errors\nPASSED r2e_tests/test_1.py::TestSpecificity::test_precision_binary\nPASSED r2e_tests/test_1.py::TestSpecificity::test_precision_multiclass\nPASSED r2e_tests/test_1.py::TestSpecificity::test_specificity_iris\nERROR r2e_tests/test_1.py::test_filename\n========================= 27 passed, 1 error in 4.59s ==========================\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f\nplugins: anyio-3.7.1\ncollected 28 items\n\nr2e_tests/test_1.py E....................F......                         [100%]\n\n==================================== ERRORS ====================================\n_______________________ ERROR at setup of test_filename ________________________\nfile /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/Orange/tests/__init__.py, line 68\n  def test_filename(path):\nE       fixture 'path' not found\n>       available fixtures: anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory\n>       use 'pytest --fixtures [testpath]' for help on them.\n\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_9b2e5b0fcbe31ee08fb5506dc1dadbd48c5b290f/Orange/tests/__init__.py:68\n=================================== FAILURES ===================================\n________________________ TestComputeCD.test_compute_CD _________________________\n\nself = <r2e_tests.test_1.TestComputeCD testMethod=test_compute_CD>\n\n    def test_compute_CD(self):\n        avranks = [1.9, 3.2, 2.8, 3.3]\n        with self.assertWarns(OrangeDeprecationWarning):\n>           cd = scoring.compute_CD(avranks, 30)\nE           AssertionError: OrangeDeprecationWarning not triggered\n\nr2e_tests/test_1.py:328: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestScoreMetaType::test_names\nPASSED r2e_tests/test_1.py::TestScoreMetaType::test_registry\nPASSED r2e_tests/test_1.py::TestPrecision::test_precision_binary\nPASSED r2e_tests/test_1.py::TestPrecision::test_precision_iris\nPASSED r2e_tests/test_1.py::TestPrecision::test_precision_multiclass\nPASSED r2e_tests/test_1.py::TestRecall::test_recall_binary\nPASSED r2e_tests/test_1.py::TestRecall::test_recall_iris\nPASSED r2e_tests/test_1.py::TestRecall::test_recall_multiclass\nPASSED r2e_tests/test_1.py::TestF1::test_F1_binary\nPASSED r2e_tests/test_1.py::TestF1::test_F1_multiclass\nPASSED r2e_tests/test_1.py::TestF1::test_recall_iris\nPASSED r2e_tests/test_1.py::TestCA::test_bayes\nPASSED r2e_tests/test_1.py::TestCA::test_call\nPASSED r2e_tests/test_1.py::TestCA::test_init\nPASSED r2e_tests/test_1.py::TestAUC::test_auc_on_multiclass_data_returns_1d_array\nPASSED r2e_tests/test_1.py::TestAUC::test_auc_scores\nPASSED r2e_tests/test_1.py::TestAUC::test_constant_prob\nPASSED r2e_tests/test_1.py::TestAUC::test_multiclass_auc_multi_learners\nPASSED r2e_tests/test_1.py::TestAUC::test_tree\nPASSED r2e_tests/test_1.py::TestComputeCD::test_CD_deprecated\nPASSED r2e_tests/test_1.py::TestLogLoss::test_log_loss\nPASSED r2e_tests/test_1.py::TestLogLoss::test_log_loss_calc\nPASSED r2e_tests/test_1.py::TestSpecificity::test_errors\nPASSED r2e_tests/test_1.py::TestSpecificity::test_precision_binary\nPASSED r2e_tests/test_1.py::TestSpecificity::test_precision_multiclass\nPASSED r2e_tests/test_1.py::TestSpecificity::test_specificity_iris\nERROR r2e_tests/test_1.py::test_filename\nFAILED r2e_tests/test_1.py::TestComputeCD::test_compute_CD - AssertionError: ...\n==================== 1 failed, 26 passed, 1 error in 3.10s =====================\n",
    "old_commit_res_stderr": ""
}
Orange/evaluation/scoring.py Orange/tests/test_evaluation_scoring.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Deprecation Warning Not Emitted When Calling `compute_CD` Function

**Description:**
When using the deprecated `compute_CD` function from the evaluation scoring module, the expected deprecation warning is not triggered. This behavior prevents developers from being notified about the deprecation, which is important for maintaining and updating codebases.

**Example Code:**
```python
from Orange.evaluation.scoring import compute_CD

def example_usage():
    avranks = [1.9, 3.2, 2.8, 3.3]
    cd = compute_CD(avranks, 30)
    print(cd)
```

**Expected Behavior:**
Calling the `compute_CD` function should emit an `OrangeDeprecationWarning` to inform the user that the function is deprecated and will be removed in a future release.

**Actual Behavior:**
No warning is emitted when the `compute_CD` function is called, leading to a lack of notification about the deprecation.

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/evaluation/scoring.py
"""
Methods for scoring prediction results (CA, AUC, ...).

Examples
--------
>>> import Orange
>>> data = Orange.data.Table('iris')
>>> learner = Orange.classification.LogisticRegressionLearner()
>>> results = Orange.evaluation.TestOnTrainingData(data, [learner])

"""

import math

import numpy as np
import sklearn.metrics as skl_metrics
from sklearn.metrics import confusion_matrix

from Orange.data import DiscreteVariable, ContinuousVariable, Domain
from Orange.misc.wrapper_meta import WrapperMeta

__all__ = ["CA", "Precision", "Recall", "F1", "PrecisionRecallFSupport", "AUC",
           "MSE", "RMSE", "MAE", "R2", "compute_CD", "graph_ranks", "LogLoss"]


class ScoreMetaType(WrapperMeta):
    """
    Maintain a registry of non-abstract subclasses and assign the default
    value of `name`.

    The existing meta class Registry cannot be used since a meta class cannot
    have multiple inherited __new__ methods."""
    def __new__(mcs, name, bases, dict_, **kwargs):
        cls = WrapperMeta.__new__(mcs, name, bases, dict_)
        # Essentially `if cls is not Score`, except that Score may not exist yet
        if hasattr(cls, "registry"):
            if not kwargs.get("abstract"):
                # Don't use inherited names, look into dict_
                cls.name = dict_.get("name", name)
                cls.registry[name] = cls
        else:
            cls.registry = {}
        return cls

    def __init__(cls, *args, **_):
        WrapperMeta.__init__(cls, *args)


class Score(metaclass=ScoreMetaType):
    """
    ${sklpar}
    Parameters
    ----------
    results : Orange.evaluation.Results
        Stored predictions and actual data in model testing.
    """
    __wraps__ = None

    separate_folds = False
    is_scalar = True
    is_binary = False  #: If true, compute_score accepts `target` and `average`
    #: If the class doesn't explicitly contain `abstract=True`, it is not
    #: abstract; essentially, this attribute is not inherited
    abstract = True
    class_types = ()
    name = None
    long_name = None  #: A short user-readable name (e.g. a few words)

    def __new__(cls, results=None, **kwargs):
        self = super().__new__(cls)
        if results is not None:
            self.__init__()
            return self(results, **kwargs)
        else:
            return self

    def __call__(self, results, **kwargs):
        if self.separate_folds and results.score_by_folds and results.folds:
            scores = self.scores_by_folds(results, **kwargs)
            return self.average(scores)

        return self.compute_score(results, **kwargs)

    def average(self, scores):
        if self.is_scalar:
            return np.mean(scores, axis=0)
        return NotImplementedError

    def scores_by_folds(self, results, **kwargs):
        nfolds = len(results.folds)
        nmodels = len(results.predicted)
        if self.is_scalar:
            scores = np.empty((nfolds, nmodels), dtype=np.float64)
        else:
            scores = [None] * nfolds
        for fold in range(nfolds):
            fold_results = results.get_fold(fold)
            scores[fold] = self.compute_score(fold_results, **kwargs)
        return scores

    def compute_score(self, results):
        wraps = type(self).__wraps__  # self.__wraps__ is invisible
        if wraps:
            return self.from_predicted(results, wraps)
        else:
            return NotImplementedError

    @staticmethod
    def from_predicted(results, score_function, **kwargs):
        return np.fromiter(
            (score_function(results.actual, predicted, **kwargs)
             for predicted in results.predicted),
            dtype=np.float64, count=len(results.predicted))

    @staticmethod
    def is_compatible(domain: Domain) -> bool:
        raise NotImplementedError


class ClassificationScore(Score, abstract=True):
    class_types = (DiscreteVariable, )

    @staticmethod
    def is_compatible(domain: Domain) -> bool:
        return domain.has_discrete_class


class RegressionScore(Score, abstract=True):
    class_types = (ContinuousVariable, )

    @staticmethod
    def is_compatible(domain: Domain) -> bool:
        return domain.has_continuous_class


# pylint: disable=invalid-name
class CA(ClassificationScore):
    __wraps__ = skl_metrics.accuracy_score
    long_name = "Classification accuracy"


class PrecisionRecallFSupport(ClassificationScore):
    __wraps__ = skl_metrics.precision_recall_fscore_support
    is_scalar = False


class TargetScore(ClassificationScore):
    """
    Base class for scorers that need a target value (a "positive" class).

    Parameters
    ----------
    results : Orange.evaluation.Results
        Stored predictions and actual data in model testing.

    target : int, optional (default=None)
        Target class value.
        When None:
          - if averaging is specified, use all classes and average results
          - if average is 'binary' and class variable has exactly 2 values,
            use the value '1' as the positive class

    average: str, method for averaging (default='binary')
        Default requires a binary class or target to be set.
        Options: 'weighted', 'macro', 'micro', None

    """
    is_binary = True
    abstract = True
    __wraps__ = None  # Subclasses should set the scoring function

    def compute_score(self, results, target=None, average='binary'):
        if average == 'binary':
            if target is None:
                if len(results.domain.class_var.values) > 2:
                    raise ValueError(
                        "Multiclass data: specify target class or select "
                        "averaging ('weighted', 'macro', 'micro')")
                target = 1  # Default: use 1 as "positive" class
            average = None
        labels = None if target is None else [target]
        return self.from_predicted(
            results, type(self).__wraps__, labels=labels, average=average)


class Precision(TargetScore):
    __wraps__ = skl_metrics.precision_score


class Recall(TargetScore):
    __wraps__ = skl_metrics.recall_score


class F1(TargetScore):
    __wraps__ = skl_metrics.f1_score


class AUC(ClassificationScore):
    """
    ${sklpar}

    Parameters
    ----------
    results : Orange.evaluation.Results
        Stored predictions and actual data in model testing.

    target : int, optional (default=None)
        Value of class to report.
    """
    __wraps__ = skl_metrics.roc_auc_score
    separate_folds = True
    is_binary = True
    long_name = "Area under ROC curve"

    @staticmethod
    def calculate_weights(results):
        classes = np.unique(results.actual)
        class_cases = [sum(results.actual == class_)
                       for class_ in classes]
        N = results.actual.shape[0]
        weights = np.array([c * (N - c) for c in class_cases])
        wsum = np.sum(weights)
        if wsum == 0:
            raise ValueError("Class variable has less than two values")
        else:
            return weights / wsum

    @staticmethod
    def single_class_auc(results, target):
        y = np.array(results.actual == target, dtype=int)
        return np.fromiter(
            (skl_metrics.roc_auc_score(y, probabilities[:, int(target)])
             for probabilities in results.probabilities),
            dtype=np.float64, count=len(results.predicted))

    def multi_class_auc(self, results):
        classes = np.unique(results.actual)
        weights = self.calculate_weights(results)
        auc_array = np.array([self.single_class_auc(results, class_)
                              for class_ in classes])
        return np.sum(auc_array.T * weights, axis=1)

    def compute_score(self, results, target=None, average=None):
        domain = results.domain
        n_classes = len(domain.class_var.values)

        if n_classes < 2:
            raise ValueError("Class variable has less than two values")
        elif n_classes == 2:
            return self.single_class_auc(results, 1)
        else:
            if target is None:
                return self.multi_class_auc(results)
            else:
                return self.single_class_auc(results, target)


class LogLoss(ClassificationScore):
    """
    ${sklpar}

    Parameters
    ----------
    results : Orange.evaluation.Results
        Stored predictions and actual data in model testing.

    eps : float
        Log loss is undefined for p=0 or p=1, so probabilities are
        clipped to max(eps, min(1 - eps, p)).

    normalize : bool, optional (default=True)
        If true, return the mean loss per sample.
        Otherwise, return the sum of the per-sample losses.

    sample_weight : array-like of shape = [n_samples], optional
        Sample weights.

    Examples
    --------
    >>> Orange.evaluation.LogLoss(results)
    array([ 0.3...])

    """
    __wraps__ = skl_metrics.log_loss

    def compute_score(self, results, eps=1e-15, normalize=True,
                      sample_weight=None):
        return np.fromiter(
            (skl_metrics.log_loss(results.actual,
                                  probabilities,
                                  eps=eps,
                                  normalize=normalize,
                                  sample_weight=sample_weight)
             for probabilities in results.probabilities),
            dtype=np.float64, count=len(results.probabilities))


class Specificity(ClassificationScore):
    is_binary = True

    @staticmethod
    def calculate_weights(results):
        classes, counts = np.unique(results.actual, return_counts=True)
        n = np.array(results.actual).shape[0]
        return counts / n, classes

    @staticmethod
    def specificity(y_true, y_pred):
        tn, fp, _, _ = confusion_matrix(y_true, y_pred).ravel()
        return tn / (tn + fp)

    def single_class_specificity(self, results, target):
        y_true = (np.array(results.actual) == target).astype(int)
        return np.fromiter(
            (self.specificity(y_true,
                              np.array(predicted == target, dtype=int))
             for predicted in results.predicted),
            dtype=np.float64, count=len(results.predicted))

    def multi_class_specificity(self, results):
        weights, classes = self.calculate_weights(results)
        scores = np.array([self.single_class_specificity(results, class_)
                           for class_ in classes])
        return np.sum(scores.T * weights, axis=1)

    def compute_score(self, results, target=None, average="binary"):
        domain = results.domain
        n_classes = len(domain.class_var.values)

        if target is None:
            if average == "weighted":
                return self.multi_class_specificity(results)
            elif average == "binary":  # average is binary
                if n_classes != 2:
                    raise ValueError(
                        "Binary averaging needs two classes in data: "
                        "specify target class or use "
                        "weighted averaging.")
                return self.single_class_specificity(results, 1)
            else:
                raise ValueError(
                    "Wrong parameters: For averaging select one of the "
                    "following values: ('weighted', 'binary')")
        elif target is not None:
            return self.single_class_specificity(results, target)

# Regression scores


class MSE(RegressionScore):
    __wraps__ = skl_metrics.mean_squared_error
    long_name = "Mean square error"


class RMSE(RegressionScore):
    long_name = "Root mean square error"

    def compute_score(self, results):
        return np.sqrt(MSE(results))


class MAE(RegressionScore):
    __wraps__ = skl_metrics.mean_absolute_error
    long_name = "Mean absolute error"


# pylint: disable=invalid-name
class R2(RegressionScore):
    __wraps__ = skl_metrics.r2_score
    long_name = "Coefficient of determination"


class CVRMSE(RegressionScore):
    long_name = "Coefficient of variation of the RMSE"

    def compute_score(self, results):
        mean = np.nanmean(results.actual)
        if mean < 1e-10:
            raise ValueError("Mean value is too small")
        return RMSE(results) / mean * 100


# CD scores and plot

def compute_CD(avranks, n, alpha="0.05", test="nemenyi"):
    """
    Returns critical difference for Nemenyi or Bonferroni-Dunn test
    according to given alpha (either alpha="0.05" or alpha="0.1") for average
    ranks and number of tested datasets N. Test can be either "nemenyi" for
    for Nemenyi two tailed test or "bonferroni-dunn" for Bonferroni-Dunn test.
    """
    k = len(avranks)
    d = {("nemenyi", "0.05"): [0, 0, 1.959964, 2.343701, 2.569032, 2.727774,
                               2.849705, 2.94832, 3.030879, 3.101730, 3.163684,
                               3.218654, 3.268004, 3.312739, 3.353618, 3.39123,
                               3.426041, 3.458425, 3.488685, 3.517073,
                               3.543799],
         ("nemenyi", "0.1"): [0, 0, 1.644854, 2.052293, 2.291341, 2.459516,
                              2.588521, 2.692732, 2.779884, 2.854606, 2.919889,
                              2.977768, 3.029694, 3.076733, 3.119693, 3.159199,
                              3.195743, 3.229723, 3.261461, 3.291224, 3.319233],
         ("bonferroni-dunn", "0.05"): [0, 0, 1.960, 2.241, 2.394, 2.498, 2.576,
                                       2.638, 2.690, 2.724, 2.773],
         ("bonferroni-dunn", "0.1"): [0, 0, 1.645, 1.960, 2.128, 2.241, 2.326,
                                      2.394, 2.450, 2.498, 2.539]}
    q = d[(test, alpha)]
    cd = q[k] * (k * (k + 1) / (6.0 * n)) ** 0.5
    return cd


def graph_ranks(avranks, names, cd=None, cdmethod=None, lowv=None, highv=None,
                width=6, textspace=1, reverse=False, filename=None, **kwargs):
    """
    Draws a CD graph, which is used to display  the differences in methods'
    performance. See Janez Demsar, Statistical Comparisons of Classifiers over
    Multiple Data Sets, 7(Jan):1--30, 2006.

    Needs matplotlib to work.

    The image is ploted on `plt` imported using
    `import matplotlib.pyplot as plt`.

    Args:
        avranks (list of float): average ranks of methods.
        names (list of str): names of methods.
        cd (float): Critical difference used for statistically significance of
            difference between methods.
        cdmethod (int, optional): the method that is compared with other methods
            If omitted, show pairwise comparison of methods
        lowv (int, optional): the lowest shown rank
        highv (int, optional): the highest shown rank
        width (int, optional): default width in inches (default: 6)
        textspace (int, optional): space on figure sides (in inches) for the
            method names (default: 1)
        reverse (bool, optional):  if set to `True`, the lowest rank is on the
            right (default: `False`)
        filename (str, optional): output file name (with extension). If not
            given, the function does not write a file.
    """
    try:
        import matplotlib.pyplot as plt
        from matplotlib.backends.backend_agg import FigureCanvasAgg
    except ImportError:
        raise ImportError("Function graph_ranks requires matplotlib.")

    width = float(width)
    textspace = float(textspace)

    def nth(l, n):
        """
        Returns only nth elemnt in a list.
        """
        n = lloc(l, n)
        return [a[n] for a in l]

    def lloc(l, n):
        """
        List location in list of list structure.
        Enable the use of negative locations:
        -1 is the last element, -2 second last...
        """
        if n < 0:
            return len(l[0]) + n
        else:
            return n

    def mxrange(lr):
        """
        Multiple xranges. Can be used to traverse matrices.
        This function is very slow due to unknown number of
        parameters.

        >>> mxrange([3,5])
        [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]

        >>> mxrange([[3,5,1],[9,0,-3]])
        [(3, 9), (3, 6), (3, 3), (4, 9), (4, 6), (4, 3)]

        """
        if not len(lr):
            yield ()
        else:
            # it can work with single numbers
            index = lr[0]
            if isinstance(index, int):
                index = [index]
            for a in range(*index):
                for b in mxrange(lr[1:]):
                    yield tuple([a] + list(b))

    def print_figure(fig, *args, **kwargs):
        canvas = FigureCanvasAgg(fig)
        canvas.print_figure(*args, **kwargs)

    sums = avranks

    tempsort = sorted([(a, i) for i, a in enumerate(sums)], reverse=reverse)
    ssums = nth(tempsort, 0)
    sortidx = nth(tempsort, 1)
    nnames = [names[x] for x in sortidx]

    if lowv is None:
        lowv = min(1, int(math.floor(min(ssums))))
    if highv is None:
        highv = max(len(avranks), int(math.ceil(max(ssums))))

    cline = 0.4

    k = len(sums)

    lines = None

    linesblank = 0
    scalewidth = width - 2 * textspace

    def rankpos(rank):
        if not reverse:
            a = rank - lowv
        else:
            a = highv - rank
        return textspace + scalewidth / (highv - lowv) * a

    distanceh = 0.25

    if cd and cdmethod is None:
        # get pairs of non significant methods

        def get_lines(sums, hsd):
            # get all pairs
            lsums = len(sums)
            allpairs = [(i, j) for i, j in mxrange([[lsums], [lsums]]) if j > i]
            # remove not significant
            notSig = [(i, j) for i, j in allpairs
                      if abs(sums[i] - sums[j]) <= hsd]
            # keep only longest

            def no_longer(ij_tuple, notSig):
                i, j = ij_tuple
                for i1, j1 in notSig:
                    if (i1 <= i and j1 > j) or (i1 < i and j1 >= j):
                        return False
                return True

            longest = [(i, j) for i, j in notSig if no_longer((i, j), notSig)]

            return longest

        lines = get_lines(ssums, cd)
        linesblank = 0.2 + 0.2 + (len(lines) - 1) * 0.1

        # add scale
        distanceh = 0.25
        cline += distanceh

    # calculate height needed height of an image
    minnotsignificant = max(2 * 0.2, linesblank)
    height = cline + ((k + 1) / 2) * 0.2 + minnotsignificant

    fig = plt.figure(figsize=(width, height))
    fig.set_facecolor('white')
    ax = fig.add_axes([0, 0, 1, 1])  # reverse y axis
    ax.set_axis_off()

    hf = 1. / height  # height factor
    wf = 1. / width

    def hfl(l):
        return [a * hf for a in l]

    def wfl(l):
        return [a * wf for a in l]


    # Upper left corner is (0,0).
    ax.plot([0, 1], [0, 1], c="w")
    ax.set_xlim(0, 1)
    ax.set_ylim(1, 0)

    def line(l, color='k', **kwargs):
        """
        Input is a list of pairs of points.
        """
        ax.plot(wfl(nth(l, 0)), hfl(nth(l, 1)), color=color, **kwargs)

    def text(x, y, s, *args, **kwargs):
        ax.text(wf * x, hf * y, s, *args, **kwargs)

    line([(textspace, cline), (width - textspace, cline)], linewidth=0.7)

    bigtick = 0.1
    smalltick = 0.05

    tick = None
    for a in list(np.arange(lowv, highv, 0.5)) + [highv]:
        tick = smalltick
        if a == int(a):
            tick = bigtick
        line([(rankpos(a), cline - tick / 2),
              (rankpos(a), cline)],
             linewidth=0.7)

    for a in range(lowv, highv + 1):
        text(rankpos(a), cline - tick / 2 - 0.05, str(a),
             ha="center", va="bottom")

    k = len(ssums)

    for i in range(math.ceil(k / 2)):
        chei = cline + minnotsignificant + i * 0.2
        line([(rankpos(ssums[i]), cline),
              (rankpos(ssums[i]), chei),
              (textspace - 0.1, chei)],
             linewidth=0.7)
        text(textspace - 0.2, chei, nnames[i], ha="right", va="center")

    for i in range(math.ceil(k / 2), k):
        chei = cline + minnotsignificant + (k - i - 1) * 0.2
        line([(rankpos(ssums[i]), cline),
              (rankpos(ssums[i]), chei),
              (textspace + scalewidth + 0.1, chei)],
             linewidth=0.7)
        text(textspace + scalewidth + 0.2, chei, nnames[i],
             ha="left", va="center")

    if cd and cdmethod is None:
        # upper scale
        if not reverse:
            begin, end = rankpos(lowv), rankpos(lowv + cd)
        else:
            begin, end = rankpos(highv), rankpos(highv - cd)

        line([(begin, distanceh), (end, distanceh)], linewidth=0.7)
        line([(begin, distanceh + bigtick / 2),
              (begin, distanceh - bigtick / 2)],
             linewidth=0.7)
        line([(end, distanceh + bigtick / 2),
              (end, distanceh - bigtick / 2)],
             linewidth=0.7)
        text((begin + end) / 2, distanceh - 0.05, "CD",
             ha="center", va="bottom")

        # no-significance lines
        def draw_lines(lines, side=0.05, height=0.1):
            start = cline + 0.2
            for l, r in lines:
                line([(rankpos(ssums[l]) - side, start),
                      (rankpos(ssums[r]) + side, start)],
                     linewidth=2.5)
                start += height

        draw_lines(lines)

    elif cd:
        begin = rankpos(avranks[cdmethod] - cd)
        end = rankpos(avranks[cdmethod] + cd)
        line([(begin, cline), (end, cline)],
             linewidth=2.5)
        line([(begin, cline + bigtick / 2),
              (begin, cline - bigtick / 2)],
             linewidth=2.5)
        line([(end, cline + bigtick / 2),
              (end, cline - bigtick / 2)],
             linewidth=2.5)

    if filename:
        print_figure(fig, filename, **kwargs)

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
[ISSUE]
**Title:** Deprecation Warning Not Emitted When Calling `compute_CD` Function

**Description:**
When using the deprecated `compute_CD` function from the evaluation scoring module, the expected deprecation warning is not triggered. This behavior prevents developers from being notified about the deprecation, which is important for maintaining and updating codebases.

**Example Code:**
```python
from Orange.evaluation.scoring import compute_CD

def example_usage():
    avranks = [1.9, 3.2, 2.8, 3.3]
    cd = compute_CD(avranks, 30)
    print(cd)
```

**Expected Behavior:**
Calling the `compute_CD` function should emit an `OrangeDeprecationWarning` to inform the user that the function is deprecated and will be removed in a future release.

**Actual Behavior:**
No warning is emitted when the `compute_CD` function is called, leading to a lack of notification about the deprecation.

[/ISSUE]
{
    "TestScoreMetaType.test_names": "PASSED",
    "TestScoreMetaType.test_registry": "PASSED",
    "TestPrecision.test_precision_binary": "PASSED",
    "TestPrecision.test_precision_iris": "PASSED",
    "TestPrecision.test_precision_multiclass": "PASSED",
    "TestRecall.test_recall_binary": "PASSED",
    "TestRecall.test_recall_iris": "PASSED",
    "TestRecall.test_recall_multiclass": "PASSED",
    "TestF1.test_F1_binary": "PASSED",
    "TestF1.test_F1_multiclass": "PASSED",
    "TestF1.test_recall_iris": "PASSED",
    "TestCA.test_bayes": "PASSED",
    "TestCA.test_call": "PASSED",
    "TestCA.test_init": "PASSED",
    "TestAUC.test_auc_on_multiclass_data_returns_1d_array": "PASSED",
    "TestAUC.test_auc_scores": "PASSED",
    "TestAUC.test_constant_prob": "PASSED",
    "TestAUC.test_multiclass_auc_multi_learners": "PASSED",
    "TestAUC.test_tree": "PASSED",
    "TestComputeCD.test_CD_deprecated": "PASSED",
    "TestComputeCD.test_compute_CD": "PASSED",
    "TestLogLoss.test_log_loss": "PASSED",
    "TestLogLoss.test_log_loss_calc": "PASSED",
    "TestSpecificity.test_errors": "PASSED",
    "TestSpecificity.test_precision_binary": "PASSED",
    "TestSpecificity.test_precision_multiclass": "PASSED",
    "TestSpecificity.test_specificity_iris": "PASSED",
    "test_filename": "ERROR"
}
diff --git a/Orange/evaluation/scoring.py b/Orange/evaluation/scoring.py
index 6d8aabd9e..89c82a28d 100644
--- a/Orange/evaluation/scoring.py
+++ b/Orange/evaluation/scoring.py
@@ -11,6 +11,7 @@ Examples
 """
 
 import math
+import warnings
 
 import numpy as np
 import sklearn.metrics as skl_metrics
@@ -22,6 +23,8 @@ from Orange.misc.wrapper_meta import WrapperMeta
 __all__ = ["CA", "Precision", "Recall", "F1", "PrecisionRecallFSupport", "AUC",
            "MSE", "RMSE", "MAE", "R2", "compute_CD", "graph_ranks", "LogLoss"]
 
+from Orange.util import OrangeDeprecationWarning
+
 
 class ScoreMetaType(WrapperMeta):
     """
@@ -388,7 +391,11 @@ def compute_CD(avranks, n, alpha="0.05", test="nemenyi"):
     according to given alpha (either alpha="0.05" or alpha="0.1") for average
     ranks and number of tested datasets N. Test can be either "nemenyi" for
     for Nemenyi two tailed test or "bonferroni-dunn" for Bonferroni-Dunn test.
+
+    This function is deprecated and will be removed in Orange 3.34.
     """
+    warnings.warn("compute_CD is deprecated and will be removed in Orange 3.34.",
+                  OrangeDeprecationWarning, stacklevel=2)
     k = len(avranks)
     d = {("nemenyi", "0.05"): [0, 0, 1.959964, 2.343701, 2.569032, 2.727774,
                                2.849705, 2.94832, 3.030879, 3.101730, 3.163684,
@@ -420,6 +427,8 @@ def graph_ranks(avranks, names, cd=None, cdmethod=None, lowv=None, highv=None,
     The image is ploted on `plt` imported using
     `import matplotlib.pyplot as plt`.
 
+    This function is deprecated and will be removed in Orange 3.34.
+
     Args:
         avranks (list of float): average ranks of methods.
         names (list of str): names of methods.
@@ -437,6 +446,8 @@ def graph_ranks(avranks, names, cd=None, cdmethod=None, lowv=None, highv=None,
         filename (str, optional): output file name (with extension). If not
             given, the function does not write a file.
     """
+    warnings.warn("graph_ranks is deprecated and will be removed in Orange 3.34.",
+                  OrangeDeprecationWarning, stacklevel=2)
     try:
         import matplotlib.pyplot as plt
         from matplotlib.backends.backend_agg import FigureCanvasAgg

{"Orange/evaluation/scoring.py": "\"\"\"\nMethods for scoring prediction results (CA, AUC, ...).\n\nExamples\n--------\n>>> import Orange\n>>> data = Orange.data.Table('iris')\n>>> learner = Orange.classification.LogisticRegressionLearner()\n>>> results = Orange.evaluation.TestOnTrainingData(data, [learner])\n\n\"\"\"\n\nimport math\n\nimport numpy as np\nimport sklearn.metrics as skl_metrics\nfrom sklearn.metrics import confusion_matrix\n\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain\nfrom Orange.misc.wrapper_meta import WrapperMeta\n\n__all__ = [\"CA\", \"Precision\", \"Recall\", \"F1\", \"PrecisionRecallFSupport\", \"AUC\",\n           \"MSE\", \"RMSE\", \"MAE\", \"R2\", \"compute_CD\", \"graph_ranks\", \"LogLoss\"]\n\n\nclass ScoreMetaType(WrapperMeta):\n    \"\"\"\n    Maintain a registry of non-abstract subclasses and assign the default\n    value of `name`.\n\n    The existing meta class Registry cannot be used since a meta class cannot\n    have multiple inherited __new__ methods.\"\"\"\n    def __new__(mcs, name, bases, dict_, **kwargs):\n        cls = WrapperMeta.__new__(mcs, name, bases, dict_)\n        # Essentially `if cls is not Score`, except that Score may not exist yet\n        if hasattr(cls, \"registry\"):\n            if not kwargs.get(\"abstract\"):\n                # Don't use inherited names, look into dict_\n                cls.name = dict_.get(\"name\", name)\n                cls.registry[name] = cls\n        else:\n            cls.registry = {}\n        return cls\n\n    def __init__(cls, *args, **_):\n        WrapperMeta.__init__(cls, *args)\n\n\nclass Score(metaclass=ScoreMetaType):\n    \"\"\"\n    ${sklpar}\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n    \"\"\"\n    __wraps__ = None\n\n    separate_folds = False\n    is_scalar = True\n    is_binary = False  #: If true, compute_score accepts `target` and `average`\n    #: If the class doesn't explicitly contain `abstract=True`, it is not\n    #: abstract; essentially, this attribute is not inherited\n    abstract = True\n    class_types = ()\n    name = None\n    long_name = None  #: A short user-readable name (e.g. a few words)\n\n    def __new__(cls, results=None, **kwargs):\n        self = super().__new__(cls)\n        if results is not None:\n            self.__init__()\n            return self(results, **kwargs)\n        else:\n            return self\n\n    def __call__(self, results, **kwargs):\n        if self.separate_folds and results.score_by_folds and results.folds:\n            scores = self.scores_by_folds(results, **kwargs)\n            return self.average(scores)\n\n        return self.compute_score(results, **kwargs)\n\n    def average(self, scores):\n        if self.is_scalar:\n            return np.mean(scores, axis=0)\n        return NotImplementedError\n\n    def scores_by_folds(self, results, **kwargs):\n        nfolds = len(results.folds)\n        nmodels = len(results.predicted)\n        if self.is_scalar:\n            scores = np.empty((nfolds, nmodels), dtype=np.float64)\n        else:\n            scores = [None] * nfolds\n        for fold in range(nfolds):\n            fold_results = results.get_fold(fold)\n            scores[fold] = self.compute_score(fold_results, **kwargs)\n        return scores\n\n    def compute_score(self, results):\n        wraps = type(self).__wraps__  # self.__wraps__ is invisible\n        if wraps:\n            return self.from_predicted(results, wraps)\n        else:\n            return NotImplementedError\n\n    @staticmethod\n    def from_predicted(results, score_function, **kwargs):\n        return np.fromiter(\n            (score_function(results.actual, predicted, **kwargs)\n             for predicted in results.predicted),\n            dtype=np.float64, count=len(results.predicted))\n\n    @staticmethod\n    def is_compatible(domain: Domain) -> bool:\n        raise NotImplementedError\n\n\nclass ClassificationScore(Score, abstract=True):\n    class_types = (DiscreteVariable, )\n\n    @staticmethod\n    def is_compatible(domain: Domain) -> bool:\n        return domain.has_discrete_class\n\n\nclass RegressionScore(Score, abstract=True):\n    class_types = (ContinuousVariable, )\n\n    @staticmethod\n    def is_compatible(domain: Domain) -> bool:\n        return domain.has_continuous_class\n\n\n# pylint: disable=invalid-name\nclass CA(ClassificationScore):\n    __wraps__ = skl_metrics.accuracy_score\n    long_name = \"Classification accuracy\"\n\n\nclass PrecisionRecallFSupport(ClassificationScore):\n    __wraps__ = skl_metrics.precision_recall_fscore_support\n    is_scalar = False\n\n\nclass TargetScore(ClassificationScore):\n    \"\"\"\n    Base class for scorers that need a target value (a \"positive\" class).\n\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n\n    target : int, optional (default=None)\n        Target class value.\n        When None:\n          - if averaging is specified, use all classes and average results\n          - if average is 'binary' and class variable has exactly 2 values,\n            use the value '1' as the positive class\n\n    average: str, method for averaging (default='binary')\n        Default requires a binary class or target to be set.\n        Options: 'weighted', 'macro', 'micro', None\n\n    \"\"\"\n    is_binary = True\n    abstract = True\n    __wraps__ = None  # Subclasses should set the scoring function\n\n    def compute_score(self, results, target=None, average='binary'):\n        if average == 'binary':\n            if target is None:\n                if len(results.domain.class_var.values) > 2:\n                    raise ValueError(\n                        \"Multiclass data: specify target class or select \"\n                        \"averaging ('weighted', 'macro', 'micro')\")\n                target = 1  # Default: use 1 as \"positive\" class\n            average = None\n        labels = None if target is None else [target]\n        return self.from_predicted(\n            results, type(self).__wraps__, labels=labels, average=average)\n\n\nclass Precision(TargetScore):\n    __wraps__ = skl_metrics.precision_score\n\n\nclass Recall(TargetScore):\n    __wraps__ = skl_metrics.recall_score\n\n\nclass F1(TargetScore):\n    __wraps__ = skl_metrics.f1_score\n\n\nclass AUC(ClassificationScore):\n    \"\"\"\n    ${sklpar}\n\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n\n    target : int, optional (default=None)\n        Value of class to report.\n    \"\"\"\n    __wraps__ = skl_metrics.roc_auc_score\n    separate_folds = True\n    is_binary = True\n    long_name = \"Area under ROC curve\"\n\n    @staticmethod\n    def calculate_weights(results):\n        classes = np.unique(results.actual)\n        class_cases = [sum(results.actual == class_)\n                       for class_ in classes]\n        N = results.actual.shape[0]\n        weights = np.array([c * (N - c) for c in class_cases])\n        wsum = np.sum(weights)\n        if wsum == 0:\n            raise ValueError(\"Class variable has less than two values\")\n        else:\n            return weights / wsum\n\n    @staticmethod\n    def single_class_auc(results, target):\n        y = np.array(results.actual == target, dtype=int)\n        return np.fromiter(\n            (skl_metrics.roc_auc_score(y, probabilities[:, int(target)])\n             for probabilities in results.probabilities),\n            dtype=np.float64, count=len(results.predicted))\n\n    def multi_class_auc(self, results):\n        classes = np.unique(results.actual)\n        weights = self.calculate_weights(results)\n        auc_array = np.array([self.single_class_auc(results, class_)\n                              for class_ in classes])\n        return np.sum(auc_array.T * weights, axis=1)\n\n    def compute_score(self, results, target=None, average=None):\n        domain = results.domain\n        n_classes = len(domain.class_var.values)\n\n        if n_classes < 2:\n            raise ValueError(\"Class variable has less than two values\")\n        elif n_classes == 2:\n            return self.single_class_auc(results, 1)\n        else:\n            if target is None:\n                return self.multi_class_auc(results)\n            else:\n                return self.single_class_auc(results, target)\n\n\nclass LogLoss(ClassificationScore):\n    \"\"\"\n    ${sklpar}\n\n    Parameters\n    ----------\n    results : Orange.evaluation.Results\n        Stored predictions and actual data in model testing.\n\n    eps : float\n        Log loss is undefined for p=0 or p=1, so probabilities are\n        clipped to max(eps, min(1 - eps, p)).\n\n    normalize : bool, optional (default=True)\n        If true, return the mean loss per sample.\n        Otherwise, return the sum of the per-sample losses.\n\n    sample_weight : array-like of shape = [n_samples], optional\n        Sample weights.\n\n    Examples\n    --------\n    >>> Orange.evaluation.LogLoss(results)\n    array([ 0.3...])\n\n    \"\"\"\n    __wraps__ = skl_metrics.log_loss\n\n    def compute_score(self, results, eps=1e-15, normalize=True,\n                      sample_weight=None):\n        return np.fromiter(\n            (skl_metrics.log_loss(results.actual,\n                                  probabilities,\n                                  eps=eps,\n                                  normalize=normalize,\n                                  sample_weight=sample_weight)\n             for probabilities in results.probabilities),\n            dtype=np.float64, count=len(results.probabilities))\n\n\nclass Specificity(ClassificationScore):\n    is_binary = True\n\n    @staticmethod\n    def calculate_weights(results):\n        classes, counts = np.unique(results.actual, return_counts=True)\n        n = np.array(results.actual).shape[0]\n        return counts / n, classes\n\n    @staticmethod\n    def specificity(y_true, y_pred):\n        tn, fp, _, _ = confusion_matrix(y_true, y_pred).ravel()\n        return tn / (tn + fp)\n\n    def single_class_specificity(self, results, target):\n        y_true = (np.array(results.actual) == target).astype(int)\n        return np.fromiter(\n            (self.specificity(y_true,\n                              np.array(predicted == target, dtype=int))\n             for predicted in results.predicted),\n            dtype=np.float64, count=len(results.predicted))\n\n    def multi_class_specificity(self, results):\n        weights, classes = self.calculate_weights(results)\n        scores = np.array([self.single_class_specificity(results, class_)\n                           for class_ in classes])\n        return np.sum(scores.T * weights, axis=1)\n\n    def compute_score(self, results, target=None, average=\"binary\"):\n        domain = results.domain\n        n_classes = len(domain.class_var.values)\n\n        if target is None:\n            if average == \"weighted\":\n                return self.multi_class_specificity(results)\n            elif average == \"binary\":  # average is binary\n                if n_classes != 2:\n                    raise ValueError(\n                        \"Binary averaging needs two classes in data: \"\n                        \"specify target class or use \"\n                        \"weighted averaging.\")\n                return self.single_class_specificity(results, 1)\n            else:\n                raise ValueError(\n                    \"Wrong parameters: For averaging select one of the \"\n                    \"following values: ('weighted', 'binary')\")\n        elif target is not None:\n            return self.single_class_specificity(results, target)\n\n# Regression scores\n\n\nclass MSE(RegressionScore):\n    __wraps__ = skl_metrics.mean_squared_error\n    long_name = \"Mean square error\"\n\n\nclass RMSE(RegressionScore):\n    long_name = \"Root mean square error\"\n\n    def compute_score(self, results):\n        return np.sqrt(MSE(results))\n\n\nclass MAE(RegressionScore):\n    __wraps__ = skl_metrics.mean_absolute_error\n    long_name = \"Mean absolute error\"\n\n\n# pylint: disable=invalid-name\nclass R2(RegressionScore):\n    __wraps__ = skl_metrics.r2_score\n    long_name = \"Coefficient of determination\"\n\n\nclass CVRMSE(RegressionScore):\n    long_name = \"Coefficient of variation of the RMSE\"\n\n    def compute_score(self, results):\n        mean = np.nanmean(results.actual)\n        if mean < 1e-10:\n            raise ValueError(\"Mean value is too small\")\n        return RMSE(results) / mean * 100\n\n\n# CD scores and plot\n\ndef compute_CD(avranks, n, alpha=\"0.05\", test=\"nemenyi\"):\n    \"\"\"\n    Returns critical difference for Nemenyi or Bonferroni-Dunn test\n    according to given alpha (either alpha=\"0.05\" or alpha=\"0.1\") for average\n    ranks and number of tested datasets N. Test can be either \"nemenyi\" for\n    for Nemenyi two tailed test or \"bonferroni-dunn\" for Bonferroni-Dunn test.\n    \"\"\"\n    k = len(avranks)\n    d = {(\"nemenyi\", \"0.05\"): [0, 0, 1.959964, 2.343701, 2.569032, 2.727774,\n                               2.849705, 2.94832, 3.030879, 3.101730, 3.163684,\n                               3.218654, 3.268004, 3.312739, 3.353618, 3.39123,\n                               3.426041, 3.458425, 3.488685, 3.517073,\n                               3.543799],\n         (\"nemenyi\", \"0.1\"): [0, 0, 1.644854, 2.052293, 2.291341, 2.459516,\n                              2.588521, 2.692732, 2.779884, 2.854606, 2.919889,\n                              2.977768, 3.029694, 3.076733, 3.119693, 3.159199,\n                              3.195743, 3.229723, 3.261461, 3.291224, 3.319233],\n         (\"bonferroni-dunn\", \"0.05\"): [0, 0, 1.960, 2.241, 2.394, 2.498, 2.576,\n                                       2.638, 2.690, 2.724, 2.773],\n         (\"bonferroni-dunn\", \"0.1\"): [0, 0, 1.645, 1.960, 2.128, 2.241, 2.326,\n                                      2.394, 2.450, 2.498, 2.539]}\n    q = d[(test, alpha)]\n    cd = q[k] * (k * (k + 1) / (6.0 * n)) ** 0.5\n    return cd\n\n\ndef graph_ranks(avranks, names, cd=None, cdmethod=None, lowv=None, highv=None,\n                width=6, textspace=1, reverse=False, filename=None, **kwargs):\n    \"\"\"\n    Draws a CD graph, which is used to display  the differences in methods'\n    performance. See Janez Demsar, Statistical Comparisons of Classifiers over\n    Multiple Data Sets, 7(Jan):1--30, 2006.\n\n    Needs matplotlib to work.\n\n    The image is ploted on `plt` imported using\n    `import matplotlib.pyplot as plt`.\n\n    Args:\n        avranks (list of float): average ranks of methods.\n        names (list of str): names of methods.\n        cd (float): Critical difference used for statistically significance of\n            difference between methods.\n        cdmethod (int, optional): the method that is compared with other methods\n            If omitted, show pairwise comparison of methods\n        lowv (int, optional): the lowest shown rank\n        highv (int, optional): the highest shown rank\n        width (int, optional): default width in inches (default: 6)\n        textspace (int, optional): space on figure sides (in inches) for the\n            method names (default: 1)\n        reverse (bool, optional):  if set to `True`, the lowest rank is on the\n            right (default: `False`)\n        filename (str, optional): output file name (with extension). If not\n            given, the function does not write a file.\n    \"\"\"\n    try:\n        import matplotlib.pyplot as plt\n        from matplotlib.backends.backend_agg import FigureCanvasAgg\n    except ImportError:\n        raise ImportError(\"Function graph_ranks requires matplotlib.\")\n\n    width = float(width)\n    textspace = float(textspace)\n\n    def nth(l, n):\n        \"\"\"\n        Returns only nth elemnt in a list.\n        \"\"\"\n        n = lloc(l, n)\n        return [a[n] for a in l]\n\n    def lloc(l, n):\n        \"\"\"\n        List location in list of list structure.\n        Enable the use of negative locations:\n        -1 is the last element, -2 second last...\n        \"\"\"\n        if n < 0:\n            return len(l[0]) + n\n        else:\n            return n\n\n    def mxrange(lr):\n        \"\"\"\n        Multiple xranges. Can be used to traverse matrices.\n        This function is very slow due to unknown number of\n        parameters.\n\n        >>> mxrange([3,5])\n        [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]\n\n        >>> mxrange([[3,5,1],[9,0,-3]])\n        [(3, 9), (3, 6), (3, 3), (4, 9), (4, 6), (4, 3)]\n\n        \"\"\"\n        if not len(lr):\n            yield ()\n        else:\n            # it can work with single numbers\n            index = lr[0]\n            if isinstance(index, int):\n                index = [index]\n            for a in range(*index):\n                for b in mxrange(lr[1:]):\n                    yield tuple([a] + list(b))\n\n    def print_figure(fig, *args, **kwargs):\n        canvas = FigureCanvasAgg(fig)\n        canvas.print_figure(*args, **kwargs)\n\n    sums = avranks\n\n    tempsort = sorted([(a, i) for i, a in enumerate(sums)], reverse=reverse)\n    ssums = nth(tempsort, 0)\n    sortidx = nth(tempsort, 1)\n    nnames = [names[x] for x in sortidx]\n\n    if lowv is None:\n        lowv = min(1, int(math.floor(min(ssums))))\n    if highv is None:\n        highv = max(len(avranks), int(math.ceil(max(ssums))))\n\n    cline = 0.4\n\n    k = len(sums)\n\n    lines = None\n\n    linesblank = 0\n    scalewidth = width - 2 * textspace\n\n    def rankpos(rank):\n        if not reverse:\n            a = rank - lowv\n        else:\n            a = highv - rank\n        return textspace + scalewidth / (highv - lowv) * a\n\n    distanceh = 0.25\n\n    if cd and cdmethod is None:\n        # get pairs of non significant methods\n\n        def get_lines(sums, hsd):\n            # get all pairs\n            lsums = len(sums)\n            allpairs = [(i, j) for i, j in mxrange([[lsums], [lsums]]) if j > i]\n            # remove not significant\n            notSig = [(i, j) for i, j in allpairs\n                      if abs(sums[i] - sums[j]) <= hsd]\n            # keep only longest\n\n            def no_longer(ij_tuple, notSig):\n                i, j = ij_tuple\n                for i1, j1 in notSig:\n                    if (i1 <= i and j1 > j) or (i1 < i and j1 >= j):\n                        return False\n                return True\n\n            longest = [(i, j) for i, j in notSig if no_longer((i, j), notSig)]\n\n            return longest\n\n        lines = get_lines(ssums, cd)\n        linesblank = 0.2 + 0.2 + (len(lines) - 1) * 0.1\n\n        # add scale\n        distanceh = 0.25\n        cline += distanceh\n\n    # calculate height needed height of an image\n    minnotsignificant = max(2 * 0.2, linesblank)\n    height = cline + ((k + 1) / 2) * 0.2 + minnotsignificant\n\n    fig = plt.figure(figsize=(width, height))\n    fig.set_facecolor('white')\n    ax = fig.add_axes([0, 0, 1, 1])  # reverse y axis\n    ax.set_axis_off()\n\n    hf = 1. / height  # height factor\n    wf = 1. / width\n\n    def hfl(l):\n        return [a * hf for a in l]\n\n    def wfl(l):\n        return [a * wf for a in l]\n\n\n    # Upper left corner is (0,0).\n    ax.plot([0, 1], [0, 1], c=\"w\")\n    ax.set_xlim(0, 1)\n    ax.set_ylim(1, 0)\n\n    def line(l, color='k', **kwargs):\n        \"\"\"\n        Input is a list of pairs of points.\n        \"\"\"\n        ax.plot(wfl(nth(l, 0)), hfl(nth(l, 1)), color=color, **kwargs)\n\n    def text(x, y, s, *args, **kwargs):\n        ax.text(wf * x, hf * y, s, *args, **kwargs)\n\n    line([(textspace, cline), (width - textspace, cline)], linewidth=0.7)\n\n    bigtick = 0.1\n    smalltick = 0.05\n\n    tick = None\n    for a in list(np.arange(lowv, highv, 0.5)) + [highv]:\n        tick = smalltick\n        if a == int(a):\n            tick = bigtick\n        line([(rankpos(a), cline - tick / 2),\n              (rankpos(a), cline)],\n             linewidth=0.7)\n\n    for a in range(lowv, highv + 1):\n        text(rankpos(a), cline - tick / 2 - 0.05, str(a),\n             ha=\"center\", va=\"bottom\")\n\n    k = len(ssums)\n\n    for i in range(math.ceil(k / 2)):\n        chei = cline + minnotsignificant + i * 0.2\n        line([(rankpos(ssums[i]), cline),\n              (rankpos(ssums[i]), chei),\n              (textspace - 0.1, chei)],\n             linewidth=0.7)\n        text(textspace - 0.2, chei, nnames[i], ha=\"right\", va=\"center\")\n\n    for i in range(math.ceil(k / 2), k):\n        chei = cline + minnotsignificant + (k - i - 1) * 0.2\n        line([(rankpos(ssums[i]), cline),\n              (rankpos(ssums[i]), chei),\n              (textspace + scalewidth + 0.1, chei)],\n             linewidth=0.7)\n        text(textspace + scalewidth + 0.2, chei, nnames[i],\n             ha=\"left\", va=\"center\")\n\n    if cd and cdmethod is None:\n        # upper scale\n        if not reverse:\n            begin, end = rankpos(lowv), rankpos(lowv + cd)\n        else:\n            begin, end = rankpos(highv), rankpos(highv - cd)\n\n        line([(begin, distanceh), (end, distanceh)], linewidth=0.7)\n        line([(begin, distanceh + bigtick / 2),\n              (begin, distanceh - bigtick / 2)],\n             linewidth=0.7)\n        line([(end, distanceh + bigtick / 2),\n              (end, distanceh - bigtick / 2)],\n             linewidth=0.7)\n        text((begin + end) / 2, distanceh - 0.05, \"CD\",\n             ha=\"center\", va=\"bottom\")\n\n        # no-significance lines\n        def draw_lines(lines, side=0.05, height=0.1):\n            start = cline + 0.2\n            for l, r in lines:\n                line([(rankpos(ssums[l]) - side, start),\n                      (rankpos(ssums[r]) + side, start)],\n                     linewidth=2.5)\n                start += height\n\n        draw_lines(lines)\n\n    elif cd:\n        begin = rankpos(avranks[cdmethod] - cd)\n        end = rankpos(avranks[cdmethod] + cd)\n        line([(begin, cline), (end, cline)],\n             linewidth=2.5)\n        line([(begin, cline + bigtick / 2),\n              (begin, cline - bigtick / 2)],\n             linewidth=2.5)\n        line([(end, cline + bigtick / 2),\n              (end, cline - bigtick / 2)],\n             linewidth=2.5)\n\n    if filename:\n        print_figure(fig, filename, **kwargs)\n"}
A user will ask you to solve a task. You should first draft your thinking process (inner monologue). Then, generate the solution.

Your response format must follow the template below:
<think>
Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate a correct solution.
</think>
<solution>
Final solution presented to the user.
</solution>
system
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Deprecation Warning Not Emitted When Calling `compute_CD` Function

**Description:**
When using the deprecated `compute_CD` function from the evaluation scoring module, the expected deprecation warning is not triggered. This behavior prevents developers from being notified about the deprecation, which is important for maintaining and updating codebases.

**Example Code:**
```python
from Orange.evaluation.scoring import compute_CD

def example_usage():
    avranks = [1.9, 3.2, 2.8, 3.3]
    cd = compute_CD(avranks, 30)
    print(cd)
```

**Expected Behavior:**
Calling the `compute_CD` function should emit an `OrangeDeprecationWarning` to inform the user that the function is deprecated and will be removed in a future release.

**Actual Behavior:**
No warning is emitted when the `compute_CD` function is called, leading to a lack of notification about the deprecation.

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/evaluation/scoring.py
"""
Methods for scoring prediction results (CA, AUC, ...).

Examples
--------
>>> import Orange
>>> data = Orange.data.Table('iris')
>>> learner = Orange.classification.LogisticRegressionLearner()
>>> results = Orange.evaluation.TestOnTrainingData(data, [learner])

"""

import math

import numpy as np
import sklearn.metrics as skl_metrics
from sklearn.metrics import confusion_matrix

from Orange.data import DiscreteVariable, ContinuousVariable, Domain
from Orange.misc.wrapper_meta import WrapperMeta

__all__ = ["CA", "Precision", "Recall", "F1", "PrecisionRecallFSupport", "AUC",
           "MSE", "RMSE", "MAE", "R2", "compute_CD", "graph_ranks", "LogLoss"]


class ScoreMetaType(WrapperMeta):
    """
    Maintain a registry of non-abstract subclasses and assign the default
    value of `name`.

    The existing meta class Registry cannot be used since a meta class cannot
    have multiple inherited __new__ methods."""
    def __new__(mcs, name, bases, dict_, **kwargs):
        cls = WrapperMeta.__new__(mcs, name, bases, dict_)
        # Essentially `if cls is not Score`, except that Score may not exist yet
        if hasattr(cls, "registry"):
            if not kwargs.get("abstract"):
                # Don't use inherited names, look into dict_
                cls.name = dict_.get("name", name)
                cls.registry[name] = cls
        else:
            cls.registry = {}
        return cls

    def __init__(cls, *args, **_):
        WrapperMeta.__init__(cls, *args)


class Score(metaclass=ScoreMetaType):
    """
    ${sklpar}
    Parameters
    ----------
    results : Orange.evaluation.Results
        Stored predictions and actual data in model testing.
    """
    __wraps__ = None

    separate_folds = False
    is_scalar = True
    is_binary = False  #: If true, compute_score accepts `target` and `average`
    #: If the class doesn't explicitly contain `abstract=True`, it is not
    #: abstract; essentially, this attribute is not inherited
    abstract = True
    class_types = ()
    name = None
    long_name = None  #: A short user-readable name (e.g. a few words)

    def __new__(cls, results=None, **kwargs):
        self = super().__new__(cls)
        if results is not None:
            self.__init__()
            return self(results, **kwargs)
        else:
            return self

    def __call__(self, results, **kwargs):
        if self.separate_folds and results.score_by_folds and results.folds:
            scores = self.scores_by_folds(results, **kwargs)
            return self.average(scores)

        return self.compute_score(results, **kwargs)

    def average(self, scores):
        if self.is_scalar:
            return np.mean(scores, axis=0)
        return NotImplementedError

    def scores_by_folds(self, results, **kwargs):
        nfolds = len(results.folds)
        nmodels = len(results.predicted)
        if self.is_scalar:
            scores = np.empty((nfolds, nmodels), dtype=np.float64)
        else:
            scores = [None] * nfolds
        for fold in range(nfolds):
            fold_results = results.get_fold(fold)
            scores[fold] = self.compute_score(fold_results, **kwargs)
        return scores

    def compute_score(self, results):
        wraps = type(self).__wraps__  # self.__wraps__ is invisible
        if wraps:
            return self.from_predicted(results, wraps)
        else:
            return NotImplementedError

    @staticmethod
    def from_predicted(results, score_function, **kwargs):
        return np.fromiter(
            (score_function(results.actual, predicted, **kwargs)
             for predicted in results.predicted),
            dtype=np.float64, count=len(results.predicted))

    @staticmethod
    def is_compatible(domain: Domain) -> bool:
        raise NotImplementedError


class ClassificationScore(Score, abstract=True):
    class_types = (DiscreteVariable, )

    @staticmethod
    def is_compatible(domain: Domain) -> bool:
        return domain.has_discrete_class


class RegressionScore(Score, abstract=True):
    class_types = (ContinuousVariable, )

    @staticmethod
    def is_compatible(domain: Domain) -> bool:
        return domain.has_continuous_class


# pylint: disable=invalid-name
class CA(ClassificationScore):
    __wraps__ = skl_metrics.accuracy_score
    long_name = "Classification accuracy"


class PrecisionRecallFSupport(ClassificationScore):
    __wraps__ = skl_metrics.precision_recall_fscore_support
    is_scalar = False


class TargetScore(ClassificationScore):
    """
    Base class for scorers that need a target value (a "positive" class).

    Parameters
    ----------
    results : Orange.evaluation.Results
        Stored predictions and actual data in model testing.

    target : int, optional (default=None)
        Target class value.
        When None:
          - if averaging is specified, use all classes and average results
          - if average is 'binary' and class variable has exactly 2 values,
            use the value '1' as the positive class

    average: str, method for averaging (default='binary')
        Default requires a binary class or target to be set.
        Options: 'weighted', 'macro', 'micro', None

    """
    is_binary = True
    abstract = True
    __wraps__ = None  # Subclasses should set the scoring function

    def compute_score(self, results, target=None, average='binary'):
        if average == 'binary':
            if target is None:
                if len(results.domain.class_var.values) > 2:
                    raise ValueError(
                        "Multiclass data: specify target class or select "
                        "averaging ('weighted', 'macro', 'micro')")
                target = 1  # Default: use 1 as "positive" class
            average = None
        labels = None if target is None else [target]
        return self.from_predicted(
            results, type(self).__wraps__, labels=labels, average=average)


class Precision(TargetScore):
    __wraps__ = skl_metrics.precision_score


class Recall(TargetScore):
    __wraps__ = skl_metrics.recall_score


class F1(TargetScore):
    __wraps__ = skl_metrics.f1_score


class AUC(ClassificationScore):
    """
    ${sklpar}

    Parameters
    ----------
    results : Orange.evaluation.Results
        Stored predictions and actual data in model testing.

    target : int, optional (default=None)
        Value of class to report.
    """
    __wraps__ = skl_metrics.roc_auc_score
    separate_folds = True
    is_binary = True
    long_name = "Area under ROC curve"

    @staticmethod
    def calculate_weights(results):
        classes = np.unique(results.actual)
        class_cases = [sum(results.actual == class_)
                       for class_ in classes]
        N = results.actual.shape[0]
        weights = np.array([c * (N - c) for c in class_cases])
        wsum = np.sum(weights)
        if wsum == 0:
            raise ValueError("Class variable has less than two values")
        else:
            return weights / wsum

    @staticmethod
    def single_class_auc(results, target):
        y = np.array(results.actual == target, dtype=int)
        return np.fromiter(
            (skl_metrics.roc_auc_score(y, probabilities[:, int(target)])
             for probabilities in results.probabilities),
            dtype=np.float64, count=len(results.predicted))

    def multi_class_auc(self, results):
        classes = np.unique(results.actual)
        weights = self.calculate_weights(results)
        auc_array = np.array([self.single_class_auc(results, class_)
                              for class_ in classes])
        return np.sum(auc_array.T * weights, axis=1)

    def compute_score(self, results, target=None, average=None):
        domain = results.domain
        n_classes = len(domain.class_var.values)

        if n_classes < 2:
            raise ValueError("Class variable has less than two values")
        elif n_classes == 2:
            return self.single_class_auc(results, 1)
        else:
            if target is None:
                return self.multi_class_auc(results)
            else:
                return self.single_class_auc(results, target)


class LogLoss(ClassificationScore):
    """
    ${sklpar}

    Parameters
    ----------
    results : Orange.evaluation.Results
        Stored predictions and actual data in model testing.

    eps : float
        Log loss is undefined for p=0 or p=1, so probabilities are
        clipped to max(eps, min(1 - eps, p)).

    normalize : bool, optional (default=True)
        If true, return the mean loss per sample.
        Otherwise, return the sum of the per-sample losses.

    sample_weight : array-like of shape = [n_samples], optional
        Sample weights.

    Examples
    --------
    >>> Orange.evaluation.LogLoss(results)
    array([ 0.3...])

    """
    __wraps__ = skl_metrics.log_loss

    def compute_score(self, results, eps=1e-15, normalize=True,
                      sample_weight=None):
        return np.fromiter(
            (skl_metrics.log_loss(results.actual,
                                  probabilities,
                                  eps=eps,
                                  normalize=normalize,
                                  sample_weight=sample_weight)
             for probabilities in results.probabilities),
            dtype=np.float64, count=len(results.probabilities))


class Specificity(ClassificationScore):
    is_binary = True

    @staticmethod
    def calculate_weights(results):
        classes, counts = np.unique(results.actual, return_counts=True)
        n = np.array(results.actual).shape[0]
        return counts / n, classes

    @staticmethod
    def specificity(y_true, y_pred):
        tn, fp, _, _ = confusion_matrix(y_true, y_pred).ravel()
        return tn / (tn + fp)

    def single_class_specificity(self, results, target):
        y_true = (np.array(results.actual) == target).astype(int)
        return np.fromiter(
            (self.specificity(y_true,
                              np.array(predicted == target, dtype=int))
             for predicted in results.predicted),
            dtype=np.float64, count=len(results.predicted))

    def multi_class_specificity(self, results):
        weights, classes = self.calculate_weights(results)
        scores = np.array([self.single_class_specificity(results, class_)
                           for class_ in classes])
        return np.sum(scores.T * weights, axis=1)

    def compute_score(self, results, target=None, average="binary"):
        domain = results.domain
        n_classes = len(domain.class_var.values)

        if target is None:
            if average == "weighted":
                return self.multi_class_specificity(results)
            elif average == "binary":  # average is binary
                if n_classes != 2:
                    raise ValueError(
                        "Binary averaging needs two classes in data: "
                        "specify target class or use "
                        "weighted averaging.")
                return self.single_class_specificity(results, 1)
            else:
                raise ValueError(
                    "Wrong parameters: For averaging select one of the "
                    "following values: ('weighted', 'binary')")
        elif target is not None:
            return self.single_class_specificity(results, target)

# Regression scores


class MSE(RegressionScore):
    __wraps__ = skl_metrics.mean_squared_error
    long_name = "Mean square error"


class RMSE(RegressionScore):
    long_name = "Root mean square error"

    def compute_score(self, results):
        return np.sqrt(MSE(results))


class MAE(RegressionScore):
    __wraps__ = skl_metrics.mean_absolute_error
    long_name = "Mean absolute error"


# pylint: disable=invalid-name
class R2(RegressionScore):
    __wraps__ = skl_metrics.r2_score
    long_name = "Coefficient of determination"


class CVRMSE(RegressionScore):
    long_name = "Coefficient of variation of the RMSE"

    def compute_score(self, results):
        mean = np.nanmean(results.actual)
        if mean < 1e-10:
            raise ValueError("Mean value is too small")
        return RMSE(results) / mean * 100


# CD scores and plot

def compute_CD(avranks, n, alpha="0.05", test="nemenyi"):
    """
    Returns critical difference for Nemenyi or Bonferroni-Dunn test
    according to given alpha (either alpha="0.05" or alpha="0.1") for average
    ranks and number of tested datasets N. Test can be either "nemenyi" for
    for Nemenyi two tailed test or "bonferroni-dunn" for Bonferroni-Dunn test.
    """
    k = len(avranks)
    d = {("nemenyi", "0.05"): [0, 0, 1.959964, 2.343701, 2.569032, 2.727774,
                               2.849705, 2.94832, 3.030879, 3.101730, 3.163684,
                               3.218654, 3.268004, 3.312739, 3.353618, 3.39123,
                               3.426041, 3.458425, 3.488685, 3.517073,
                               3.543799],
         ("nemenyi", "0.1"): [0, 0, 1.644854, 2.052293, 2.291341, 2.459516,
                              2.588521, 2.692732, 2.779884, 2.854606, 2.919889,
                              2.977768, 3.029694, 3.076733, 3.119693, 3.159199,
                              3.195743, 3.229723, 3.261461, 3.291224, 3.319233],
         ("bonferroni-dunn", "0.05"): [0, 0, 1.960, 2.241, 2.394, 2.498, 2.576,
                                       2.638, 2.690, 2.724, 2.773],
         ("bonferroni-dunn", "0.1"): [0, 0, 1.645, 1.960, 2.128, 2.241, 2.326,
                                      2.394, 2.450, 2.498, 2.539]}
    q = d[(test, alpha)]
    cd = q[k] * (k * (k + 1) / (6.0 * n)) ** 0.5
    return cd


def graph_ranks(avranks, names, cd=None, cdmethod=None, lowv=None, highv=None,
                width=6, textspace=1, reverse=False, filename=None, **kwargs):
    """
    Draws a CD graph, which is used to display  the differences in methods'
    performance. See Janez Demsar, Statistical Comparisons of Classifiers over
    Multiple Data Sets, 7(Jan):1--30, 2006.

    Needs matplotlib to work.

    The image is ploted on `plt` imported using
    `import matplotlib.pyplot as plt`.

    Args:
        avranks (list of float): average ranks of methods.
        names (list of str): names of methods.
        cd (float): Critical difference used for statistically significance of
            difference between methods.
        cdmethod (int, optional): the method that is compared with other methods
            If omitted, show pairwise comparison of methods
        lowv (int, optional): the lowest shown rank
        highv (int, optional): the highest shown rank
        width (int, optional): default width in inches (default: 6)
        textspace (int, optional): space on figure sides (in inches) for the
            method names (default: 1)
        reverse (bool, optional):  if set to `True`, the lowest rank is on the
            right (default: `False`)
        filename (str, optional): output file name (with extension). If not
            given, the function does not write a file.
    """
    try:
        import matplotlib.pyplot as plt
        from matplotlib.backends.backend_agg import FigureCanvasAgg
    except ImportError:
        raise ImportError("Function graph_ranks requires matplotlib.")

    width = float(width)
    textspace = float(textspace)

    def nth(l, n):
        """
        Returns only nth elemnt in a list.
        """
        n = lloc(l, n)
        return [a[n] for a in l]

    def lloc(l, n):
        """
        List location in list of list structure.
        Enable the use of negative locations:
        -1 is the last element, -2 second last...
        """
        if n < 0:
            return len(l[0]) + n
        else:
            return n

    def mxrange(lr):
        """
        Multiple xranges. Can be used to traverse matrices.
        This function is very slow due to unknown number of
        parameters.

        >>> mxrange([3,5])
        [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]

        >>> mxrange([[3,5,1],[9,0,-3]])
        [(3, 9), (3, 6), (3, 3), (4, 9), (4, 6), (4, 3)]

        """
        if not len(lr):
            yield ()
        else:
            # it can work with single numbers
            index = lr[0]
            if isinstance(index, int):
                index = [index]
            for a in range(*index):
                for b in mxrange(lr[1:]):
                    yield tuple([a] + list(b))

    def print_figure(fig, *args, **kwargs):
        canvas = FigureCanvasAgg(fig)
        canvas.print_figure(*args, **kwargs)

    sums = avranks

    tempsort = sorted([(a, i) for i, a in enumerate(sums)], reverse=reverse)
    ssums = nth(tempsort, 0)
    sortidx = nth(tempsort, 1)
    nnames = [names[x] for x in sortidx]

    if lowv is None:
        lowv = min(1, int(math.floor(min(ssums))))
    if highv is None:
        highv = max(len(avranks), int(math.ceil(max(ssums))))

    cline = 0.4

    k = len(sums)

    lines = None

    linesblank = 0
    scalewidth = width - 2 * textspace

    def rankpos(rank):
        if not reverse:
            a = rank - lowv
        else:
            a = highv - rank
        return textspace + scalewidth / (highv - lowv) * a

    distanceh = 0.25

    if cd and cdmethod is None:
        # get pairs of non significant methods

        def get_lines(sums, hsd):
            # get all pairs
            lsums = len(sums)
            allpairs = [(i, j) for i, j in mxrange([[lsums], [lsums]]) if j > i]
            # remove not significant
            notSig = [(i, j) for i, j in allpairs
                      if abs(sums[i] - sums[j]) <= hsd]
            # keep only longest

            def no_longer(ij_tuple, notSig):
                i, j = ij_tuple
                for i1, j1 in notSig:
                    if (i1 <= i and j1 > j) or (i1 < i and j1 >= j):
                        return False
                return True

            longest = [(i, j) for i, j in notSig if no_longer((i, j), notSig)]

            return longest

        lines = get_lines(ssums, cd)
        linesblank = 0.2 + 0.2 + (len(lines) - 1) * 0.1

        # add scale
        distanceh = 0.25
        cline += distanceh

    # calculate height needed height of an image
    minnotsignificant = max(2 * 0.2, linesblank)
    height = cline + ((k + 1) / 2) * 0.2 + minnotsignificant

    fig = plt.figure(figsize=(width, height))
    fig.set_facecolor('white')
    ax = fig.add_axes([0, 0, 1, 1])  # reverse y axis
    ax.set_axis_off()

    hf = 1. / height  # height factor
    wf = 1. / width

    def hfl(l):
        return [a * hf for a in l]

    def wfl(l):
        return [a * wf for a in l]


    # Upper left corner is (0,0).
    ax.plot([0, 1], [0, 1], c="w")
    ax.set_xlim(0, 1)
    ax.set_ylim(1, 0)

    def line(l, color='k', **kwargs):
        """
        Input is a list of pairs of points.
        """
        ax.plot(wfl(nth(l, 0)), hfl(nth(l, 1)), color=color, **kwargs)

    def text(x, y, s, *args, **kwargs):
        ax.text(wf * x, hf * y, s, *args, **kwargs)

    line([(textspace, cline), (width - textspace, cline)], linewidth=0.7)

    bigtick = 0.1
    smalltick = 0.05

    tick = None
    for a in list(np.arange(lowv, highv, 0.5)) + [highv]:
        tick = smalltick
        if a == int(a):
            tick = bigtick
        line([(rankpos(a), cline - tick / 2),
              (rankpos(a), cline)],
             linewidth=0.7)

    for a in range(lowv, highv + 1):
        text(rankpos(a), cline - tick / 2 - 0.05, str(a),
             ha="center", va="bottom")

    k = len(ssums)

    for i in range(math.ceil(k / 2)):
        chei = cline + minnotsignificant + i * 0.2
        line([(rankpos(ssums[i]), cline),
              (rankpos(ssums[i]), chei),
              (textspace - 0.1, chei)],
             linewidth=0.7)
        text(textspace - 0.2, chei, nnames[i], ha="right", va="center")

    for i in range(math.ceil(k / 2), k):
        chei = cline + minnotsignificant + (k - i - 1) * 0.2
        line([(rankpos(ssums[i]), cline),
              (rankpos(ssums[i]), chei),
              (textspace + scalewidth + 0.1, chei)],
             linewidth=0.7)
        text(textspace + scalewidth + 0.2, chei, nnames[i],
             ha="left", va="center")

    if cd and cdmethod is None:
        # upper scale
        if not reverse:
            begin, end = rankpos(lowv), rankpos(lowv + cd)
        else:
            begin, end = rankpos(highv), rankpos(highv - cd)

        line([(begin, distanceh), (end, distanceh)], linewidth=0.7)
        line([(begin, distanceh + bigtick / 2),
              (begin, distanceh - bigtick / 2)],
             linewidth=0.7)
        line([(end, distanceh + bigtick / 2),
              (end, distanceh - bigtick / 2)],
             linewidth=0.7)
        text((begin + end) / 2, distanceh - 0.05, "CD",
             ha="center", va="bottom")

        # no-significance lines
        def draw_lines(lines, side=0.05, height=0.1):
            start = cline + 0.2
            for l, r in lines:
                line([(rankpos(ssums[l]) - side, start),
                      (rankpos(ssums[r]) + side, start)],
                     linewidth=2.5)
                start += height

        draw_lines(lines)

    elif cd:
        begin = rankpos(avranks[cdmethod] - cd)
        end = rankpos(avranks[cdmethod] + cd)
        line([(begin, cline), (end, cline)],
             linewidth=2.5)
        line([(begin, cline + bigtick / 2),
              (begin, cline - bigtick / 2)],
             linewidth=2.5)
        line([(end, cline + bigtick / 2),
              (end, cline - bigtick / 2)],
             linewidth=2.5)

    if filename:
        print_figure(fig, filename, **kwargs)

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
user