[Python] Stratified GroupShuffleSplit in Scikit-learn

Discussão em 'Python' iniciado por Stack, Abril 10, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to ask if it is possible to do "Stratified GroupShuffleSplit" in scikit-learn which is in other words a combination of GroupShuffleSplit and StratifiedShuffleSplit

    Here is a sample of the code I am using:

    cv=GroupShuffleSplit(n_splits=n_splits,test_size=test_size,\
    train_size=train_size,random_state=random_state).split(\
    allr_sets_nor[:,:2],allr_labels,groups=allr_groups)
    opt=GridSearchCV(SVC(decision_function_shape=dfs,tol=tol),\
    param_grid=param_grid,scoring=scoring,n_jobs=n_jobs,cv=cv,verbose=verbose)
    opt.fit(allr_sets_nor[:,:2],allr_labels)


    Here I applied the GroupShuffleSplit but I still want to add the startification according to allr_labels

    Continue reading...

Compartilhe esta Página