- Calculate the mean (x_train_mean), maximum (x_train_max), and minimum (x_train_min) values for each feature in the training data (x_train).
- Normalize the real-time data (x_realtime) using the formula: x_normalized = (x_realtime - x_train_mean) / (x_train_max - x_train_min).
- Use the normalized real-time data (x_normalized) as input to your trained model for prediction.
Normalization and scaling features in ML
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello everyone
its is very important to scale and normalize data for training ML algorithme, lets take for exemple the mean normalization , so to normalize one feature we take the each instance of vector feature so we substract the mean of this vector x_vector - mean (x_vector), and divide by max(x_vector)-min(x_vector ) . Now the question is : should i normalize and scale the data test as well ?, if yes on based on what after the integration of our model for an real time application to normalize our data from sensors ? (real data without normaliziation and scaling ) , like we dont have vector and then we calculate the mean and max min to normalize it.
Thanks for your contribution
댓글 수: 0
답변 (1개)
Shantanu Dixit
2023년 6월 16일
Hi Nor,
This is a concept related to feature scaling, here's how you would handle normalization for real-time data using the statistics from the training data:
By using the mean and range values from the training data, you ensure consistency in the normalization process.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!