Skip to content
Snippets Groups Projects
Commit ec615fb7 authored by jh1724's avatar jh1724
Browse files

try add smote

parent e68ee843
No related branches found
No related tags found
No related merge requests found
......@@ -94,8 +94,8 @@ def main():
# use SMOTE to handle imbalanced data
# smote = SMOTE(sampling_strategy='auto', random_state=21)
# x_resampled, y_resampled = smote.fit_resample(training_x, training_y)
smote = SMOTE(sampling_strategy='auto', random_state=21)
x_resampled, y_resampled = smote.fit_resample(training_x, training_y)
# Train a MLP model
model = MLPClassifier(
......@@ -103,7 +103,7 @@ def main():
early_stopping=True,
hidden_layer_sizes=(64, 128, 64),
random_state=62)
model.fit(training_x, training_y)
model.fit(x_resampled, y_resampled)
predictions = model.predict(testing_x)
# Make predictions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment