From afb4e930d00ccdf06021fa46a86f4d8366660c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Wed, 3 Apr 2024 11:01:54 +0200 Subject: [PATCH] Update version number and CHANGELOG --- CHANGELOG.md | 23 +++++++++++++++++++++++ CMakeLists.txt | 2 +- folding.hpp | 2 ++ tests/TestFolding.cc | 13 +++++++++++-- 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8a0d7d9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,23 @@ +# Changelog + +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). + +## [1.0.1] 2024-04-03 + +### Added + +- Possibility to check the indices of the training and testing sets in the K-Fold and Stratified K-Fold partitioning. Now disabled due to apple's clang compiler mt19937 implementation. + +### Changed + +- Random number generator is changed to mt19937 to improve the robustness of the models generated. + +## [1.0.0] 2024-01-08 + +### Added + +- K-Fold partitioning for training and testing +- Stratified K-Fold partitioning for training and testing diff --git a/CMakeLists.txt b/CMakeLists.txt index d591480..6229ffa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.20) project(Folding - VERSION 1.0.0 + VERSION 1.0.1 DESCRIPTION "Folding utility for BayesNet library" HOMEPAGE_URL "https://github.com/rmontanana/folding" LANGUAGES CXX diff --git a/folding.hpp b/folding.hpp index 2a1f73b..d8f38f4 100644 --- a/folding.hpp +++ b/folding.hpp @@ -4,6 +4,7 @@ #include #include #include +#include "config.h" namespace folding { class Fold { protected: @@ -20,6 +21,7 @@ namespace folding { } virtual std::pair, std::vector> getFold(int nFold) = 0; virtual ~Fold() = default; + std::string version() { return { project_version.begin(), project_version.end() }; } int getNumberOfFolds() { return k; } }; class KFold : public Fold { diff --git a/tests/TestFolding.cc b/tests/TestFolding.cc index a3759be..7d61724 100644 --- a/tests/TestFolding.cc +++ b/tests/TestFolding.cc @@ -4,8 +4,17 @@ #include "TestUtils.h" #include "folding.hpp" +TEST_CASE("Version Test", "[Folding]") +{ + std::string actual_version = { project_version.begin(), project_version.end() }; + auto data = std::vector(100); + folding::StratifiedKFold stratified_kfold(5, data, 17); + REQUIRE(stratified_kfold.version() == actual_version); + folding::KFold kfold(5, 100, 19); + REQUIRE(kfold.version() == actual_version); +} -TEST_CASE("KFold Test", "[Platform][KFold]") +TEST_CASE("KFold Test", "[Folding]") { // Initialize a KFold object with k=5 and a seed of 19. std::string file_name = GENERATE("iris", "diabetes", "glass"); @@ -45,7 +54,7 @@ map counts(std::vector y, std::vector indices) return result; } -TEST_CASE("StratifiedKFold Test", "[Platform][StratifiedKFold]") +TEST_CASE("StratifiedKFold Test", "[Folding]") { // Initialize a StratifiedKFold object with k=3, using the y std::vector, and a seed of 17. std::string file_name = GENERATE("iris", "diabetes", "glass");