Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

训练集、测试集归一化 #2

Open
lelezhao333 opened this issue Sep 3, 2024 · 2 comments
Open

训练集、测试集归一化 #2

lelezhao333 opened this issue Sep 3, 2024 · 2 comments

Comments

@lelezhao333
Copy link

你好,请问数据分为训练集、测试集。为什么代码里是分开标准化呀?也就是训练集自己最大最小归一化,测试集自己最大最小归一化,这样可以么?常见的不是应该训练集归一化fit,测试集直接transform么?

@sarikayamehmet
Copy link
Owner

您说得对,通常将训练集标准化以使其拟合,然后直接转换测试集。但是,在时间序列数据中,测试集可以有不同的范围。例如,训练集的模式在 80 - 100 之间,但测试集的模式在 60 - 80 之间,因此在这种情况下,您应该使用测试集平均值和标准差来更好地拟合它。

@lelezhao333
Copy link
Author

谢谢您的回复。还有一个问题,每次运行结果都略有不同。计算的loss,mae,r2_keras也随之改变。这样比如和其他方法比较的时候会有问题,请问有什么处理方法么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants