JuliaML / MLDataUtils.jl

Utility package for generating, loading, splitting, and processing Machine Learning datasets
http://mldatautilsjl.readthedocs.io/
Other
102 stars 20 forks source link

handle integer matrix for feature_scaling #21

Closed asbisen closed 7 years ago

asbisen commented 7 years ago

@Evizero made a small change to ensure integer matrix can be used for FeatureNormalizer

Evizero commented 7 years ago

Thanks for working on this!

Hm, I don't think that is a good way to achieve the effect you want. predict! with a ! is supposed to be mutating, so copying the input data circumvents that.

Probably the cleanest way to do it would be to adapt predict.

  1. change https://github.com/JuliaML/MLDataUtils.jl/blob/dev/src/feature_scaling.jl#L79 to T<:AbstractFloat
  2. add a new predict for T<:Real that uses convert(Array{Float64}, ...) instead of copy(...)
asbisen commented 7 years ago

thanks for guidance, makes complete sense. I will close this pull request and open a new one.