我在水里读文件有点问题
import h2o
from h2o.estimators.deeplearning import H2ODeepLearningEstimator
h2o.init()
train = h2o.import_file("("https://h2o-public-test-data.s3.amazonaws.com/smalldata/iris/iris_wheader.csv"")
splits = train.split_frame(ratios=[0.75], seed=1234)
dl = H2ODeepLearningEstimator(distribution="quantile",quantile_alpha=0.8)
dl.train(x=range(0,2), y="petal_len", training_frame=splits[0])
print(dl.predict(splits[1]))
更新_1,第四行有此表单(抱歉,我从IDE复制错误):
^{pr2}$我得到了H2OTypeError:参数x
应该是一个None | integer | list(string | integer)| set(integer | string),得到了范围范围(0,2)。在
这是因为“火车”是空的。在
In [23]: train
Out[23]:
我认为在读取、链接和手动下载文件时存在问题。在
train = h2o.import_file("iris_wheader.csv")
但我得到了同样的结果。在
In [26]: train
Out[26]:
我连接了pandas并在pandas中打开了这个.csv。它打开了,我得到了一个熊猫数据帧,我用的
train = h2o.H2OFrame(train)
有一列空火车。在
In [29]: train
Out[29]:
如何解决这个问题?在
当我转到127.0.0.1:54321/flow时更新_2/索引.html,它显示数据帧已加载到集群中。但在Python,我得到的是空火车。我使用Spyder IDE和IPython控制台,它会影响结果吗?在
这条线有问题:
你应该有额外的(,你应该有:
^{pr2}$然后您将看到}给出输出:
train
和{相关问题 更多 >
编程相关推荐