## Contents

- Description of demo_multiclass_decisions.m
- usage of stump classification (binary data)
- usage of decision tree classification (binary data)
- usage of stump classification (4grid data)
- usage of decision tree classification (4grid data)
- usage of stump classification (gridMulti data)
- usage of decision tree classification (gridMulti data)

## Description of demo_multiclass_decisions.m

Shows the performance of stump and decision trees on a variety of different datasets

    clear all
    close all
    generateData_binary

## usage of stump classification (binary data)

    options_st = [];
    model_st = ml_multiclass_stump(Xtrain, ytrain, options_st);
    yhat_st = model_st.predict(model_st, Xtest);
    testError_st = mean(yhat_st ~= ytest);
    fprintf('Averaged misclassification test error with %s is: %.3f\n', ...
            model_st.name, testError_st);

    Averaged misclassification test error with Stump Classification is: 0.067

## usage of decision tree classification (binary data)

    options_dt = [];
    model_dt = ml_multiclass_decisionTree(Xtrain, ytrain, options_dt);
    yhat_dt = model_dt.predict(model_dt, Xtest);
    testError_dt = mean(yhat_dt ~= ytest);
    fprintf('Averaged misclassification test error with %s is: %.3f\n', ...
            model_dt.name, testError_dt);

    Averaged misclassification test error with Decision Tree is: 0.093

    figure;
    plotClassifier(Xtrain, ytrain, model_st);
    figure;
    plotClassifier(Xtrain, ytrain, model_dt);

    generateData_4grid

## usage of stump classification (4grid data)

    options_st = [];
    model_st = ml_multiclass_stump(Xtrain, ytrain, options_st);
    yhat_st = model_st.predict(model_st, Xtest);
    testError_st = mean(yhat_st ~= ytest);
    fprintf('Averaged misclassification test error with %s is: %.3f\n', ...
            model_st.name, testError_st);

    Averaged misclassification test error with Stump Classification is: 0.538

## usage of decision tree classification (4grid data)

    options_dt = [];
    model_dt = ml_multiclass_decisionTree(Xtrain, ytrain, options_dt);
    yhat_dt = model_dt.predict(model_dt, Xtest);
    testError_dt = mean(yhat_dt ~= ytest);
    fprintf('Averaged misclassification test error with %s is: %.3f\n', ...
            model_dt.name, testError_dt);

    Averaged misclassification test error with Decision Tree is: 0.333

    figure;
    plotClassifier(Xtrain, ytrain, model_st);
    figure;
    plotClassifier(Xtrain, ytrain, model_dt);

    generateData_gridMulti

## usage of stump classification (gridMulti data)

    options_st = [];
    model_st = ml_multiclass_stump(Xtrain, ytrain, options_st);
    yhat_st = model_st.predict(model_st, Xtest);
    testError_st = mean(yhat_st ~= ytest);
    fprintf('Averaged misclassification test error with %s is: %.3f\n', ...
            model_st.name, testError_st);

    Averaged misclassification test error with Stump Classification is: 0.596

## usage of decision tree classification (gridMulti data)

    options_dt = [];
    model_dt = ml_multiclass_decisionTree(Xtrain, ytrain, options_dt);
    yhat_dt = model_dt.predict(model_dt, Xtest);
    testError_dt = mean(yhat_dt ~= ytest);
    fprintf('Averaged misclassification test error with %s is: %.3f\n', ...
            model_dt.name, testError_dt);

    Averaged misclassification test error with Decision Tree is: 0.373

    figure;
    plotClassifier(Xtrain, ytrain, model_st);
    figure;
    plotClassifier(Xtrain, ytrain, model_dt);