okfn-brasil/serenata-de-amor

View on GitHub
rosie/rosie/chamber_of_deputies/classifiers/election_expenses_classifier.py

Summary

Maintainability
A
0 mins
Test Coverage
from sklearn.base import TransformerMixin


ELECTION_LEGAL_ENTITY = '409-0 - CANDIDATO A CARGO POLITICO ELETIVO'

class ElectionExpensesClassifier(TransformerMixin):
    """
    Election Expenses classifier.

    Check a `legal_entity` field for the presency of the political candidacy
    category in the Brazilian Federal Revenue.

    Dataset
    -------
    legal_entity : string column
        Brazilian Federal Revenue category of companies, preceded by its code.
    """

    def fit(self, dataframe):
        pass

    def transform(self, dataframe=None):
        pass

    def predict(self, dataframe):
        return dataframe['legal_entity'] == ELECTION_LEGAL_ENTITY