Exemplo n.º 1
0
def prepare_data():
    static_data = write_database()
    project_data_manager = ProjectsDataManager(static_data, is_test=False)

    nwp_response = project_data_manager.nwp_extractor()
    if nwp_response == DONE:
        data_response = project_data_manager.create_datasets()
    else:
        raise RuntimeError('Something was going wrong with nwp extractor')

    if data_response == DONE:
        project_data_manager.create_projects_relations()
    else:
        raise RuntimeError('Something was going wrong with data manager')

    if hasattr(project_data_manager, 'data_eval'):
        project_data_manager.is_test = True
        nwp_response = project_data_manager.nwp_extractor()
        if nwp_response == DONE:
            nwp_response = project_data_manager.create_datasets()
            if nwp_response != DONE:
                raise RuntimeError(
                    'Something was going wrong with on evaluation dataset creator'
                )
        else:
            raise RuntimeError(
                'Something was going wrong with nwp extractor on evaluation')
    print("Data is prepared, training can start")
Exemplo n.º 2
0
def prepare_data():
    static_data = write_database()

    project_data_manager = ProjectsDataManager(static_data)

    nwp_response = project_data_manager.nwp_extractor(test=False)
    if nwp_response == 'Done':
        data_response = project_data_manager.create_datasets(test=False)
    else:
        raise RuntimeError('Something was going wrong with NWP extractor')

    if data_response == 'Done':
        project_data_manager.create_projects_relations()
    else:
        raise RuntimeError('Something was going wrong with data manager')

    if hasattr(project_data_manager, 'data_eval'):
        nwp_response = project_data_manager.nwp_extractor(test=True)
        if nwp_response == 'Done':
            _ = project_data_manager.create_datasets(test=True)
        else:
            raise RuntimeError(
                'Something was going wrong with NWP extractor on evaluation')
Exemplo n.º 3
0
def backup_project():
    static_data = write_database()

    project_backup_manager = ProjectsTrainManager(static_data)
    project_backup_manager.clear_backup_projects()
Exemplo n.º 4
0
def eval_project():
    static_data = write_database()
    project_eval_manager = ProjectsEvalManager(static_data)
    project_eval_manager.evaluate()
Exemplo n.º 5
0
def train_project():
    static_data = write_database()
    project_train_manager = ProjectsTrainManager(static_data)
    project_train_manager.fit()