Help Manual

Contents






Sigma Magic Help Version 17

Model Selection

Overview

Automated Model Selection can be used to pick the best possible model for the given data set. You can specify multiple different types of models to use, and the system will fit each of these models to the data set. Then, the best possible model will be reported based on the model selection criteria. The input data set is divided into train and test data sets; the training data set is used to train the model, and the test data set is used to evaluate the model. A statistical comparison of the models is also performed to see any statistical differences in the developed models. Once you pick the best model, you can use that model to make predictions.

Note that this functionality requires that RScript software be installed on your computer and linked to the Sigma Magic software within the options menu. Multiple Models worksheet can be added to your active workbook by clicking on Analytics and then selecting Multiple Models.

Inputs

Setup

Click on Analysis Setup to open the menu options for this tool. A sample screenshot of the menu is shown below.
menu 1
1
Response Type: Specify the response data type you want to use to fit this model. The typical options for the response type are shown below. Select the type of response data you are dealing with.
OptionDescription
BinaryThe response variable only contains two classes. For example, True/False, or Good/Bad, etc./td>
ClassificationThe response variable can contain two or more classes. For example, Grades A, B, C, D, E, and F.
RegressionThe response variable is usually a continuous variable. For example, temperatures, pressures, etc., can take on any value.
2
Model Selection: Specify the metric to use when selecting the best model. The available options depend on the type of response.
OptionResponse TypeDescription
RMSERegressionUses the smallest value of the Root Mean Square Error (RMSE) to pick the best model.
MAERegressionUses the smallest value of the Mean Absolute Error (MAE) to pick the best model.
AccuracyBinary, ClassificationUses the largest value of the percentage of items that are matched correctly to pick the best model.
KappaBinary, ClassificationUses the largest value of the Kappa statistic to pick the best model.
ROCBinaryUses the largest value of the Area Under the ROC curve to pick the best model.
3
Search Models: You can type some keywords to filter the list of available models. For example, you can search for "boosted" models. Only those models that contain the keywords are displayed under the list of available models.
4
Selected Models: Use the drag-and-drop feature to select the models you want to consider and fit the given data set. Ensure you don't pick too many models in this list as it may take a long time to fit all the models - especially if you have large data sets.
5
Available Models: The left side panel shows the list of available models. This list changes if you change the response type of the output data set.
6
Help Button: Click on the Help Button to view the help documentation for this tool.
7
Cancel Button: Click on the Cancel Button to discard your changes and exit this menu.
8
OK Button: Click on the OK Button to save your changes and try to execute the program. Note that we do not control the algorithms for fitting these models, and there is no guarantee that the model will properly fit your selected data set. You can contact the R community for any possible resolution if there are model errors.

Data

You will see the following dialog box if you click the Data button. Here, you can specify the data required for this analysis. Data
1
Search Data: The available data displays all the columns of data that are available for analysis. You can use the search bar to filter this list and speed up the search for the right data for analysis. Enter a few characters in the search field, and the software will filter and display the filtered data in the Available Data box.
2
Available Data: The available data box contains the list of data available for analysis. If your workbook has no data in tabular format, this box will display "No Data Found." The information displayed in this box includes the row number, whether the data is Numeric (N) or Text (T), and the name of the column variable. Note that the software displays data from all the tables in the current workbook. Even though data within the same table have unique column names, columns across different tables can have similar names. Hence, it is crucial that you not only specify the column name but also the table name.
3
Add or View Data: Click on this button to add more data to your workbook for analysis or to view more details about the data listed in the available data box. When you click on this button, it opens the Data Editor dialog box, where you can import more data into your workbook. You can also switch from the list view to a table view to see the individual data values for each column.
4
Required Data: The code for the required data specifies what data can be specified for that box. An example code is N: 2-4. If the code starts with an N, you must select only numeric columns. If the code begins with a T, you can select numeric and text columns. The numbers to the right of the colon specify the min-max values. For example, if the min-max values are 2-4, you must select a minimum of 2 columns of data and a maximum of 4 columns in this box. If the minimum value is 0, then no data is required to be specified for this box.
5
Select Button: Click on this button to select the data for analysis. Any data you choose for the analysis is moved to the right. To select a column, click on the columns in the Available Databox to highlight them and then click on the Select Button. A second method to choose the data is to double-click on the columns in the list of Available Data. Finally, you can drag and drop the columns you are interested in by holding down the select columns using your left mouse key and dragging and dropping them in one of the boxes on the right.
6
Selected Data: You will need to select one column for the response data and one or more columns as the factor/features for the given model. If the right number of data columns has been specified, the list box header will be displayed in black. If sufficient data has not been specified, the list box header will be displayed in red. Note that you can double-click on any of the columns in this box to remove them from the box.
7
View Selection: Click on this button to view the data specified for this analysis. The data can be viewed in a tabular format or a graphical summary of the selected data.

Train

If you click the Train button, the software will let you pick the options for training the given model. Training is a step where we split the data into groups - a train data set and a test data set. The train data set is used to build the model, and the test data set is used to evaluate how good of a model we have built. We don't want to use the same data set for both test and train since we can have overfitting, and the model may perform excellently on the train data set but may perform poorly on data sets it has not seen. The train function can be used for the following:
  1. Evaluate the effect of model tuning parameters on performance
  2. Choose the "optimal" model across these paramters
  3. Estimate model performance from a training set
