(cls, results, target_class=None, model_index=None)
return cls(actual == target_class, probs)
Construct an instance of `Curves` from test results.

        Args:
            results (:obj:`Orange.evaluation.testing.Results`): test results
            target_class (int): target class index; if the class is binary,
                this defaults to `1`, otherwise it must be given
            model_index (int): model index; if there is only one model, this
                argument can be omitted

        Returns:
            curves (:obj:`Curves`)
Construct an instance of `Curves` from test results.
Construct an instance of Curves from test results .
def from_results(cls, results, target_class=None, model_index=None):
        """
        Construct an instance of `Curves` from test results.

        Args:
            results (:obj:`Orange.evaluation.testing.Results`): test results
            target_class (int): target class index; if the class is binary,
                this defaults to `1`, otherwise it must be given
            model_index (int): model index; if there is only one model, this
                argument can be omitted

        Returns:
            curves (:obj:`Curves`)
        """
        if model_index is None:
            if results.probabilities.shape[0] != 1:
                raise ValueError("Argument 'model_index' is required when "
                                 "there are multiple models")
            model_index = 0
        if target_class is None:
            if results.probabilities.shape[2] != 2:
                raise ValueError("Argument 'target_class' is required when the "
                                 "class is not binary")
            target_class = 1
        actual = results.actual
        probs = results.probabilities[model_index, :, target_class]
        nans = np.isnan(actual) + np.isnan(probs)
        if nans.any():
            actual = actual[~nans]
            probs = probs[~nans]
        return cls(actual == target_class, probs)
def from_results ( cls , results , target_class = None , model_index = None ) : if model_index is None : if results . probabilities . shape [ 0 ] != 1 : raise ValueError ( "Argument 'model_index' is required when " "there are multiple models" ) model_index = 0 if target_class is None : if results . probabilities . shape [ 2 ] != 2 : raise ValueError ( "Argument 'target_class' is required when the " "class is not binary" ) target_class = 1 actual = results . actual probs = results . probabilities [ model_index , : , target_class ] nans = np . isnan ( actual ) + np . isnan ( probs ) if nans . any ( ) : actual = actual [ ~ nans ] probs = probs [ ~ nans ] return cls ( actual == target_class , probs )