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

I can't run this code successfully. #1

Open
Nickletgo233 opened this issue Oct 22, 2023 · 10 comments
Open

I can't run this code successfully. #1

Nickletgo233 opened this issue Oct 22, 2023 · 10 comments

Comments

@Nickletgo233
Copy link

我的数据是一个225个样本,176个波段的数据。但是运行的时候会在WaveData = np.vstack((WaveData, d.reshape(1, -1)))这一句代码上报错。编译器提示the array at index 0 has size 176 and the array at index 1 has size 191。这是因为在上面我的第二个维度加上了r值筛选出来的波段。这是为什么呢,请作者解答,谢谢!
My data is a sample of 225, 176 bands of data. However, when run, an error will be reported on WaveData = np.vstack(WaveData, d.Rishape (1, -1))). the compiler prompts the array at index 0 has size 176 and the array at index 1 has size 191. This is because in the second dimension above I have added R-filtered bands. This is why, please answer the author, thank you!

@mepleleo
Copy link
Owner

数据维度不匹配吧,从最开始把要处理的数据改成191的

@Nickletgo233
Copy link
Author

不是这个问题,我再研究一下吧QAQ

@zeyusmart
Copy link

数据维度不匹配吧,从最开始把要处理的数据改成191的

请问是在哪里改成191,我也遇到了数据维度不匹配的问题

@Openmyeyesxz
Copy link

不是这个问题,我再研究一下吧QAQ

我也出现了这个问题,该如何解决呢?

@Nickletgo233
Copy link
Author

不是这个问题,我再研究一下吧QAQ

我也出现了这个问题,该如何解决呢?

我那时候研究好久也找到什么问题hh,主要是没看懂作者怎么写的,所以我自己重新写了一个

@Openmyeyesxz
Copy link

不是这个问题,我再研究一下吧QAQ

我也出现了这个问题,该如何解决呢?

我那时候研究好久也找到什么问题hh,主要是没看懂作者怎么写的,所以我自己重新写了一个

好的谢谢

@Nickletgo233
Copy link
Author

不是这个问题,我再研究一下吧QAQ

我也出现了这个问题,该如何解决呢?

我那时候研究好久也找到什么问题hh,主要是没看懂作者怎么写的,所以我自己重新写了一个

好的谢谢

时隔几个月,最近又研究了一下,我终于发现问题了。
实际上是sklearn版本不同的问题,我换成1.2.2版本的就成功运行了。
主要问题是
beta = pls.coef_
b = np.abs(beta)
b2 = np.argsort(-b, axis=0)
这里的coef_,旧版的传出来的是(x, 1),新版的是(1, x)。问题就出在这里哈哈哈

@mepleleo
Copy link
Owner

mepleleo commented Jan 13, 2024 via email

@Openmyeyesxz
Copy link

不是这个问题,我再研究一下吧QAQ

我也出现了这个问题,该如何解决呢?

我那时候研究好久也找到什么问题hh,主要是没看懂作者怎么写的,所以我自己重新写了一个

好的谢谢

时隔几个月,最近又研究了一下,我终于发现问题了。 实际上是sklearn版本不同的问题,我换成1.2.2版本的就成功运行了。 主要问题是 beta = pls.coef_ b = np.abs(beta) b2 = np.argsort(-b, axis=0) 这里的coef_,旧版的传出来的是(x, 1),新版的是(1, x)。问题就出在这里哈哈哈

感谢您的回应!我试着重新更改一下自己的代码

@mepleleo
Copy link
Owner

mepleleo commented Apr 21, 2024 via email

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

4 participants