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

关于“normalization” #39

Open
luoxia-wen opened this issue Mar 22, 2023 · 1 comment
Open

关于“normalization” #39

luoxia-wen opened this issue Mar 22, 2023 · 1 comment

Comments

@luoxia-wen
Copy link

luoxia-wen commented Mar 22, 2023

代码中关于normalization的部分如下:

    def _normalized(self, normalize):
        # normalized by the maximum value of entire matrix.

        if (normalize == 0):
            self.dat = self.rawdat

        if (normalize == 1):
            self.dat = self.rawdat / np.max(self.rawdat)

        # normlized by the maximum value of each row(sensor).
        if (normalize == 2):
            for i in range(self.m):
                self.scale[i] = np.max(np.abs(self.rawdat[:, i]))
                self.dat[:, i] = self.rawdat[:, i] / np.max(np.abs(self.rawdat[:, i]))

默认是=2的情况对于这个我有疑问
使用所有数据进行归一化是否存在测试集信息泄露的问题
@yasinuygun
Copy link

This looks like a look-ahead bias. When I use the code, I modified this part to use the max value in the training part only, like self.rawdat[:int(train_ratio * self.rawdat.shape[0])] in np.max calls.

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