berndbischl / BBmisc

Other
20 stars 7 forks source link

Bug in normalize #51

Closed danielhorn closed 9 years ago

danielhorn commented 9 years ago

Doku says: For data.frames, only the numeric columns are touched, all others are left unchanged.

But normalize(iris) drops the class col, all non-numeric cols seems to be dropped.

Can I fix it? Or do you want the function to drop non-numeric cols?

jakob-r commented 9 years ago

Yes. Fix would be nice. It even says so in the description For data.frames, only the numeric columns are touched, all others are left unchanged. So it doesn't work as intended. Note: We call that function in mlr::normalizeFeatures where me already make sure that it only deals with numerics.

danielhorn commented 9 years ago

That why I'm wondering. It feels like a major bug - droping all non-numeric cols. But nobody noticed it yet ...

In the belonging unit test I found this code:

y = normalize(iris, method = "range", range = c(3, 4)) y[, 5L] = iris$Specis

I fixed everything ...

berndbischl commented 9 years ago

Is this fixed now? OR should I do it?

berndbischl commented 9 years ago

Daniel seems assigned.

jakob-r commented 9 years ago

Fixed by @danielhorn commit b94abcbb929c24c93818c67a423d7a5e3ca88bbf