crystal-data / num.cr

Scientific computing in pure Crystal
MIT License
151 stars 12 forks source link

Add Iris classifier example #53

Closed hugoabonizio closed 3 years ago

hugoabonizio commented 3 years ago

Maybe feature scalers should be on an utils module of this library, I can send a PR. WDYT?

hugoabonizio commented 3 years ago

I'm not sure if implementing group normalization as a gate in this scenario would work the same way. As I know, it is a common practice to scale/normalize the features before feeding it to a neural network (or SVMs, LRs, and other kinds of linear models), specially for tabular data like Iris.

I was think more of a sklearn's StandardScaler, that has the whole dataset to compute the mean and standard deviation, instead of a batch normalization approach. I agree that a BN layer would be a great feature, specially for deep learning models, but I'm proposing a simpler method for using in MLP models.

What do you think @christopherzimmerman?

christopherzimmerman commented 3 years ago

@hugoabonizio I think that would be a great addition. I know that StandardScaler treats NaN as missing values and doesn't include them in normalization, so I might work on some iterators that skip missing values, so that the mean, std methods can have an option to ignore them.