-
Notifications
You must be signed in to change notification settings - Fork 158
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
Error: could not allocate 0 bytes #41
Comments
Hi @zhenlingcn, thanks for reporting! Could you print out the data type and shape of your training data, so that we can reproduce the problem. |
Yeah, it's very easy to reproduce this problem. We just need to run the following codes: import numpy as np
from deepforest import CascadeForestRegressor
c = CascadeForestRegressor(n_jobs=1, verbose=0)
c.fit(np.random.randn(10, 5), np.zeros(10, dtype=np.float32)) |
By the way, I want to point out that some other normal data has also raised this error. |
Thanks @zhenlingcn, I can reproduce your problem. I will take a careful look latter. |
This code snippet runs fine: import numpy as np
from deepforest import CascadeForestRegressor
c = CascadeForestRegressor(n_jobs=1, verbose=2)
c.fit(np.random.randn(10, 5), np.random.randn(10,)) If you want to use DF21 on the fly, could you check if there is a problem after converting the type of EDIT: We will check where goes wrong when using the target values of type |
@all-contributors please add @zhenlingcn for bug |
I've put up a pull request to add @zhenlingcn! 🎉 |
I don't believe I can solve the problem by simply modifying the data type. In fact, in the given case, it will still raise an error even if we change the type of the data. |
I agree. Besides, what is the result using the following command on your target values: import numpy as np
from sklearn.utils.multiclass import type_of_target
print(type_of_target(y_train)) When |
I don't believe the latest PR is an appropriate solution. For example, the following test case is a very reasonable test case. However, the latest version of Deep Forest will raise an error. import numpy as np
from deepforest import CascadeForestRegressor
c = CascadeForestRegressor(n_jobs=1, verbose=0)
c.fit(np.random.randn(10, 5), np.array([1, 2, 3, 4, 5]))
|
Thanks for your feedback, will take a look at the Cython side when I get a moment. |
In fact, this problem has hindered me to conduct several comparative experiments. I hope this problem can be solved as soon as possible. |
Sorry for your problem. Could you check if using the sklearn backend works? c = CascadeForestRegressor(backend="sklearn") EDIT: The |
It's great! The sklearn backend seems to work well. |
Glad to here that 😄 |
ValueError: CascadeForestRegressor is used for univariate or multi-variate regression, but the target values seem not to be one of them. #-------2.构造训练集和测试集------# |
rf1 = CascadeForestRegressor(backend="sklearn") |
你好,数据集的标签列既然只有0、1取值,为啥要用 |
我也不想做回归的,但是这边后续用所得的概率是做一个地质方面的图,回归模型出的图好看一点(水paper),就用回归模型了
就如果是分类,把最后分类器的是哪一类的概率输出也行,但是我没找到怎么弄,分类器都封装好了...
…------------------ 原始邮件 ------------------
发件人: "Yi-Xuan ***@***.***>;
发送时间: 2022年5月5日(星期四) 晚上8:08
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [LAMDA-NJU/Deep-Forest] Error: could not allocate 0 bytes (#41)
你好,数据集的标签列既然只有0、1取值,为啥要用CascadeForestRegressor?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
请尝试调用 |
用sklearn里的随机森林模型也可以正常运行,之前的图就是用随机森林做的,0-1区间概率用绿红渐变色做一下图
…------------------ 原始邮件 ------------------
发件人: "LAMDA-NJU/Deep-Forest" ***@***.***>;
发送时间: 2022年5月5日(星期四) 晚上8:08
***@***.***>;
***@***.******@***.***>;
主题: Re: [LAMDA-NJU/Deep-Forest] Error: could not allocate 0 bytes (#41)
你好,数据集的标签列既然只有0、1取值,为啥要用CascadeForestRegressor?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
thanks! |
作者您好,我也有这个问题。我做的是关联预测的方面,我的数据只有0,1。1代表关联,我想预测关联度,所以是个回归问题,但是也会报CascadeForestRegressor is used for univariate or multi-variate regression, but the target values seem not to be one of them这个错误。我查看了源码,发现会对标签进行判断:type_of_target(y),结果是'binary'就无法用回归问题。请教一下您这可以解决吗。(正常的随机森林可以做回归预测) |
可以先尝试把label改成float数据类型,看看能不能绕过 |
非常感谢您提出的方案。第一种:把label改成float数据类型,不可行。不过第二种是可行的,非常感谢! |
When I was using this package, I experienced the following problem. According to my observation, there is still a lot of available memory. Thus, what's the problem?
The text was updated successfully, but these errors were encountered: