Skip to content

Failure to properly preprocess categorical data #652

@williamty

Description

@williamty

There're some categorical columns in my dataset which are stored by numbers. So I checked data_info.json file to see if they are preprocessed. Unfortunately, all of them are not recognized by mljar. Then I use the following code to convert these columns to categorical manually.

with open('enum.txt', 'r') as enum_file:
    categorical_columns = enum_file.read().splitlines()
for col in categorical_columns:
    df[col] = df[col].astype("category")

After doing this, I got an error:

ValueError: pandas dtypes must be int, float or bool.
Fields with bad pandas dtypes: target: category

It seems that mljar can't preprocess categorical data stored in numbers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions