Skip to content

Commit

Permalink
Sort rules by condition factor names
Browse files Browse the repository at this point in the history
This should help removing duplicate rules.
  • Loading branch information
Zapiano committed Nov 15, 2024
1 parent ad39467 commit f01f4b4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/analysis/rule_extraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ past of the 'positive class' given that the condition is true or false.
struct Rule{V<:Vector{Vector},W<:Vector{Float64}}
condition::V
consequent::W

function Rule(condition, consequent)
condition_order = sortperm(condition; by=x -> x[1])
return new{typeof(condition),typeof(consequent)}(
condition[condition_order], consequent[condition_order]
)
end
end

"""
Expand Down

0 comments on commit f01f4b4

Please sign in to comment.