Пример #1
0
def prepare(mode, inp, out):
    """ Transform the given dataset file """

    if mode == 'help':
        # log("Cognito CLI", color="blue", figlet=True)
        click.echo(custom_fig.renderText('cognito'))

    if mode == 'prepare':

        df = Table(inp)
        response, encoder = df.generate()
        click.echo(save_to(out, response, encoder))

    if mode == 'autoML':
        df = Table(inp)
        click.echo(df.total_columns())

    if mode == 'report':

        df = Table(inp)

        table = PrettyTable([
            'Features', 'Feature Type', 'Outliers', '% of outliers', 'Missing',
            '%of missing'
        ])

        for col in df.columns():
            table.add_row([col, '', '', '', '', ''])
        click.echo(table)

    if mode == 'decode':

        with trange(11) as t:
            for i in t:
                t.set_description('C(x) decoding %i' % i)
                sleep(0.1)
        click.echo('Completed decoding')
        click.echo(get_all_files())
Пример #2
0
def test_table_total_columns_three():
    data = Table(
        os.path.join(os.path.dirname(__file__), 'data', 'Freedman.csv'))
    assert data.total_columns() == 5
Пример #3
0
def test_table_total_columns_two():
    data = Table(os.path.join(os.path.dirname(__file__), 'data',
                              'student.csv'))
    assert data.total_columns() == 4
Пример #4
0
def test_table_total_columns_one():
    data = Table(os.path.join(os.path.dirname(__file__), 'data', 'cereal.csv'))
    assert data.total_columns() == 6