GSoC'24: Final Report

Welcome to Octave and Google Summer of Code // Erivelton's GSoC 2018

Project Details

Title: Adding GAM and Discriminant Classification Classes and Implementing Missing Methods

Organization: GNU Octave, Google Summer of Code

Mentor: Andreas Bertsatos

Community Discussion Thread: [ Discourse Thread ]

Project Fork: [ Fork ]

All Contributions: [ ALL ]

Blogs: [ Blogs ]

Project Proposal: [ Proposal Archive ]

Overview:

This project focused on extending the classification capabilities of the GNU Octave statistics package by adding new classification classes—ClassificationGAM and ClassificationDiscriminant—and enhancing the existing ClassificationKNN class with additional methods. These contributions aimed to bridge the gap between GNU Octave and MATLAB, providing users with more advanced tools for data analysis and machine learning.

Project Goals:

The primary goal of this project was to enhance the GNU Octave statistics package by introducing new classification models and extending existing ones. Specifically, the objectives were:

  1. Enhance the ClassificationKNN class: Add missing methods and functionality, including cross-validation (crossval), margin calculations (margin), loss calculations (loss), and partial dependence (partialDependence).

  2. Develop the ClassificationDiscriminant class: Implement linear discriminant analysis using the fitcdiscr function.

  3. Develop the ClassificationGAM class: Implement a Generalized Additive Model (GAM) for binary classification.

Achievements:

  1. Enhanced ClassificationKNN Class: The crossval method was added to enable cross-validation for ClassificationKNN. Developed methods for loss, margin, and partialDependence. Enhanced the class with comprehensive tests and documentation to ensure robustness.

  2. Implemented ClassificationPartitionedModel: Developed the ClassificationPartitionedModel class, including its constructor and the kfoldPredict method, enhancing Octave’s functionality for handling partitioned models and cross-validation.

  3. Implemented ClassificationDiscriminant Class: Developed the ClassificationDiscriminant class and the fitcdiscr function, enabling linear discriminant analysis. Implemented various methods, including predict, loss, margin, and crossval. Focused on optimizing the implementation to work efficiently within Octave’s framework.

  4. Implemented ClassificationGAM Class: Created a new class in Octave for generalized additive modeling in binary classification, with the fitcgam function to fit the model. Implemented the core algorithms for GAM, focusing on spline fitting and gradient boosting to handle non-linear predictor effects. Added method for model prediction (predict).

What's Left to Do:

  1. Enhancements to ClassificationDiscriminant: The current implementation supports only linear discriminant analysis. It can be extended to include quadratic discriminant analysis, allowing a broader range of classification problems to be tackled.

  2. Improvements to ClassificationGAM: The model can be further enhanced by incorporating decision trees as weak learners, which would make the GAM more flexible and powerful. Additionally, more methods, such as loss and margin, can be added to the ClassificationGAM class.

Code Merged:

  1. The ClassificationPartitionedModel class and enhancements to the ClassificationKNN class have also been merged, including new methods and tests. PR 1, PR 2.

  2. The ClassificationGAM and ClassificationDiscriminant classes and their respective methods have been merged into the Octave statistics package. PR 3

Conclusion:

This report summarizes my contributions to the GNU Octave project during GSoC 2024. The project has provided me with invaluable experience in open-source development, and I look forward to continuing my involvement in the community.

Acknowledgment:

I would like to express my deepest gratitude to my mentor, Andreas Bertsatos, for his invaluable guidance throughout this project. I am also incredibly thankful to the GNU Octave community for their warm welcome, constructive feedback, and continuous support. Finally, I want to extend my appreciation to Google Summer of Code for providing this wonderful opportunity. This program has been an incredible platform for me to grow as a developer and contribute to a meaningful open-source project.

Thank you to everyone who has been a part of this journey.