logo
Loading...

執行DecisionTree.fit!(model, features, labels)出現boundserror如何解決 - Cupoy

df=biopsy[!, 2:6]df=dropmissing(df)labels=Vector{S...

decision tree

執行DecisionTree.fit!(model, features, labels)出現boundserror如何解決

2020/05/06 03:02 PM
Julia程式語言論壇
Casey Lin
觀看數:0
回答數:1
收藏數:0
decision tree

df=biopsy[!, 2:6]

df=dropmissing(df)

labels=Vector{String}(biopsy[!, :Class])

features=Matrix(df)

model = DecisionTree.RandomForestClassifier(n_trees=50, max_depth=2)

DecisionTree.fit!(model, features, labels) 執行OK


若改為 df=biopsy[!, 2:10]

DecisionTree.fit!(model, features, labels) 執行, 會有 boundserror

TaskFailedException:
BoundsError: attempt to access 683×9 Array{Int32,2} at index [[194, 460, 217, 16, 479, 502, 518, 202, 613, 524, 607, 615, 256, 554, 291, 590, 5


但在 atom IDE REPL 又OK, 可以請問原因?