示例#1
0
def train_production_models(best_models):
    """
    Prepares all the production models
    :param best_models:
    :return: list of 4 models lists with trained models
    """
    hogwarts_df = load_processed_data()

    slitherin_model = train_single_production_model(hogwarts_df, best_models[0], 'is_slitherin')
    griffindor_model = train_single_production_model(hogwarts_df, best_models[1], 'is_griffindor')
    ravenclaw_model = train_single_production_model(hogwarts_df, best_models[2], 'is_ravenclaw')
    hufflpuff_model = train_single_production_model(hogwarts_df, best_models[3], 'is_hufflpuff')

    return slitherin_model, griffindor_model, ravenclaw_model, hufflpuff_model
示例#2
0
def train_all_models():
    """
    Trains models for each faculty.
    :return: list of 4 models lists with trained models
    """

    hogwarts_df = load_processed_data()

    slitherin_models = get_faculty_models(hogwarts_df, 'is_slitherin')
    griffindor_models = get_faculty_models(hogwarts_df, 'is_griffindor')
    ravenclaw_models = get_faculty_models(hogwarts_df, 'is_ravenclaw')
    hufflpuff_models = get_faculty_models(hogwarts_df, 'is_hufflpuff')

    return slitherin_models, griffindor_models, ravenclaw_models, hufflpuff_models
示例#3
0
def train_production_models(best_models):
    """
    Prepares all the production models
    :param best_models:
    :return: list of 4 models lists with trained models
    """
    fict_df = load_processed_data()

    fem_model = train_single_production_model(fict_df, best_models[0],
                                              'is_fem')
    fict_model = train_single_production_model(fict_df, best_models[1],
                                               'is_fict')
    fim_model = train_single_production_model(fict_df, best_models[2],
                                              'is_fim')
    gef_model = train_single_production_model(fict_df, best_models[3],
                                              'is_gef')

    return fem_model, fict_model, fim_model, gef_model
示例#4
0
def train_all_models():
    """
    Trains models for each faculty.
    :return: list of 4 models lists with trained models
    """

    fict_df = load_processed_data()

    fem_model = train_single_production_model(fict_df, best_models[0],
                                              'is_fem')
    fict_model = train_single_production_model(fict_df, best_models[1],
                                               'is_fict')
    fim_model = train_single_production_model(fict_df, best_models[2],
                                              'is_fim')
    gef_model = train_single_production_model(fict_df, best_models[3],
                                              'is_gef')

    return fem_model, fict_model, fim_model, gef_model
示例#5
0
from notebooks.model_training import train_classifiers
from data_loaders import load_processed_data
import warnings
warnings.filterwarnings('ignore')

# Загружаем данные
fict_df = load_processed_data()

# Оставляем только нужные колонки
data_full = fict_df.drop(['name', 'surname', 'is_fict', 'is_fim', 'is_gef'],
                         axis=1).copy()
X_data = data_full.drop('is_fem', axis=1)
y = data_full.is_fem

# Проводим исследование моделей
print("123")
fem_models = train_classifiers(X_data, y)

score_testing_dataset(fem_models[5])