Main Content

Remove Risk Factors

Remove or include data and record reasons in Modelscape

Since R2021b


Use the Modelscape™ Remove Risk Factors task to remove or include variables from a data table and record the corresponding reasons. Not all the data in the table is necessarily usable for a statistical model. For example, randomized user identifiers (IDs) are often irrelevant, legally sensitive data such as ethnic origin or religious beliefs cannot be used, and some data can be of poor quality. The task automatically generates MATLAB® code for your live script. This task requires the Modelscape for MATLAB support package.

Using this task, you can:

  • Inspect summary statistics and histograms for variables in a data table.

  • Remove variables from a data table and record the corresponding reason for exclusion.

  • Record reasons for including variables in a data table.

  • Export the resulting subtables to MATLAB desktop.

For general information about Live Editor tasks, see Add Interactive Tasks to a Live Script.

Remove Risk Factors live task

Open the Remove Risk Factors

To add the Threshold Predictors task to a live script in the MATLAB Editor:

  • On the Live Editor tab, select Task > Remove Risk Factors.

    Select Remove Risk Factors live task

  • In a code block in the script, type a relevant keyword, such as remove. Select Remove Risk Factors from the suggested command completions.

    Select Remove Risk Factors live task


expand all

Input table must be a MATLAB table or a timetable. The columns of Input table contain the variables for different data points, for example, Residence Status or Customer ID.

Check the Filtered table check box to display the subtable after excluding the removed variables. The filtered table contains the columns from the Input table without the variables that you mark for exclusion.

Check the Preview summary tables check box to display two tables of additional information about the feature selection process. The exclusionSummaryPreview table includes all the data of the input table together with the exclusion flags and comments that you record in the task. The progressSummaryPreview table shows the total number of variables that are present, excluded, included, and commented against.

Version History

Introduced in R2021b