When scale the data, why the train dataset use 'fit' and 'transform', but the test dataset only use 'transform'?

后端 未结 7 1930
悲&欢浪女
悲&欢浪女 2021-02-01 03:32

When scale the data, why the train dataset use \'fit\' and \'transform\', but the test dataset only use \'transform\'?

SAMPLE_COUNT = 5000
TEST_COUNT = 20000
see         


        
7条回答
  •  被撕碎了的回忆
    2021-02-01 04:31

    we use fit() or fit_transform() in order to learn (to train the model) on the train data set. transform() can be used on the trained model against the test data set.

提交回复
热议问题