Skip to content

Commit

Permalink
Update svm.py - indentation
Browse files Browse the repository at this point in the history
Minor: indentation problem solved on l.97
  • Loading branch information
floriancafiero authored Feb 17, 2024
1 parent 51eeaf7 commit 4650daf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion superstyl/svm.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def train_svm(train, test, cross_validate=None, k=10, dim_reduc=None, norms=True
min_class_size = min(Counter(classes).values())
n_neighbors = min(5, min_class_size - 1) # Default n_neighbors in SMOTE is 5
# In case we have to temper with the n_neighbors, we print a warning message to the user (might be written more clearly, but we want a short message, right?)
if n_neighbors >= min_class_size:
if n_neighbors >= min_class_size:
print(f"Warning: Adjusting n_neighbors for SMOTE / SMOTETomek to {n_neighbors} due to small class size.")
if balance == 'SMOTE':
estimators.append(('sampling', over.SMOTE(n_neighbors=n_neighbors, random_state=42)))
Expand Down

0 comments on commit 4650daf

Please sign in to comment.