Visualization and Results Formatting

Documentation of the code in src.final. Below you can find the documentation to all modules, which create the figures and table for the final paper. The output folder for all figures is bld.out.figures and bld.out.tables for the table.

Figures for the Theory Simulations and Calculations

Documentation of the code in src.final.theory_simulation.

Figure 2 - Simulating the convergence of the predictor

The module which created Figure 2 of the final paper can be found under src.final.theory_simulation.plot_finite_sample. The calculations for this have been performed in the module calc_finite_sample, which can be found under src.analysis.theory_simulation and has been described in Main Calculations and Simulations. The .pickle files, which were created by the module described above and which are used here, where saved under bld.out.analysis.theory_simulation.

plot_finite_sample(settings_plotting, output_finite_sample)[source]

A function that creates figure 5 in the final paper.

settings_plotting: Dictionary as described in Model specifications
The dictionary contains all plotting specifications that are shared across various modules.

output_finite_sample: Dictionary as defined by calc_finite_sample in src.analysis.theory_simulation

The dictionary that contains the simulation results for bagging the indicator function for different sample sizes.

Figure 3 - Bias, Variance and MSE of the predictor in the introductory example

The module which created Figure 2 of the final paper can be found under src.final.theory_simulation.plot_toy_example. The calculations for this have been performed in the module calc_toy_example, which can be found under src.analysis.theory_simulation and has been described in Main Calculations and Simulations. The .pickle files, which were created by the module described above and which are used here, where saved under bld.out.analysis.theory_simulation.

plot_toy_example(settings_plotting, output_toy_example)[source]

A function that creates figure 3 in the final paper.

settings_plotting: Dictionary as described in Model specifications
The dictionary contains all plotting specifications that are shared across various modules.

output_toy_example: Dictionary as defined by calc_toy_example in src.analysis.theory_simulation

The dictionary that contains the calculation results for the bagged and unbagged indicator function.

Figure 4 - Bias, Variance and MSE for the stump predictor

The module which created Figure 4 of the final paper can be found under src.final.theory_simulation.plot_normal_splits. The calculations for this have been performed in the module calc_normal_splits, which can be found under src.analysis.theory_simulation and has been described in Main Calculations and Simulations. The .pickle files, which were created by the module described above and which are used here, where saved under bld.out.analysis.theory_simulation.

plot_normal_splits(settings_plotting, settings_normal_splits, output_normal_splits)[source]

A function that creates figure in the final paper.

settings_plotting: Dictionary as described in Model specifications
The dictionary contains all plotting specifications that are shared across various modules.
settings_normal_splits: Dictionary as described in Model specifications
The dictionary defines the calculation set-up that is specific to the stump predictor simulation.

output_normal_splits: Dictionary as defined by calc_normal_splits in src.analysis.theory_simulation

The dictionary that contains the simulation results for subagging of stump predictors for a range of subsampling fractions.

Figures and Table for the Main Simulations

Documentation of the code in src.final.main_simulation.

Table 1 - The bagged Tree compared to the unbagged Tree

Figure 5 - The bagging Estimator convergences towards a stable value

The module which created Figure 5 of the final paper can be found under src.final.main_simulation.plot_simulation_convergence. and a figure with the same style for the indicator function for the appendix. The calculations for this have been performed in the module calc_simulation_convergence, which can be found under src.analysis.main_simulation and has been described in Main Calculations and Simulations. The .pickle files, which were created by the module described above and which are used here, where saved under bld.out.analysis.main_simulation.

plot_convergence(settings_plotting, convergence_settings, models, appendix)[source]

A function that creates figure 5 in the final paper and a figure with the same style for the indicator function for the appendix.

settings_plotting: Dictionary as described in Model specifications
The dictionary contains all plotting specifications that are shared across various modules.
convergence_settings: Dictionary as described in Model specifications
The dictionary defines the simulation set-up that is specific to the convergence of the Bagging Algorithm.
models: list of shape = 2
The list of regression functions that should be contained in the figure. Must be of length 2. In the specification chosen in the paper, it will plot the Friedman 1 Model and the Linear Model.
appendix: bool
Indicate if we create the figure for the appendix. This simply implies that the figure will only contain one model. Therefore the figure size and the legend positioning will be adjusted accordingly.

Figure 6 - The effectiveness of Subagging compared to Bagging

The module which created Figure 6 of the final paper can be found under src.final.main_simulation.plot_simulation_subagging*and a figure with the same style for the indicator function for the appendix. The calculations for this have been performed in the module *calc_simulation_subagging, which can be found under src.analysis.main_simulation and has been described in Main Calculations and Simulations. The .pickle files, which were created by the module described above and which are used here, where saved under bld.out.analysis.main_simulation.

plot_subagging(settings_plotting, subagging_settings, models, appendix)[source]

A function that creates figure 6 in the final paper and a figure with the same style for the indicator function for the appendix.

settings_plotting: Dictionary as described in Model specifications
The dictionary contains all plotting specifications that are shared across various modules.
subagging_settings: Dictionary as described in Model specifications
The dictionary defines the simulation set-up that is specific to the subagging simulation.
models: list of shape = 2
The list of regression functions that should be contained in the figure. Must be of length 2. In the specification chosen in the paper, it will plot the Friedman 1 Model and the Linear Model.
appendix: bool
Indicate if we create the figure for the appendix. This simply implies that the figure will only contain one model. Therefore the figure size and the legend positioning will be adjusted accordingly.

Figure 7 - The effect of varying the Tree depth

The module which created Figure 7 of the final paper can be found under src.final.main_simulation.plot_simulation_tree_depth and a figure with the same style for the indicator function for the appendix. The calculations for this have been performed in the module calc_simulation_tree_depth, which can be found under src.analysis.main_simulation and has been described in Main Calculations and Simulations. The .pickle files, which were created by the module described above and which are used here, where saved under bld.out.analysis.main_simulation.

plot_tree_depth(settings_plotting, tree_depth_settings, models, appendix)[source]

A function that creates figure 7 in the final paper and a figure with the same style for the indicator function for the appendix.

settings_plotting: Dictionary as described in Model specifications
The dictionary contains all plotting specifications that are shared across various modules.
tree_depth_settings: Dictionary as described in Model specifications
The dictionary defines the simulation set-up that is specific to the tree depth simulation.
models: list of shape = 2
The list of regression functions that should be contained in the figure. Must be of length 2. In the specification chosen in the paper, it will plot the Friedman 1 Model and the Linear Model.
appendix: bool
Indicate if we create the figure for the appendix. This simply implies that the figure will only contain one model. Therefore the figure size and the legend positioning will be adjusted accordingly.

Figure for the Real Data Simulation

Documentation of the code in src.final.real_data_simulation.

Figure 8 - Bagging and Subagging applied to real data

The module which created Figure 8 of the final paper can be found under src.final.real_data_simulation.plot_boston. The calculations for this have been performed in the module calc_boston, which can be found under src.analysis.real_data_simulation and has been described in Main Calculations and Simulations. The .pickle files, which were created by the module described above and which are used here, where saved under bld.out.analysis.real_data_simulation.

plot_boston(settings_plotting, subagging_settings, output_boston)[source]

A function that creates figure 8 in the final paper.

settings_plotting: Dictionary as described in Model specifications
The dictionary contains all plotting specifications that are shared across various modules.
subagging_settings: Dictionary as described in Model specifications
The dictionary defines the simulation set-up that is specific to the subagging simulation.

output_boston: Dictionary as defined by calc_boston in src.analysis.real_data_simulation

The dictionary that contains the simulation results for bagging and subagging (for the ratio range) for the boston housing data.