deepjavalibrary / djl

An Engine-Agnostic Deep Learning Framework in Java
https://djl.ai
Apache License 2.0
4.13k stars 656 forks source link

how to create RobustScaler ? #2179

Closed xlorne closed 1 year ago

xlorne commented 1 year ago

with python some time ,that need RobustScaler to normal data. how to build RobustScaler on DJL?

from sklearn.preprocessing import RobustScaler
scaler = RobustScaler()
scaler.fit_transform(data)
siddvenk commented 1 year ago

You can use the Featurizer interface in the basicdataset module to implement the RobustScaler().

After implementing the RobustScaler as a Featurizer, you can use it to process Features in your dataset using the addFeature() method of TabularDataset class: addFeature(new Feature("feature-name", new RobustScalerFeaturizer())

xlorne commented 1 year ago

ok, that need self to implement? thanks.

siddvenk commented 1 year ago

Yes that's correct. We don't have this implemented in DJL right now so you would need to implement it yourself. We would welcome a contribution if you would like to raise a PR.

xlorne commented 1 year ago

Of course, if i can done that. ☺