Create Sub analysis¶
SubAnalysisResource.
createSubAnalysis
(request, analysis_id, **kwargs)¶Prior mandatory steps 1) Upload dataset 2) Create analysis
This function creates sub-analysis by defining: 1) Name for the sub-analysis 2) Set Desired class: This function also helps user to define the desired class of the target attribute levels or bins. Predictive model is generated by iLearn function, will reduce the error importance for this desired class. iAdvise and actRule functions finds an actionable suggestion that can change the behaviour of a pattern from undesired class to desired class. 3) This function should be used to define the error importance for the predictive model to be generated for binary class data as below. For multi class, the predictive model is generated with highest accuracy for the desired class level. 4) This function should be used to define the target binning if the target is numeric. In this version, Numerical Target is to be binned manually. For example, if user wants to bin the target numeric range into 5 bins, user has to define the ranges for each bin manually as defined below.
Arguments
name Name of your choice to be displayed for sub analysis desired_class_name give desired class value (ex. ‘yes’ or ‘no’ or None) target_range if target is numeric, then provide data like {‘level1’: {‘from_value’: ‘’, ‘to_value’: 1}, ‘level2’: {‘from_value’: 1, ‘to_value’: ‘’}} goal Explain what you would like to understand from the analysis. description Describe the actionable business benefit(s) you would like to achieve. assumptions Share important assumptions you are making about the context or situation. process Explain the analytical approach, tool(s), or framework(s) you are currently using. Possible errors
Error message Invalid analysis id Name already exists. Please use different name Invalid name. Only alpha numeric and underscore are allowed Invalid desired class name. Please give value from following list Invalid target range. Unable to parse Target range not applicable for categorical target Target levels should not be more than <levels> levels This sub analysis has been locked. You cannot perform this task POST Request Example
curl -u username:password -X POST -F "name=bank" -F "desired_class_name=yes" -F "goal=" -F "description=" -F "assumptions=" -F "process=" {url_prefix}/sub_analysis/{analysis_id}/ curl -u username:password -X POST -F "name=bank" -F "desired_class_name=level1" -F "target_range={'level1': {'from_value': '', 'to_value': 1}, 'level2': {'from_value': 1, 'to_value': ''}}" -F "goal=" -F "description=" -F "assumptions=" -F "process=" {url_prefix}/sub_analysis/{analysis_id}/Response Example
{ "error": false, "error_msg": "", "result": { "sub_analysis": { "desired_class": "yes", "id": 1202, "name": "bank2 analysis", "target_attribute": "y", "target_level_name": [ "no", "yes" ], "target_variable_type": "categorical" } } }Error Example
{ "error": true, "error_msg": "some error message", "result": {}, }