69f972b898870734f36a8fd181fbc052037a9926,mindsdb/libs/phases/data_transformer/data_transformer.py,DataTransformer,run,#DataTransformer#Any#,91
Before Change
valid_rows = df[df[column] == val]
while max_val_occurances > len(valid_rows) + len(df):
df = df.append(valid_rows)
df = df.append(valid_rows[0:int(max_val_occurances - (len(valid_rows) + len(df)))])
After Change
else:
dfs = [input_data.train_df, input_data.test_df, input_data.validation_df]
for i in range(len(dfs)):
valid_rows = dfs[i][dfs[i][column] == val]
while max_val_occurances > len(valid_rows) + len(dfs[i]):
dfs[i] = dfs[i].append(valid_rows)
dfs[i] = dfs[i].append(valid_rows[0:int(max_val_occurances - (len(valid_rows) + len(dfs[i])))])
print("\n\n-----------------\n\n")
for df in [input_data.train_df, input_data.test_df, input_data.validation_df]:
print(len(df[df["default.payment.next.month"] == "0"]))
print(len(df[df["default.payment.next.month"] == "1"]))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: mindsdb/mindsdb
Commit Name: 69f972b898870734f36a8fd181fbc052037a9926
Time: 2019-11-20
Author: george@cerebralab.com
File Name: mindsdb/libs/phases/data_transformer/data_transformer.py
Class Name: DataTransformer
Method Name: run
Project Name: mindsdb/mindsdb
Commit Name: 69f972b898870734f36a8fd181fbc052037a9926
Time: 2019-11-20
Author: george@cerebralab.com
File Name: mindsdb/libs/phases/data_transformer/data_transformer.py
Class Name: DataTransformer
Method Name: run
Project Name: shibing624/pycorrector
Commit Name: e21644bf114eefd6f6cbede2e45ce9eb2c59dfe9
Time: 2018-09-12
Author: 507153809@qq.com
File Name: pycorrector/seq2seq/preprocess.py
Class Name:
Method Name: parse_xml_file
Project Name: apache/incubator-tvm
Commit Name: 6770d28a844597e064b2e0902a36207ff877857d
Time: 2020-09-03
Author: kevinthesunwy@gmail.com
File Name: python/tvm/relay/frontend/tensorflow.py
Class Name: GraphProto
Method Name: _get_relay_func