A sample screenshot of the training page is shown in this figure. Data
1
Sampling Method: Specify the method to use to determine the test/train data sets. The available options are:
OptionDescription
NoneDo not split the data into test and train data sets. Use the entered data for training and testing purposes. Note that using this method, you cannot tune the model using tuning length or grid methods.
BootUse the bootstrap method for determining the test and train data sets. The bootstrap method involves repeated drawing of samples from the data set with replacement. If you use this method, you must specify the number of resamples.
Cross Validation (CV)Cross-validation involves dividing the available data into multiple folds or subsets and using one of these folds for validation and the remaining folds for training. This process is repeated multiple times, using a different fold for validation. Finally, the results from each validation step are averaged to produce a more robust estimate of the model's performance. If you use this method, you must specify the number of folds.
Leave One Out Cross Validation (LOOCV)It is a method of cross-validation where each data point is used for validation, and the rest of the data is used for training. This method is very computationally expensive if you have large data sets but is simple to use and requires no configuration.
Leave Group Out Cross Validation (LGOCV)It is a method of cross-validation where a set of data points is used for validation, and the rest of the data is used for training. You must specify this method's hold-out percentage (0-100)%.
Repeated Cross Validation (RepeatedCV)In this method the cross-validation is repeated multiple times. You will need to specify the number of folds and the number of repeats. For example, if you specify five repeats of 10-fold cross-validation, it will perform 10-fold cross-validation on the training data 5 times, using a different set of folds for each cross-validation. The rationale is to come up with better accuracy and robust results.
2
Holdout Percent: Specify the % of data to hold out for performing validation testing. The % specified should be between 0 - 100%. Note that this value is only enabled for the LGOCV method.
3
Num K-Folds: Specify the number of K-folds for cross-validation. If you specify 5, it means that the data is split into five groups. Hence, each group contains 20% of the data points. The first 20% of the data points are used for the first validation and the remaining 80% for training. The second 20% of the data is used for the second validation. This value is to be specified for CV and RepeatedCV methods. The bootstrap sampling method specifies the number of resamples of the data to use.
4
Num Repeats: Specify the number of repeats for repeated cross-validations. This textbox is disabled for other methods.
5
Random Seed: Specify the random seed value. Use a value of 0 for truly random numbers. If you want to replicate your results between runs, specify the seed value for the random number generator.
6
Sub Sampling: Specify the sampling strategy to use when selecting the samples. In classification problems, a disparity in the frequencies of the observed classes can significantly impact model fitting. Class imbalances can be mitigated using a sampling strategy.
OptionDescription
NoneDo not use any sampling strategy. Select the samples at random.
UpUse the up-sampling strategy. Randomly sample with replacement the minority class to be the same size as the majority class.
DownUse the down-sampling strategy. Randomly subset all the classes in the training set so that their class frequencies match the least prevalent class.
7
Pre Process: Specify if you want to pre-process your data before you fit a model. The available options are:
OptionDescription
NoneNo pre-processing of data is performed before model fitting. The data is used as-is.
CenterSubtract a mean value from each of the data points so that the average factor value is zero.
Center, ScaleSubtract a mean value from each of the data points and divide by its standard deviation so that the average factor value is zero and the standard deviation is one.
RangeAdjust the values such that the minimum value is mapped to 0 and the maximum value is mapped to 1.
ScaleDivide each of the values by the standard deviation so that the standard deviation of the factor is 1..
8
Tuning Length: Since multiple models are involved, and each may have a different set of hyperparameters, only the random search method is available for model tuning. You can specify the number of searches in the Tuning Length parameter.

Verify

If you click the Verify button, the software will perform some checks on the data you entered. A sample screenshot of the data is shown in this figure. Model Selection  Inputs 4
1
Verify Checks: The objective of this analysis and any checks performed are listed in this dialog box. For example, the software may check if you have correctly specified the input options and if you have specified the data correctly for analysis.
2
Check Status: The results of the analysis checks are listed here. If the checks are passed, they are shown as a green checkmark. If the verification checks fail, they are shown as a red cross. If the verification checks result in a warning, they are shown in the orange exclamation mark. Finally, any checks that are required to be performed by the user are shown as blue info icons.
3
Overall Status: The overall status of all the checks for the given analysis is shown here. The overall status check shows a green thumps-up sign if everything is okay and a red thumps-down sign if any checks have not passed. Note that you cannot proceed with generating analysis results for some analyses if the overall status is not okay.

Outputs

Click on Compute Outputs to update the results on the worksheet. A sample screenshot of the worksheet is shown below.
Multiple Models
1
Notes Section: The notes section provides a summary of the input data, and the analysis results section shows the name of the response variable and the input variables' names. The analysis results section shows which models fit the given data set and the fit results. The model with the highest accuracy (or the metric specified under model selection) selects the best model.
2
Graph Section: The graph section shows a chart for each model's accuracy and a statistical comparison of the fits as differences between models. If the vertical line through 0 intersects the confidence interval chart, statistically, there is no difference between those two models. The overall best model is listed in the conclusions.

Notes

Here are a few pointers regarding this analysis:
  • This analysis requires that the R software needs to be installed on your computer. Further, you will need to provide a link to the RScript executable file under Sigma Magic Options so that the software can use the R software to generate analysis results.

Examples

The following examples are in the Examples folder.
  • For the data in the file, fit multiple models and pick the best model for prediction. (Multiple Models 1.xlsx)

References

For more information on this topic, please refer to the following articles. Do note that if any external links are mentioned below, they are for reference purposes only.


© Rapid Sigma Solutions LLP. All rights reserved.