[Chapter 3] - p102 - Scaling and using SGD Classifier
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 30k
- Fork
- 13.1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hi,
I am currently on p.102 Chapter 3 and I have just scaled the training data of the MNIST dataset using the StandardScalar(). After scaling the training data, it doesn't seem that the SGD model is refitted using this newly scaled data. Instead, the data is scaled and then y_train_pred (y train predictions) are made calling the SGD classifier (fitted to the X_train unscaled data) onto the X_train_scaled data. Is this the correct way to scale and use data in models? I ask as my 1st thought is that you would need to refit the model on the scaled data as it is very different to the original data. That way when you feed the scaled data to the model it will have been fitted on the scaled data and not the original data.
I have run a cross validation on both:
1. an SGD model using the scaled trained X data as input but fitted to the original data
2. an SGD model using the scaled trained X data as input AND fitted to the scaled data
1. 5 fold cross valid results = array([0.89733333, 0.88725 , 0.89583333, 0.89233333, 0.90516667])
2. 5 fold cross valid results = array([0.89733333, 0.88725 , 0.89583333, 0.89233333, 0.90516667])
As you can see when you fit the model to the scaled data and then use the scaled data it performs exactly the same as the case when you don't re fit the model / re train the model. Is this always the case / do you not need to re fit the model once you have rescaled?
Any help would be much appreciated.
Thanks,
Dan
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.