File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,10 @@ Graphs = "1.8"
52
52
HTTP = " 1.9"
53
53
IterTools = " 1"
54
54
Lazy = " 0.15.1"
55
- MLJ = " 0.20"
56
- MLJBase = " 1.6"
55
+ MLJ = " 0.19 - 0. 20"
56
+ MLJBase = " 1.6 - 1.7 "
57
57
MLJDecisionTreeInterface = " 0.4"
58
- MLJModelInterface = " 1.8.0 "
58
+ MLJModelInterface = " 1.8"
59
59
PrettyTables = " 2.2"
60
60
ProgressMeter = " 1"
61
61
Random = " 1"
Original file line number Diff line number Diff line change @@ -386,20 +386,22 @@ _listrules(m::DecisionTree; kwargs...) = _listrules(root(m); kwargs...)
386
386
387
387
function _listrules (
388
388
m:: DecisionEnsemble ;
389
- suppress_parity_warning = false ,
389
+ # weights::Union{Nothing, AbstractVector} = nothing,
390
+ suppress_parity_warning = true ,
390
391
kwargs...
391
392
)
392
- error (" TODO check method & implement more efficient strategies for specific cases." )
393
- modelrules = [listrules (subm; kwargs... ) for subm in models (m)]
393
+ # error("TODO check method & implement more efficient strategies for specific cases.")
394
+ modelrules = [_listrules (subm; kwargs... ) for subm in models (m)]
394
395
@assert all (r-> consequent (r) isa ConstantModel, Iterators. flatten (modelrules))
395
396
396
397
IterTools. imap (rulecombination-> begin
397
398
rulecombination = collect (rulecombination)
398
399
ant = join_antecedents (antecedent .(rulecombination))
399
- cons = bestguess (outcome .(consequent .(rulecombination)); suppress_parity_warning)
400
- infos = info .(rulecombination)
401
- # TODO @show infos; info = (;)
402
- Rule (ant, cons)
400
+ o_cons = bestguess (outcome .(consequent .(rulecombination)), m. weights; suppress_parity_warning)
401
+ i_cons = merge (info .(consequent .(rulecombination))... )
402
+ cons = ConstantModel (o_cons, i_cons)
403
+ infos = merge (info .(rulecombination)... )
404
+ Rule (ant, cons, infos)
403
405
end , Iterators. product (modelrules... )
404
406
)
405
407
end
You can’t perform that action at this time.
0 commit comments