gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 23:12:29 43 4
gpt4 key购买 nike

我有这个代码:

从 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/

    43 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com