【发布时间】:2016-10-13 06:32:48
【问题描述】:
我使用 DecisionTree 模块在 Julia 中训练了一个修剪后的决策树模型。我现在想保存这个模型以供以后在其他数据集上使用。
我尝试使用 writetable() 将模型转换为数据数组以进行导出,并且尝试使用 writedlm() 进行导出,但这些都不起作用。当我查看模型的类型时,我发现它是 DecisionTree.Node 类型。我不知道如何使用它,也无法导出/保存。
In:DataFrame(PrunedModel)
Out:LoadError: MethodError: `convert` has no method matching convert(::Type{DataFrames.DataFrame}, ::DecisionTree.Node)
This may have arisen from a call to the constructor DataFrames.DataFrame(...),
since type constructors fall back to convert methods.
Closest candidates are:
call{T}(::Type{T}, ::Any)
convert(::Type{DataFrames.DataFrame}, !Matched::Array{T,2})
convert(::Type{DataFrames.DataFrame}, !Matched::Dict{K,V})
...
while loading In[22], in expression starting on line 1
in call at essentials.jl:56
In:typeof(PrunedModel)
Out:DecisionTree.Node
有什么想法可以保存这个模型以供以后使用吗?
【问题讨论】:
标签: export julia decision-tree