(X, y, sampler, ax)
return Counter(y_res)
Plot the resampled dataset using the sampler.
Plot the resampled dataset using the sampler.
Plot the resampled dataset using the sampler .
def plot_resampling(X, y, sampler, ax):
    """Plot the resampled dataset using the sampler."""
    X_res, y_res = sampler.fit_resample(X, y)
    ax.scatter(X_res[:, 0], X_res[:, 1], c=y_res, alpha=0.8, edgecolor="k")
    sns.despine(ax=ax, offset=10)
    ax.set_title(f"Decision function for {sampler.__class__.__name__}")
    return Counter(y_res)
def plot_resampling ( X , y , sampler , ax ) : X_res , y_res = sampler . fit_resample ( X , y ) ax . scatter ( X_res [ : , 0 ] , X_res [ : , 1 ] , c = y_res , alpha = 0.8 , edgecolor = "k" ) sns . despine ( ax = ax , offset = 10 ) ax . set_title ( f"Decision function for {sampler.__class__.__name__}" ) return Counter ( y_res )