def single_out_category(self, options):
        """Singles out the votes for a chosen category and returns a prediction
           for this category iff the number of votes reaches at least the given
           threshold.

        """
        if options is None or any(option not in options for option in
                                  ["threshold", "category"]):
            raise Exception("No category and threshold information was"
                            " found. Add threshold and category info."
                            " E.g. {\"threshold\": 6, \"category\":"
                            " \"Iris-virginica\"}.")
        length = len(self.predictions)
        if options["threshold"] > length:
            raise Exception("You cannot set a threshold value larger than "
                            "%s. The ensemble has not enough models to use"
                            " this threshold value." % length)
        if options["threshold"] < 1:
            raise Exception("The threshold must be a positive value")
        category_predictions = []
        rest_of_predictions = []
        for prediction in self.predictions:
            if prediction['prediction'] == options["category"]:
                category_predictions.append(prediction)
            else:
                rest_of_predictions.append(prediction)
        if len(category_predictions) >= options["threshold"]:
            return MultiVote(category_predictions)
        return MultiVote(rest_of_predictions)
dataset/ETHPy150Open bigmlcom/python/bigml/multivote.py/MultiVote.single_out_category/original