<commit_before>import numpy as np
import pandas as pd
import word_count as wc
from sklearn import preprocessing
from sklearn.naive_bayes import MultinomialNB

from .basic_utils import create_widget
from .basic_utils import extract_logbook_data
from .basic_utils import remove_undesired_columns

from .config import *


class LogbookClassifier:

    def __init__(self):

        logbook_data = extract_logbook_data('CLIWOC15.csv')
        undesired_columns = remove_undesired_columns(logbook_data, desired_columns)
        self.logbook_data = logbook_data.drop(undesired_columns, axis=1)

        mentions_slaves = wc.count_key_words(logbook_data,
                                                text_columns, slave_words)
        slave_index = mentions_slaves[(mentions_key_words['ContainsKeyWord'] != 0)].index<commit_msg>added desired functions to classification.py<commit_after>import numpy as np
import pandas as pd
import word_count as wc
from sklearn import preprocessing
from sklearn.naive_bayes import MultinomialNB

from .basic_utils import create_widget
from .basic_utils import extract_logbook_data
from .basic_utils import remove_undesired_columns

from .config import *


class LogbookClassifier:

    def __init__(self):

        logbook_data = extract_logbook_data('CLIWOC15.csv')
        undesired_columns = remove_undesired_columns(logbook_data, desired_columns)
        self.logbook_data = logbook_data.drop(undesired_columns, axis=1)

        mentions_slaves = wc.count_key_words(logbook_data,
                                                text_columns, slave_words)
        slave_index = mentions_slaves[(mentions_key_words['ContainsKeyWord'] != 0)].index

        self.slave_logs = self.logbook_data.loc[slave_index.values]

    def separate_voyages(self):
        pass

    def encode_data(self):
        pass

    def fit_classifier(self):
        pass

    def predict(self, voyages):
        pass
{'fraction_non_alphanumeric': 0.060842433697347896, 'fraction_numerical': 0.004160166406656267, 'mean_word_length': 3.5270588235294116, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4579243', 'n_tokens_mistral': 587, 'n_tokens_neox': 557, 'n_words': 126}