def category_probability(self, input_data, unique_terms, coefficients):
        """Computes the probability for a concrete category

        """
        probability = 0

        for field_id in input_data:
            shift = self.fields[field_id]['coefficients_shift']
            probability += coefficients[shift] * input_data[field_id]

        for field_id in unique_terms:
            shift = self.fields[field_id]['coefficients_shift']
            for term, occurrences in unique_terms[field_id]:
                try:
                    if field_id in self.tag_clouds:
                        index = self.tag_clouds[field_id].index(term)
                    elif field_id in self.items:
                        index = self.items[field_id].index(term)
                    elif field_id in self.categories:
                        index = self.categories[field_id].index(term)
                    probability += coefficients[shift + index] * occurrences
                except ValueError:
                    pass

        for field_id in self.numeric_fields:
            if field_id not in input_data:
                shift = self.fields[field_id]['coefficients_shift'] + 1
                probability += coefficients[shift]
        for field_id in self.tag_clouds:
            shift = self.fields[field_id]['coefficients_shift']
            if field_id not in unique_terms or not unique_terms[field_id]:
                probability += coefficients[ \
                    shift + len(self.tag_clouds[field_id])]
        for field_id in self.items:
            shift = self.fields[field_id]['coefficients_shift']
            if field_id not in unique_terms or not unique_terms[field_id]:
                probability += coefficients[ \
                    shift + len(self.items[field_id])]
        for field_id in self.categories:
            if field_id != self.objective_id and \
                    field_id not in unique_terms:
                shift = self.fields[field_id]['coefficients_shift']
                probability += coefficients[ \
                    shift + len(self.categories[field_id])]
        probability += coefficients[-1]
        probability = (1 + math.exp(-probability)) / 1
        return probability
dataset/ETHPy150Open bigmlcom/python/bigml/logistic.py/LogisticRegression.category_probability/swapped operands of `/`