$schema: https://azuremlschemas.azureedge.net/latest/commandJob.schema.json
inputs:
  title: 'My Single Job RAI'
  task_type: 'classification' # [classification, regression]
  model_id: common_fetch_model_adult_1646680712:1
  train_dataset_id: tabular_train_adult_1646682459:1
  test_dataset_id: tabular_test_adult_1646682460:1
  target_column_name: income
  maximum_rows_for_test_dataset: 5000
  categorical_column_names: '["Race", "Sex", "Workclass", "Marital Status", "Country", "Occupation"]' # Optional[List[str]]
  classes: '[]'  # Optional[List[str]]
  # ------
  enable_causal: False
  causal_treatment_features: '["Age", "Sex"]'
  causal_heterogeneity_features: '["Marital Status"]'
  causal_nuisance_model: linear
  causal_heterogeneity_model: linear
  causal_alpha: 0.05
  causal_upper_bound_on_cat_expansion: 50
  causal_treatment_cost: '0'
  causal_min_tree_leaf_samples: 2
  causal_max_tree_depth: 2
  causal_skip_cat_limit_checks: False
  causal_categories: auto
  causal_n_jobs: 1
  causal_verbose: 1
  causal_random_state: None
  # ------
  enable_counterfactual: True
  counterfactual_total_CFs: 10
  counterfactual_method: random
  counterfactual_desired_class: 0
  counterfactual_desired_range: '[]'
  counterfactual_permitted_range: '{}'
  counterfactual_features_to_vary: all
  counterfactual_feature_importance: True
  # ------
  enable_error_analysis: True
  error_analysis_max_depth: 3
  error_analysis_num_leaves: 31
  error_analysis_min_child_samples: 20
  error_analysis_filter_features: '["Marital Status", "Workclass"]'
  # ------
  enable_explanation: True
  # ------
#outputs:
#  dashboard:
#    mode: upload
#  ux_json:
#    mode: upload
code:
  local_path: src
compute: azureml:cpucluster
environment: azureml:AML-RAI-Environment:1646679879
display_name: Single RAI Job
experiment_name: RAI_Single_Job_01
description: Run RAI in a single job
command: |
  set -o xtrace
  # ========================================
  # Run the script
  python ./run_rai.py \
    --title '${{inputs.title}}' \
    --task_type ${{inputs.task_type}} \
    --model_id ${{inputs.model_id}} \
    --train_dataset_id ${{inputs.train_dataset_id}} \
    --test_dataset_id ${{inputs.test_dataset_id}} \
    --target_column_name ${{inputs.target_column_name}} \
    --maximum_rows_for_test_dataset ${{inputs.maximum_rows_for_test_dataset}} \
    --categorical_column_names '${{inputs.categorical_column_names}}' \
    --classes '${{inputs.classes}}' \
    --enable_causal ${{inputs.enable_causal}} \
    --causal_treatment_features '${{inputs.causal_treatment_features}}' \
    --causal_heterogeneity_features '${{inputs.causal_heterogeneity_features}}' \
    --causal_nuisance_model ${{inputs.causal_nuisance_model}} \
    --causal_heterogeneity_model ${{inputs.causal_heterogeneity_model}} \
    --causal_alpha ${{inputs.causal_alpha}} \
    --causal_upper_bound_on_cat_expansion ${{inputs.causal_upper_bound_on_cat_expansion}} \
    --causal_treatment_cost '${{inputs.causal_treatment_cost}}' \
    --causal_min_tree_leaf_samples ${{inputs.causal_min_tree_leaf_samples}} \
    --causal_max_tree_depth ${{inputs.causal_max_tree_depth}} \
    --causal_categories ${{inputs.causal_categories}} \
    --causal_n_jobs ${{inputs.causal_n_jobs}} \
    --causal_verbose ${{inputs.causal_verbose}} \
    --causal_random_state '${{inputs.causal_random_state}}' \
    --enable_counterfactual ${{inputs.enable_counterfactual}} \
    --counterfactual_total_CFs ${{inputs.counterfactual_total_CFs}} \
    --counterfactual_method ${{inputs.counterfactual_method}} \
    --counterfactual_desired_class ${{inputs.counterfactual_desired_class}} \
    --counterfactual_desired_range '${{inputs.counterfactual_desired_range}}' \
    --counterfactual_permitted_range '${{inputs.counterfactual_permitted_range}}' \
    --counterfactual_features_to_vary '${{inputs.counterfactual_features_to_vary}}' \
    --counterfactual_feature_importance '${{inputs.counterfactual_feature_importance}}' \
    --enable_error_analysis ${{inputs.enable_error_analysis}} \
    --error_analysis_max_depth ${{inputs.error_analysis_max_depth}} \
    --error_analysis_num_leaves ${{inputs.error_analysis_num_leaves}} \
    --error_analysis_min_child_samples ${{inputs.error_analysis_min_child_samples}} \
    --error_analysis_filter_features '${{inputs.error_analysis_filter_features}}' \
    --enable_explanation ${{inputs.enable_explanation}}