Classification and Regression with the BigML Dashboard
3.5 Visualizing Linear Regressions
After creating your linear regression, you will be able to analyze your results with BigML unique visualization: a 1D chart and a Partial Dependence Plot (PDP), to examine the impact of the input fileds in the Objective Field, and a coefficients table, for more advanced users, to interpret the resulting coefficients for each input field. The following subsections explain both visualizations in detail.
Switch among the three views of 1D chart, PDP and table by clicking on icons in the top bar menu of the linear regression view. (See Figure 3.49 .)
![\includegraphics[]{images/linearregression/lnr-table-chart}](images/img-0259.png)
3.5.1 Linear Regression Chart
Both views of 1D chart and PDP are composed of three main parts: the CHART or PLOT, the PREDICTION legend and the INPUT FIELDS form. (See Figure 3.50 ). You can find a detailed explanation of each one below.
![\includegraphics[]{images/linearregression/lnr-chart-parts}](images/img-0260.png)
Both the 1D Chart and the Partial Dependence Plot (PDP) allow you to view the impact of the input fields on the objective classes predictions, and their relationship. You can select the 1D chart or PDP by clicking on the selection buttons in the top bar menu.
The 1D chart, allows you to select one input field for the x-axis. The y-axis represents the objective field. Only numeric fields can be selected for the x-axis. (See chart limitations in subsection 3.8.1 ). You can extend the upper limit of the x-axis by clicking on the plus icon.
The blue band is formed by the upper bounds and lower bounds of the 95% prediction intervals. This means, for any given point at x-axis, its y value will be within this blue range with 95% probability. You can hide or show the band by clicking on the icon next to the field name of the y-axis.
Figure 3.51 1D chart The PDP allows you to select two different input fields for both axis and the values of the objective field are represented by differences in a color scale in the heatmap chart. You can select numeric or categorical fields for the axis. You can switch the axis by clicking on the option on top of the chart area.
Figure 3.52 Partial Dependence Plot In both charts you can inspect the axis values in the gray area boxes next to the selector. You can freeze the view by pressing
and release it again by pressing from your keyboard. When the view is frozen, an edit icon will appear you can edit the axis values and obtain a prediction for another preferred value.The resulting predicted probabilities are in the prediction legend to the right.The PREDICTION legend allows you to visualize the predicted values represented in the chart along with their corresponding colors. By default, in PDP, colors are shaded according to the prediction range shown in the chart area. This way, smaller differences in predictions are easier to perceive. However, you can choose to see the color shading according to the total range of values for the objective field by clicking on the icon next to the prediction bar Figure 3.53 )
. This option allows you to see the color scale for the total range of predictions. (SeeFigure 3.53 Prediction legend Again, freeze this view by pressing
, and release it again by pressing from your keyboard.Below the chart legend, you can find the INPUT FIELDS form. (See Figure 3.54 ). 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.
Figure 3.54 Configure the values for other input fields
Moreover, the chart includes a reset option for your input fields values, and an export option to download your chart in PNG format explained below:
After selecting the fields for the axis or configuring the input fields values, you can set them again to the default view by clicking the reset icon highlighted in Figure 3.55 .
Figure 3.55 Reset the values for the input fields You can also export your chart in PNG format with or without legends. Freeze the view by pressing
from your keyboard and export the chart to get the classes percentages in the legend. Release the view by pressing .Figure 3.56 Export chart as image with or without legends
Note: there are some limitations in the number of input fields to visualize your linear regression in the chart (explained in subsection 3.8.1 ).
3.5.2 Coefficient Table
The main goal of the linear regression algorithm is to learn the coefficients of the linear function for each of the dependent variables, i.e., for each of the input fields. See section 3.2 for a detailed explanation of linear regression coefficients interpretation.
BigML allows you to inspect the learned coefficients for each one of the input fields in the coefficient table. The table columns represent coefficients and their statistics while the table rows represent the input field variables and the Bias (a.k.a. intercept term) of the linear regression. In the first row you will always find the Bias coefficients. You can sort the table rows by clicking on any of the columns labels.
![\includegraphics[]{images/linearregression/lnr-table-view}](images/img-0267.png)
For numeric fields, there is always one coefficient by field, however categorical, text and items fields have one coefficient by value (category, term or item). This is due to the required transformations, explained in section 3.2 , to convert categorical, text, and items fields to numeric fields (each single value is mapped to a separate variable in the formula). Missing values also get their own coefficients.
For numeric fields, you always get one coefficient per field. If a field contains missing values, you will find an additional coefficient per field for the missing values. (See subsection 3.2.2 .)
For categorical fields, you have one coefficient per class and an additional one for missing values per field. (See subsection 3.2.3 and subsection 3.4.6 .)
Note: if you configure the field with Contrast or Other coding there will be just one coefficient for that field (see subsection 3.4.6 ).
For text fields, there is one coefficient per term and an additional one for missing values per field.
For items fields, you get one coefficient per item and an additional one for missing values per field.
See an example of coefficients for a categorical field in Figure 3.58 where one single field, “Atmospheric condition”, yields eleven different variables associated with different coefficients. There are twelve classes in the categorical field, with one set as the dummy class.
![\includegraphics[]{images/linearregression/lnr-categorical-field-transformation}](images/img-0268.png)
Coefficients for missing values are always found at the end of the table. (See Figure 3.59 )
![\includegraphics[]{images/linearregression/lnr-missing-coeff-table}](images/img-0216.png)
Next to each coefficient you will find one icon indicating if it is significant (see Figure 3.60 ) or non-significant (see Figure 3.61 ).
![\includegraphics[width=2cm]{images/linearregression/lnr-significant-icon}](images/img-0269.png)
![\includegraphics[width=2cm]{images/linearregression/lnr-non-significant-icon}](images/img-0270.png)
The significance of a coefficient is determined by comparing the p-value against the significance level selected in the top menu (see Figure 3.62 ). If the p-value is higher than the significance level, the coefficient will be non-significant. If the p-value is lower than the significance level, the coefficient will be significant. A good practice is to retrain the linear regression removing the non-significant coefficients. However, in most cases, the model performance should not be affected.
![\includegraphics[]{images/linearregression/lnr-significance}](images/img-0271.png)
![\includegraphics[]{images/linearregression/lnr-icons-significance}](images/img-0272.png)
Next to each icon indicating the significance of a coefficient, you will find a \(\sigma \) symbol. If you mouse over it, a tooltip will display a summary of the stats for that coefficient. (See Figure 3.64 .) First, you will find the p-value from the Wald test. As mentioned in the previous point, this p-value is compared against the selected significance level to determine the coefficient’s significance. Then, associated with the Z score chart, you will find the Z score value, the confidence interval for a 95% confidence and the standard error, or variance, of the coefficient estimate.
![\includegraphics[]{images/linearregression/lnr-summary-stats}](images/img-0273.png)
You can download all the stats information by clicking in the download CSV icon in the top menu to the right. (See subsection 3.7.1 .)
Additional options for the table include a filtering option and an export option:
You can filter the table first column by field name, class, term or item using the search box at the top of the table (see Figure 3.65 .)
Figure 3.65 Search and filter linear regression table You can also export the table in a CSV file by clicking on the icon highlighted in Figure 3.66 .
Figure 3.66 Export table in CSV file