File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -233,11 +233,10 @@ def run():
233233
234234 print(f"localDataType: {localDataType}")
235235
236+ columns_to_encode = [col for col in filtered_df.columns if col != bias_variable]
236237 if localDataType == 'categorical':
237238 encoder = OrdinalEncoder()
238- columns_to_encode = [col for col in filtered_df.columns if col != bias_variable]
239239 filtered_df[columns_to_encode] = encoder.fit_transform(filtered_df[columns_to_encode])
240- # filtered_df[filtered_df.columns] = encoder.fit_transform(filtered_df).astype("int64")
241240
242241 print("filtered_df.dtypes:")
243242 print(filtered_df.dtypes)
@@ -409,11 +408,10 @@ def run():
409408 print("test_df:")
410409 print(test_df)
411410
411+ test_df_pred = test_df[columns_to_encode]
412412 if localDataType == 'categorical':
413- # decode X_test using the encoder
414- test_df_pred = test_df[columns_to_encode]
413+ # decode X_test using the encoder
415414 decoded_X_test = encoder.inverse_transform(test_df_pred)
416-
417415
418416 # display the decoded DataFrame
419417 decoded_X_test = pd.DataFrame(decoded_X_test, columns=test_df_pred.columns)
You can’t perform that action at this time.
0 commit comments