Modify script
This commit is contained in:
parent
3ebd13aca1
commit
f975a3e735
2000
dev-0/out.tsv
2000
dev-0/out.tsv
File diff suppressed because it is too large
Load Diff
7
main.py
7
main.py
@ -29,7 +29,7 @@ def get_train_data(names: list):
|
|||||||
train_path = os.path.join(MAIN_DIR, TRAIN_DIR, TRAIN_FILE_NAME)
|
train_path = os.path.join(MAIN_DIR, TRAIN_DIR, TRAIN_FILE_NAME)
|
||||||
check_file(train_path)
|
check_file(train_path)
|
||||||
train_data = process_input(pandas.read_csv(
|
train_data = process_input(pandas.read_csv(
|
||||||
train_path, header=None, sep=VALUE_SEP, names=names))
|
train_path, header=None, sep=VALUE_SEP, names=names), names)
|
||||||
|
|
||||||
train_data = train_data.loc[(train_data[names[0]] > 1000)]
|
train_data = train_data.loc[(train_data[names[0]] > 1000)]
|
||||||
|
|
||||||
@ -42,10 +42,11 @@ def get_train_data(names: list):
|
|||||||
def get_input_data(dirname, names):
|
def get_input_data(dirname, names):
|
||||||
in_path = os.path.join(dirname, IN_FILE_NAME)
|
in_path = os.path.join(dirname, IN_FILE_NAME)
|
||||||
check_file(in_path)
|
check_file(in_path)
|
||||||
return process_input(pandas.read_csv(in_path, header=None, sep=VALUE_SEP, names=names[1:]))
|
return process_input(pandas.read_csv(in_path, header=None, sep=VALUE_SEP, names=names[1:]), names)
|
||||||
|
|
||||||
|
|
||||||
def process_input(df):
|
def process_input(df, names):
|
||||||
|
df = df.drop([names[4]], axis=1)
|
||||||
for c in df.select_dtypes(include=object).columns.values:
|
for c in df.select_dtypes(include=object).columns.values:
|
||||||
df[c] = df[c].astype(CATEGORY_TYPE).cat.codes
|
df[c] = df[c].astype(CATEGORY_TYPE).cat.codes
|
||||||
return df
|
return df
|
||||||
|
2000
test-A/out.tsv
2000
test-A/out.tsv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user