Classification and Regression with the BigML Dashboard

1.5 Visualizing BigML Models

Being able to effectively visualize a model is paramount to exploring it, interpreting it, and explaining why it produces certain outcomes. To this aim, BigML provides two powerful interactive visualizations for BigML models, the compact tree and the sunburst views, which will be introduced below.

1.5.1 BigML Compact Tree Visualization

BigML compact tree is a powerful, patented, visual tree representation of your BigML model. Thanks to their being interactive, BigML compact trees bring to a new level your ability to explore your BigML models, by allowing you to see at a glance the most relevant information encoded in the model, by allowing you to collapse less important parts, and by enabling advanced filtering options.

BigML Compact Tree Visual Representation

BigML compact trees rely on the almost natural representation of BigML models as Trees to convey a wealth of information in a compact format:

  • The color of each node in the compact tree identifies the input field associated to it, i.e. the field that was identified as providing the best split. see subsection 1.2.3 for more information.

  • The first node at the top, called the tree Root, corresponds to the split that best divides your data into two segments according to your objective variable. However, one must not confuse the best split with the most significant field since a root field may not always be as important as other predictors after growing the full tree. See subsection 1.2.5 for more information.

  • The branches connect the root to its child nodes at the next level down. Each child node may recursively have a number of children, to which it is connected through the afferent branches. This goes forth until we get to the terminal nodes, called leaves, that have no further children and are used to generate predictions.

  • The width of a node represents the number of instances that the branch rooting at that node includes.

\includegraphics[]{images/models/tree-view}
Figure 1.22 Tree visualization

Interacting with BigML Compact Trees

You can explore even more information that is encoded in your BigML model interacting with it. If you hover over the tree nodes, additional information about those nodes will be displayed. Additionally, you can set interactive filters to display only a subset of nodes based on a given criteria. Finally, you can create a dataset from a node to further investigate the data instances that support it. See below a description for all these interaction modes.

If you mouse over a node in the tree, BigML compact tree will display:

  • The prediction at that node along with a measure of the prediction’s certainty on the top navigation bar above the tree visual:

    • For classification models you can display the confidence or the probability by clicking in the switcher shown in Figure 1.23 . See a detailed explanation of both measures in subsection 1.2.6

    • For regression models you will get the expected error. See a detailed explanation in subsection 1.2.7 ).

    \includegraphics[]{images/models/conf-prob-switcher}
    Figure 1.23 Node prediction
  • The decision Prediction Path for the node, i.e. the series of rules that lead to it, on the right side of the tree.

  • The number of instances that follow this decision path as well as their distribution in terms of the objective field values in the tooltip appearing on top of the hovered node. In the same tooltip you will see again the prediction at that node along with the confidence or probability (for classification models) or the expected error (for regression models).

\includegraphics[]{images/models/tree-view2}
Figure 1.24 Prediction path

Because models often grow too wide to comfortably fit the display area, BigML makes it possible to collapse some of the less important parts:

  • To show all the nodes for a particular path, just click on that node and the whole branch will be displayed.

  • To return to the default view, click on the root of the tree.

Interactive Filters

BigML compact trees provide a set of filters that let you interact with your model and control what part of it is displayed or hidden. Filters are interactive, meaning that you will see in real-time how applying a given filter changes the visualization. Filters aim to make it easier for you to analyze the information the model conveys in a number of ways, as explained below.

All available filters are shown in the top bar just above the tree, as depicted in Figure 1.25 .

  • Filter by support: this filter displays or hides branches based on how well they are supported by all data instances. To apply it, you specify the minimum and maximum percentage of instances that you require to provide Support to visible branches. This is useful to identify branches with a minimum threshold of supporting instances.

  • Filter by prediction: this filter displays or hides branches based on the predictions they provide. To apply it, you choose what predictions you are interesting in: for Regression models, a slider allows you to set a range of values for your predictions; for Classification models, select the predicted class.

  • Filter by confidence, probability or expected error: this filter displays or hides nodes based on the certainty of the predictions they provide. For Classification models you will be able to filter the model by the confidence or the probability depending on the option you select (see Figure 1.23 ). For Regression models you will be able to filter your model by the expected error. This is useful to identify the most likely predictions your model provides.

  • Rare interesting patterns: this filter displays only those branches that are supported by few instances, i.e. represent not so common cases, while still providing high confidence. Low support is defined as being supported by less than 1% of instances. High confidence is defined at least 50% confidence for classification models, or being in the lowest expected error decile for regression models.

  • Frequent interesting patterns: this filter displays only those branches that have high support, i.e. represent frequent cases, and also provide high confidence. High support is defined as being supported by more than 1% of instances. High confidence is defined at least 50% confidence for classification models, or being in the lowest expected error decile for regression models.

\includegraphics[]{images/models/filters}
Figure 1.25 Interactive filters

Creating a Dataset from a Node

As mentioned, you can create a dataset collecting all the instances that support a given node. This can be useful if you want to apply other Machine Learning algorithms to it to gain further insight into the set of rules that belong to that branch.

Create a dataset from any node of your model by following these steps:

  • Click on a node to select a specific view of the model.

  • Press the shift key on your keyboard to freeze the current view.

  • In the frozen view, click the Create dataset button. (See Figure 1.26 .)

  • Release the frozen view by pressing the esc key on your keyboard.

