From d858e26e4bcc47e493dcb92e2cf955d95116cc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Wed, 6 Mar 2024 17:04:16 +0100 Subject: [PATCH] Update version number and Changelog --- CHANGELOG.md | 3 ++- CMakeLists.txt | 2 +- docs/BoostAODE.md | 2 +- src/ensembles/BoostAODE.cc | 8 ++++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe8c2cd..dc0a6a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.0.4] ### Added @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Change the library structure adding folders for each group of classes (classifiers, ensembles, etc). +- The significances of the models generated under the feature selection algorithm are now computed after all the models have been generated and an αt value is computed and assigned to each model. ## [1.0.3] diff --git a/CMakeLists.txt b/CMakeLists.txt index 0babab8..327f09b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.20) project(BayesNet - VERSION 1.0.3 + VERSION 1.0.4 DESCRIPTION "Bayesian Network and basic classifiers Library." HOMEPAGE_URL "https://github.com/rmontanana/bayesnet" LANGUAGES CXX diff --git a/docs/BoostAODE.md b/docs/BoostAODE.md index 6a32ab6..a04cc0e 100644 --- a/docs/BoostAODE.md +++ b/docs/BoostAODE.md @@ -16,7 +16,7 @@ The hyperparameters defined in the algorithm are: - ***tolerance*** (*int*): Sets the maximum number of models that can worsen the result without constituting a termination condition. Default value: *0*. -- ***select_features*** (*{"IWSS", "FCBF", "CFS", ""}*): Selects the variable selection method to be used to build initial models for the ensemble that will be included without considering any of the other exit conditions. Once the models of the selected variables are built, the algorithm will update the weights using the ensemble and set the significance of all the models built with the same alpha_t. Default value: *""*. +- ***select_features*** (*{"IWSS", "FCBF", "CFS", ""}*): Selects the variable selection method to be used to build initial models for the ensemble that will be included without considering any of the other exit conditions. Once the models of the selected variables are built, the algorithm will update the weights using the ensemble and set the significance of all the models built with the same αt. Default value: *""*. - ***threshold*** (*double*): Sets the necessary value for the IWSS and FCBF algorithms to function. Accepted values are: - IWSS: $threshold \in [0, 0.5]$ diff --git a/src/ensembles/BoostAODE.cc b/src/ensembles/BoostAODE.cc index bc75dfb..e8a5166 100644 --- a/src/ensembles/BoostAODE.cc +++ b/src/ensembles/BoostAODE.cc @@ -181,17 +181,17 @@ namespace bayesnet { prob_table += model->predict_proba(X) * 1.0; } // prob_table doesn't store probabilities but the sum of them - // to have them we need to divide by the sum of the significances but we - // don't need them to predict label values + // to have them we need to divide by the sum of the "weights" used to + // consider the results obtanined in the model's predict_proba. return prob_table.argmax(1); } void BoostAODE::trainModel(const torch::Tensor& weights) { + // Algorithm based on the adaboost algorithm for classification + // as explained in Ensemble methods (Zhi-Hua Zhou, 2012) initialize_prob_table = true; fitted = true; double alpha_t = 0; - // Algorithm based on the adaboost algorithm for classification - // as explained in Ensemble methods (Zhi-Hua Zhou, 2012) torch::Tensor weights_ = torch::full({ m }, 1.0 / m, torch::kFloat64); bool exitCondition = false; std::unordered_set featuresUsed;