コード例 #1
0
ファイル: test_modules.py プロジェクト: vandana-11/cognito
def test_encoding_categorical_2():
    check = Check()
    df = pd.read_csv(
        os.path.join(os.path.dirname(__file__), 'data', 'student.csv'))
    assert check.encoding_categorical(df['sex']) == ([0, 0, 0, 0, 0, 1, 1,
                                                      0], {
                                                          0: 'F',
                                                          1: 'F'
                                                      })
コード例 #2
0
ファイル: test_modules.py プロジェクト: vandana-11/cognito
def test_encoding_categorical_1():
    check = Check()
    df = pd.read_csv(
        os.path.join(os.path.dirname(__file__), 'data', 'cereal.csv'))
    assert check.encoding_categorical(df['mfr']) == ([1, 2, 0, 0, 3, 1], {
        1: 'Q',
        2: 'K',
        0: 'N',
        3: 'K'
    })
コード例 #3
0
ファイル: test_modules.py プロジェクト: vandana-11/cognito
def test_encoding_categorical_3():
    check = Check()
    df = pd.read_csv(
        os.path.join(os.path.dirname(__file__), 'data', 'student.csv'))
    assert check.encoding_categorical(df['Mjob']) == ([0, 0, 0, 1, 2, 3, 2,
                                                       2], {
                                                           0: 'at_home',
                                                           1: 'at_home',
                                                           2: 'at_home',
                                                           3: 'health'
                                                       })