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

Any rule created by the user as a result of actRule or generalizeRule or specializeRule or customizeRule may be saved using saveRule. Such rules are stored in Intuceo as “user generated” rules.


sub_analysis_id Give sub analysis id
rule_generation_source Give rule_generation_source
new_rule_data Give rule

Possible errors

Error message
Invalid sub analysis id
Invalid rule_generation_source
Invalid rule

POST Request Example

curl -u username:password -X POST -F 'rule_generation_source=act_on' -F 'new_rule_data={"actionability": 0.0,"confidence": 0.78182,"explicability": 0.52,"hmean": 1.3956,"lift": 6.7263,"recommended": "No","record_count": 86,"rule_string": "If day is less than or equal to 4 and duration is greater than 180 and loan is no and pdays is between (2 to 195] and poutcome is success, then y = yes","support": 0.00213,"target_bin": "yes"}' {url_prefix}/save_rule/{sub_analysis_id}/{rule_id}/

Response Example

    "error": false,
    "error_msg": "",
    "result": "The insight is saved successfully in 'User generated' insight group"

Error Response Example

    "error": true,
    "error_msg": "Invalid rule data",
    "result": {},