最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

machine learning - Is there a way to set the data_min and the data_max in MinMaxScaler()? - Stack Overflow

programmeradmin0浏览0评论

I'm currently using MinMaxScaler() on my dataset. However, because my dataset is large I'm doing a first iteration pass in batches to compute the Min and Max Values for my Scaler. i'm using partial_fit() to help with this.

Anyway, for some of my features I do know their min and max values. Is there anyway I can explicity inform the scaler about these min and max values?

I'm currently using MinMaxScaler() on my dataset. However, because my dataset is large I'm doing a first iteration pass in batches to compute the Min and Max Values for my Scaler. i'm using partial_fit() to help with this.

Anyway, for some of my features I do know their min and max values. Is there anyway I can explicity inform the scaler about these min and max values?

Share Improve this question edited Feb 8 at 13:10 desertnaut 60.3k32 gold badges151 silver badges177 bronze badges asked Feb 5 at 21:57 SaffySaffy 153 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You could simply create your own function to transform your data:

def myMinMaxScaler(X, Xmin, Xmax):
    return (X - Xmin) / (Xmax - Xmin)

Another option could be to add rows (with the samples containing the min and max) at the end of your batches and after the transformation remove the added rows.

发布评论

评论列表(0)

  1. 暂无评论