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' })
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' })
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' })