mirror of
https://github.com/rmontanana/mdlp.git
synced 2025-08-18 00:45:57 +00:00
* 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
34 lines
939 B
C++
34 lines
939 B
C++
// ****************************************************************
|
|
// 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
|