Main Content

Rank and Export Features in Diagnostic Feature Designer

This example shows how to rank features using several classification ranking techniques, how to compare the results, and how to export features from the app. If you want to follow along with the steps interactively, use the data you imported in Process Data and Explore Features in Diagnostic Feature Designer, and use the feature set from that example. Use Open Session to reload your session data using the file name you provided.

The Open Session icon is second from the left.

When you generate features for classification, you seek the features that perform best at distinguishing among different conditions. When you view the histograms, you can get an idea of the relative effectiveness of your features. In this example, you use ranking algorithms to perform this feature comparison more rigorously. Once you choose the features you want to retain, you export these features into the MATLAB® workspace.

Rank Features

Rank your features using the default T-Test method. Click Rank Features. Select FeatureTable1.

The Rank Features button is in the middle. The name FeatureTable1 is immediately beneath it.

Your selection brings up a ranked list of features, displayed as both a bar chart and a numerical table.

The bar plot of the ranking results is in the middle. The corresponding ranking scores are on the right.

The bar chart legend shows that the initial ranking is performed using the T-Test method. The chart is normalized to 1 to facilitate visual comparison, while the table displays unnormalized ranking scores. The highest ranking feature is CrestFactor, which has the same value whether it was computed as a signal feature or a rotating machinery feature.

Choose Alternative Ranking Method

Each ranking method uses different criteria to perform the ranking. In the Feature Ranking tab, click Supervised Ranking to bring up a menu that summarizes each method. From that menu, select Bhattacharyya.

The Supervised Ranking button is the first item in the row on the top. In the list of ranking methods beneath the top row, Bhattacharyya is the third item.

A Bhattacharyya tab opens with ranking specifications that are standard for all of the methods. Click Apply.

The Bhattacharyya tab contains, from left to right, Correlation Importance, Normalization Scheme, Apply, and Close.

Apply updates the ranking display with the new results, displayed along with the original T-Test results.

Ranking scores, in blue and red, are plotted as bars on the left and listed on the right..

The Bhattacharyya method yields results that are similar to, but not identical to, the T-Test results. The highest ranking feature is PeakValue from the Signal Statistics set. This feature is fourth in the T-test ranking. The crest factor features are still in the top three.

The ranking is still sorted by T-Test. Sort instead by Bhattacharyya. Close the Bhattacharyya tab and return to the Feature Ranking tab. Then, select Bhattacharyya in the Sort by list.

The Close Bhattacharyya button is on the right.

The Sort by Bhattacharyya selection is the third item from the right.

The ranking table now shows PeakValue at the top.

The longest bar for Bhattacharyya, PeakValue, is now at the top of the plot.

Delete Set of Rankings

You have two sets of rankings. Now, delete the Bhattacharyya results. In the Feature Ranking tab, select Delete Scores > Bhattacharyya.

The Delete Scores button is the second from the right. The list beneath it includes T-Test and Bhattacharyya.

Bhattacharyya disappears from the ranking results.

The ranking plot and listing contains only one ranking.

Export Features to MATLAB Workspace

The final step in the Diagnostic Features Designer workflow is to export your features. In the Feature Ranking tab, select Export > Export features to the MATLAB workspace.

The Export button is on the far right. Export features to the MATLAB workspace is the first item in the list beneath the button.

Select the features to export. You can sort the features by any of the rankings you have computed. In this case, only one ranking, T-Test, is available. The app preselects the top five features. Modify this selection. Clear the fifth selection and select the sixth feature using Ctrl-click.

The Export Features to Workspace dialog box contains, from top to bottom, Features sorted by, Select top features, Select and Unselect All buttons, a list of selectable features, and a list of selectable condition variables. The Export button is second from the right on the bottom of the dialog box.

Your reduced feature table appears in your MATLAB workspace.

See Also

| | | | | | |

Related Topics