Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/preprocessing/test_target_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ def test_target_encoder_transform_new_category_linear_regression_median(self):
'neutral', 'positive'],
'target': [5, 4, -5, 0, -4, 5, -5, 0, 1, 0, 4]})

df_appended = df.append({"variable": "new", "target": 10},
ignore_index=True)

new_row = pd.DataFrame({"variable": ["new"], "target": [10]})
df_appended = pd.concat([df, new_row], ignore_index=True)
# inputs of TargetEncoder will be of dtype category
df["variable"] = df["variable"].astype("category")
df_appended["variable"] = df_appended["variable"].astype("category")
Expand All @@ -335,8 +335,8 @@ def test_target_encoder_transform_new_category_binary_classification_median(self
'neutral'],
'target': [1, 1, 0, 0, 1, 0, 0, 0, 1, 1]})

df_appended = df.append({"variable": "new", "target": 1},
ignore_index=True)
new_row = pd.DataFrame({"variable": ["new"], "target": [1]})
df_appended = pd.concat([df, new_row], ignore_index=True)

# inputs of TargetEncoder will be of dtype category
df["variable"] = df["variable"].astype("category")
Expand Down