Fix BinDisc quantile mistakes (#9)

* Fix BinDisc quantile mistakes

* Fix FImdlp tests

* Fix tests, samples and remove uneeded support files

* Add coypright header to sources
Fix coverage report
Add coverage badge to README

* Update sonar github action

* Move sources to a folder and change ArffFiles files to library

* Add recursive submodules to github action
This commit is contained in:
Ricardo Montañana Gómez
2024-07-04 17:27:39 +02:00
committed by GitHub
parent 7b0673fd4b
commit e36d9af8f9
35 changed files with 1383 additions and 923 deletions

33
src/BinDisc.h Normal file
View File

@@ -0,0 +1,33 @@
// ****************************************************************
// SPDX - FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez
// SPDX - FileType: SOURCE
// SPDX - License - Identifier: MIT
// ****************************************************************
#ifndef BINDISC_H
#define BINDISC_H
#include "typesFImdlp.h"
#include "Discretizer.h"
#include <string>
namespace mdlp {
enum class strategy_t {
UNIFORM,
QUANTILE
};
class BinDisc : public Discretizer {
public:
BinDisc(int n_bins = 3, strategy_t strategy = strategy_t::UNIFORM);
~BinDisc();
// y is included for compatibility with the Discretizer interface
void fit(samples_t& X_, labels_t& y) override;
void fit(samples_t& X);
private:
void fit_uniform(const samples_t&);
void fit_quantile(const samples_t&);
int n_bins;
strategy_t strategy;
};
}
#endif