customizeRule

PatternsResource.customizeRule(request, sub_analysis_id, rule_id, **kwargs)

Prior mandatory steps 1) Upload dataset 2) Create analysis 3) Create sub analysis 4) DataSharp 5) iRule

In customizeRule, for an existing pattern, one can change the values of the attributes and explore for best confidence rule.

The user will select the insight; changes the levels of any of the attributes in the LHS of the insight. Submit the change to compute the metrics. User can decide to accept/reject the newly generated insight.

Arguments

sub_analysis_id Give sub analysis id
rule_id Give rule id
custom_data {“attr_name”:”default”,”bin_value”:”no”}

Possible errors

Error message
Invalid sub analysis id
Invalid rule id
Please provide custom data
Invalid attr name in custom data

POST Request Example

curl -u username:password -X POST -F 'custom_data=[{"attr_name":"default","bin_value":"no"},{"attr_name":"housing","bin_value":"yes"}]' {url_prefix}/customize_rule/{sub_analysis_id}/{rule_id}/

Response Example

{
    "error": false,
    "error_msg": "",
    "result": [
        {
            "actionability": 0.0,
            "confidence": 0.91368,
            "explicability": 0.85,
            "hmean": 1.8348,
            "lift": 1.03269,
            "recommended": "No",
            "record_count": "2297",
            "rule_string": "If default is no and housing is yes, then y = no",
            "support": 0.50807,
            "target_bin": "no"
        }
    ]
}
{
    "error": false,
    "error_msg": "",
    "result": "Could not find better insight with one rule condition for the desired Class"
}

Error Response Example

{
    "error": true,
    "error_msg": "Please provide custom data",
    "result": {},
}