By executing the above listed steps, a new dataset will be created containing only the instances that support the selected node.

\includegraphics[]{images/models/create-dataset}
Figure 1.26 Create dataset from a branch

1.5.2 Partial Dependence Plot

Appart from the main compact tree view, BigML also offers an alternative view for models: the Partial Dependence Plot (PDP). The main goal is to represent the marginal effect of a set of variables (input Fields) on the model predictions disregarding the rest of the variables. It is a common method for visualizing and interpreting the impact of the variables on the predictions, and it can be used for Classification and Regression models.

\includegraphics[]{images/models/model-pdp}
Figure 1.27 Model PDP view

Note: the model PDP is not a representation of the dataset values; it is a representation of the model results and their dependence from a set of variables used as inputs.

The PDP allows you to visualize the model predictions in the heatmap chart. In the case of classification models, the different classes of the objective field are represented by different colors. The different color shadings for each class represent the different confidences or probabilities depending on the option you select from the switcher highlighted in Figure 1.28 .

\includegraphics[]{images/models/model-pdp-class}
Figure 1.28 Classification model PDP

For regression models, the different prediction values for the objective field are represented by differences in the color scale.

\includegraphics[]{images/models/model-pdp-regress}
Figure 1.29 Regression model PDP

You can select any categorical or numeric field for each axis. You can also switch the axis by clicking on the option on top of the chart area. In the grey area next to the axis selectors you can see the axis values. You can freeze the view by pressing Shift and release it again by pressing Escape from your keyboard. When the view is frozen, an edition icon will appear and you can edit the axis values to obtain a prediction for that value. (See Figure 1.30 .)

\includegraphics[]{images/models/chart1}
Figure 1.30 Model PDP axis options

The prediction legend next to the chart allows you to visualize the objective field classes (classification models) or the predicted value (regression models). In the case of classification models you will also obtain the confidence or the proabbility depending on your selected option (see subsection 1.2.6 ). By default, the color tones and shadings are set according to the range of values shown in the chart area. This is the default because for some configurations of the chart the predictions may vary a small amount relative to the global range. For example, imagine the chart is showing temperature predictions based on location, time-of-year, and time-of-day. San Diego’s daily range (13\(^\circ \) C to 18\(^\circ \) C) could be tiny compared to the Earth’s global range (-62\(^\circ \) C to 48\(^\circ \) C). You can change this behavior and see the color scales and shading according to the total range of possible predicted values by clicking on the icon next to the probability bar Total . For classification models, this option allows you to see the color shading for the total range of potential confidence or probability values (from 0% to 100%). For regression models, the Total colors option allows you to see the color scale for the total range of predictions. For classification models you can also select to see only one of the classes using the class selector at the bottom of the legend. (See Figure 1.31 .)

\includegraphics[]{images/models/chart2}
Figure 1.31 Prediction legend options

Below the chart legend, you can find the input fields form. (See Figure 1.32 .) You can configure the values for any numeric, categorical, text or items field. By changing their values, you can see the predictions changing in real-time. You can sort the fields by their importance, select or disable them. If you disable an input field, it will be ignored to calculate the final prediction. The strategy used to calculate predictions when some fields are disabled is the proportional missing strategy (see Missing Strategies ).

\includegraphics[]{images/models/chart3}
Figure 1.32 Input fields from in the model PDP

If you want to know more about how to interpret the PDP view, please refer to Interpreting Partial Dependence Plots .

1.5.3 Sunburst Visualization

In addition to compact trees and the PDP, BigML provides an additional, BigML-unique visualization for BigML models: the Sunburst, which allows you to visualize the entire model in a single view, without collapsing or expanding branches.

The Sunburst diagram can be seen as a representation of a BigML tree as if you were looking at a real pine tree directly down from its tip. So, the center circle in Figure 1.33 represents the root of the tree and its children wrap around it. Similarly, moving from the center further out, you will see the first split of the tree followed by the others.

For the uninitiated, BigML Sunburst diagram may not appear as immediately intuitive as our regular tree view. Nonetheless, it can help advanced users gain more insight into their models. In particular:

  • More layers indicate deeper (i.e., more complex) prediction paths.

  • The arc length of each child ring corresponds to the percentage of the training set covered by that child.

  • Smaller arcs indicate lower support for that child.

  • When you mouse over the chart, the prediction rules will be shown to the right of the diagram as in the tree visualization view. However, the Sunburst diagram summarizes the prediction rules whenever possible. For example, two rules applicable to a leaf node may read: x <= 2 and 2 < x < 7. The sunburst view would combine these conditions and restate it as x < 7, which makes it easier to read and understand.

  • When you click on a child ring, you zoom in the diagram, and all layers above the clicked one are collapsed into the diagram center. In the pine tree analogy, clicking on a ring would be equivalent to moving the view point down along the tree, so you can see more detail from the bottom layers. Click the center of the Sunburst to move up one level up to the tip.

\includegraphics[]{images/models/sunburst}
Figure 1.33 Sunburst visualization

As a final note, you can color the chart by field, by prediction, or by confidence (or expected error in case of regression trees).

\includegraphics[]{images/models/sunburst-colors}
Figure 1.34 Change Sunburst colors
\includegraphics[]{images/models/sunburst-colors2}
Figure 1.35 Sunburst colors