LightGBM tuning
This commit is contained in:
7
train.py
7
train.py
@@ -42,13 +42,8 @@ def train_model_with_kfold(
|
||||
|
||||
if smote:
|
||||
if smote_method.lower() == "kmeans":
|
||||
from collections import Counter
|
||||
minority = Counter(y_train)[1]
|
||||
|
||||
k_neighbors = min(10, max(2, minority // 10))
|
||||
|
||||
sampler = KMeansSMOTE(
|
||||
k_neighbors=k_neighbors,
|
||||
k_neighbors=15,
|
||||
cluster_balance_threshold=0.1,
|
||||
random_state=random_state,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user