Skip to content

Expectations about types in ratios seem too strict #123

Description

@ablaom
julia> oversampler = SMOTE(rng=stable_rng(), ratios=Dict("negative"=>1, "positive"=>0.5))
ERROR: MethodError: no method matching var"#SMOTE#3"(::Int64, ::Dict{String, Real}, ::StableRNGs.LehmerRNG, ::Bool, ::Type{Imbalance.MLJ.SMOTE})
The function `#SMOTE#3` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  var"#SMOTE#3"(::Integer, ::Union{Nothing, AbstractFloat, Dict{T, <:AbstractFloat}}, ::Union{Integer, Random.AbstractRNG}, ::Bool, ::Type{Imbalance.MLJ.SMOTE}) where T        
   @ Imbalance ~/.julia/packages/Imbalance/LFVkH/src/oversampling_methods/smote/interface_mlj.jl:30                                                                         

Stacktrace:
 [1] top-level scope
   @ REPL[343]:1

This error message is not too helpful for beginners. The problem is that "negative"=>1 needs to be "negative"=>1.0. We ought to just allow mixed data here, no?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions