python-3.x - 如何修复 : No samples will be generated with the provided ratio settings. (imblearn)

标签 python-3.x scikit-learn resampling imblearn

我有这个代码:

从 imblearn.over_sampling 导入 ADASYN

Y = df.target
X = df.drop('target', axis=1)

ad = ADASYN()
X_adasyn, y_adasyn = ad.fit_sample(X, Y)

getting this error:

ValueError: No samples will be generated with the provided ratio 
settings.

最佳答案

我也遇到了这个问题,终于解决了!

  • 你应该使用sampling_strategy 而不是ratio
  • 采样策略='少数'

  • 我尝试了其他选项,例如 'not_majority' 、'auto' 和字典形式,它们都给出了以下错误

    Value Error: No samples will be generated with the provided ratio settings



    但“少数派”奏效了。

    关于python-3.x - 如何修复 : No samples will be generated with the provided ratio settings. (imblearn),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56100127/

    相关文章:

    python - 使用 GMAIL API 阅读最近 20 条消息

    python - 用 python 和 re 清理文本

    python - 预测: Time-series prediction of future events using SVR module

    python - 在 how= of resample 中插入新的不存在的列

    python - 基于列标准的 Panda Dataframe 重采样

    python-3.x - 从 pandas 数据框到元组(对于半正矢模块)

    python - 如何在 Python 中遍历 cur.fetchall()

    python - Scikit - SGDRegressor 不适合

    pandas - 由于 "reshaping"问题,无法在 scikit-Learn 中进行线性回归

    haskell - 具有惰性语义的高效理性重采样