Main Content

Generate Features Automatically in Diagnostic Feature Designer

When you import data into Diagnostic Feature Designer, you can apply specific data processing and feature extraction options to generate and rank a feature set from your data. You can also generate and rank a feature set automatically using Auto Features. When you select one or more signals or spectra, Auto Features computes a predefined set of features that are appropriate for the variable type. The automatic computations include:

  • Deriving intermediate variables to use for feature extraction, such as spectra and time series signals

  • Extracting the features from the expanded variable set

  • Ranking the features and plotting the histograms of top-ranked features.

The following figure illustrates the computation flow from a selected signal to the generated feature set. Each computation results in an intermediate variable.

The selected signal is on the top right. The computation columns lead to the following features, from left to right: Signal Features, Time Series Features, Model-Based Features, and Spectral Features.

To use Auto Features, perform the following general steps:

  1. Select a variable, such as a signal or spectrum, in the Variables pane. To select more than one variable, use Ctrl-click to add to the variable selection. The variables do not have to have the same data type.

  2. In the Feature Designer tab, click Auto Features.

  3. Confirm the computational settings in the Configuration pane of the Auto Features dialog box.

  4. In the Settings pane, choose whether to plot the histograms and specify the number of top-ranked features to plot.

  5. Click Compute.

Once you have generated the feature set, you can continue to derive new variables and add new features. Alternatively, you can immediately export the feature set directly to Classification Learner.

The following sections provide more information about the general workflow.

Set Up Auto Features Computation

To set up an Auto Features computation, select one or more variables and, in the Feature Designer tab, click Auto Features.

The selected variable is in the middle of the column on the left. The Auto Features button is the fourth item in the toolstrip at the top.

The Configuration pane of the Auto Features dialog box displays information that includes the selected variables, the feature table to add features to, and the number of features to generate. In the following example figure, a selection of a specific signal results in the app identifying 87 time-domain features and 3 frequency-domain features for generation.

The Auto Features dialog box contains the Configuration pane on the top and the Settings pane on the right.

The Configuration pane also lists the status of computational options such as parallel computing. If you want to change any of these options or if you want to add an additional variable for feature generation, click Cancel, and make the necessary changes in the app options and variable selections. Then click Auto Features once more to proceed.

The Settings pane lets you choose to plot the histograms automatically after the features are generated and ranked. To do so, select Plot feature histograms, and then specify the number of top features to show.

Once you are satisfied with the configuration and the histogram settings, click Compute.

View New Variables and Ranked Features

When the feature computations are complete, the app plots the feature ranking. The Variables pane includes new derived variables that the app computed to support feature generation. For example, in the following figure, a new derived spectrum variable provides a source for spectral features.

The variables are in the column on the left. The spectrum variable is near the bottom of the variables pane. The feature ranking plot is in the middle. The corresponding feature scores are on the right.

You can use Compact view to view more variables in the same space. Right-click on any variable to access the compact view option. In the following figure, selecting Compact view collapses each variable to the main variable name.

The default expanded variable display is on the left. The Compact view option is the third and last item in the menu to the right of the expanded variables. The resulting compacted view is on the right.

The derived variable names include the last processing step that was used to compute them. For example, in the following figure, Vibration_res is a residual signal that is computed by subtracting a reference signal such as the mean value of the signal ensemble.

To view the generated features, scroll down in the Variables pane. To obtain more information about a feature, such as what variable the feature is derived from, select the feature and then view the feature information in the Details pane. You can also use the Details pane for information on variables. In the following figure, the Details pane shows that the ClearanceFactor feature from the Vibration_res_sigstats feature group is derived from the Vibration_res signal.

ClearanceFactor is at the top of the feature list that is directly under Vibration_res_sigstats. The Details pane is on the bottom.

To view more information about the processing history of a feature, click History. The following figure illustrates the sequence of serial and parallel processing steps that led to ClearanceFactor.

The history plot shows two parallel paths starting with Vibration data and converging at Vibration_res/Data in the middle. A single path leads from Vibration_res/Data to the ClearanceFactor feature.

For some features, the app uses tunable parameters in the computation. To view the parameter values, click Parameters. The following figure shows the parameter values for the spectral feature PeakAmp1.

Parameter names are on the left. Parameter values are on the right.

If you selected the option to plot histograms automatically, you can view them by selecting the Histogram plot tab next to the Feature Ranking plot tab.

Add Additional Variables and Features

After you generate your first set of features using Auto Features, you can continue to select variables for automatic or manual processing and feature extraction. If you apply Auto Features to variables that Auto Features previously derived, the new features will be duplicates. However, if you create new variables yourself, Auto Features generates distinct features.

For example, the default spectral processing option that Auto Features uses is Welch. Suppose that you create a separate spectrum variable using the Autoregressive option. Select that new spectrum for Auto Features to see that there are three available features. Since Auto Features did not use this spectrum variable to generate the initial feature set, these features which will be distinct from the spectral features that Auto Features generated previously.

The new features are ranked along with the existing features. In the following figure, two of the new spectral features are ranked sixth and seventh.

Features extracted from the new spectrum value are in the sixth and seventh positions in the list on the right.

Because the specified number of features to show is 5, the set of histogram plots does not include them. If you decide you want to see additional histograms, in the Histogram tab, click Select Features. A dialog box allows you to select additional features.

The Select Features button is in the upper left-hand corner.

For more information on Select Features, see Feature Selector.

Next Steps

You can now continue to process your variables and add new features. You can also export your feature set to your MATLAB® workspace or to Classification Learner.

The Export button is in the top left-hand corner. A menu is directly underneath the button. In the menu, the Export features to the Classification Learner selection is the second row from the top

See Also

Related Topics