-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix rule extraction to handle constant factors #870
Conversation
41c5040
to
263a125
Compare
Haven't looked through the changes yet (will wait for the dependent PR to be merged first), but one minor request: Change the error message to "Factors of interest cannot be constant". |
263a125
to
6ff0cfb
Compare
@ConnectedSystems this one is ready for review. |
7007655
to
3140b75
Compare
@ConnectedSystems friendly reminder that this is ready for review |
src/analysis/rule_extraction.jl
Outdated
function cluster_rules(clusters::Vector{T}, X::DataFrame, max_rules::T; | ||
seed::Int64=123, kwargs...) where {T<:Int64} | ||
function cluster_rules( | ||
result_set::ADRIA.ResultSet, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment - could this be simplified to ResultSet
? If not, maybe we should consider exporting the ResultSet
type...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor question.
Otherwise this is ready to be merged.
I still need to rebase this. |
4ef0725
to
a4c81a4
Compare
@ConnectedSystems this one is rebased and ready for review. |
Note: This branch is based on #863 's branch. Closes #672 .
Updates
ADRIA.analysis.cluster_rules
so we can check for constant factors (and ignore them) before trying to extract rules. The parameters you need to pass tocluster_rules
have changed - with that is one line less of code now.The documentation still needs to be updated - once this is done, I'll mark this as ready to review.
Example
As an example, let's fix all
SeedCriteriaWeights
and only a few of theFogCriteriaWeights
factors, run the model, cluster and target some cluster:Now if we select
Intervention
factors, everything works (as it would previously, nothing's c hanged here):If we select
FogCriteriaWeights
, some are constant and some are not. Previously this would lead to an error but now it just filters off all constant factors and everything works fine:And, finally, if we select
SeedCriteriaWeights
, because all of them are constant, this will raise an error:The error:
Below are the scatter plots for
Interventions
andFogCriteriaWeights
rules (the plot functions haven't changed):Intervention
FogCriteriaWeights