我想预测响应变量,它有700个类。
深度学习模型参数
from h2o.estimators import deeplearning
dl_model = deeplearning.H2ODeepLearningEstimator(
hidden=[200,200],
epochs = 10,
missing_values_handling='MeanImputation',
max_categorical_features=4,
distribution='multinomial'
)
# Train the model
dl_model.train(x = Content_vecs.names,
y='tags',
training_frame = data_split[0],
validation_frame = data_split[1]
)
Orginal Response Variable -Tags:
apps, email, mail
finance,freelancers,contractors,zen99
genomes
gogovan
brazil,china,cloudflare
hauling,service,moving
ferguson,crowdfunding,beacon
cms,naytev
y,combinator
in,store,
conversion,logic,ad,attribution
Response variable tags:
[74]
[156, 89]
[153, 13, 133, 40]
[150]
[474, 277, 113]
[181, 117]
[15, 87, 8, 11]错误:
OSError:具有键$03017f00000132d4ffffffff$_8355bcac0e9e98a86257f45c180e4898的作业失败,出现异常: java.lang.UnsupportedOperationException:无法计算错误:类太多
hex.ConfusionMatrix.err(ConfusionMatrix.java:92):java.lang.UnsupportedOperationException:无法计算错误:堆栈中的类太多
但在h2o-core/src/main/java/hex/ConfusionMatrix.javaConfusionMatrix.java中,它可以计算1000个类。
发布于 2018-12-09 00:24:20
当您说您有700个类时,您的response变量是由这700个唯一数字组成的数组吗?因为你给出了这个例子:
Response variable tags:
[74]
[156, 89]
[153, 13, 133, 40]
[150]
[474, 277, 113]
[181, 117]
[15, 87, 8, 11]H2O无法预测数组。每个唯一的数字组合将被算作一个类。因此,从H2O的角度来看,你可能有超过700个班级。
如果你查看Flow ( http://127.0.0.1:54321/ )上的数据,它会告诉你“标签”中有多少个独特的级别。(您也可以从python API获取它,在框架上使用describe(),或者在有问题的列上使用categories()将列出所有级别。)
您的下一个问题将是如何处理此问题。我建议您提出一个新问题,解释700个值和数组代表的内容;几乎可以肯定的是,它将涉及一些特定于域的预处理。但是,您可以尝试使用categorical_encoding http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/algo-params/categorical_encoding.html
https://stackoverflow.com/questions/53684039
复制相似问题