mirror of
https://github.com/rmontanana/mdlp.git
synced 2025-08-17 16:35:57 +00:00
Refactor constructor
This commit is contained in:
@@ -8,16 +8,11 @@
|
|||||||
#include "Metrics.h"
|
#include "Metrics.h"
|
||||||
namespace mdlp {
|
namespace mdlp {
|
||||||
|
|
||||||
CPPFImdlp::CPPFImdlp():min_length(3), depth(0), max_depth(numeric_limits<int>::max()), proposed_cuts(0),
|
CPPFImdlp::CPPFImdlp(size_t min_length_, int max_depth_, float proposed): min_length(min_length_),
|
||||||
indices(indices_t()), X(samples_t()), y(labels_t()),
|
max_depth(max_depth_), proposed_cuts(proposed)
|
||||||
metrics(Metrics(y, indices)), num_cut_points(numeric_limits<size_t>::max())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CPPFImdlp::CPPFImdlp(size_t min_length_, int max_depth_, float proposed): min_length(min_length_), depth(0),
|
|
||||||
max_depth(max_depth_), proposed_cuts(proposed), indices(indices_t()), X(samples_t()), y(labels_t()),
|
|
||||||
metrics(Metrics(y, indices)), num_cut_points(numeric_limits<size_t>::max())
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
CPPFImdlp::CPPFImdlp() = default;
|
||||||
CPPFImdlp::~CPPFImdlp() = default;
|
CPPFImdlp::~CPPFImdlp() = default;
|
||||||
|
|
||||||
size_t CPPFImdlp::compute_max_num_cut_points()
|
size_t CPPFImdlp::compute_max_num_cut_points()
|
||||||
|
17
CPPFImdlp.h
17
CPPFImdlp.h
@@ -7,15 +7,16 @@
|
|||||||
namespace mdlp {
|
namespace mdlp {
|
||||||
class CPPFImdlp {
|
class CPPFImdlp {
|
||||||
protected:
|
protected:
|
||||||
size_t min_length;
|
size_t min_length = 3;
|
||||||
int depth, max_depth;
|
int depth = 0;
|
||||||
float proposed_cuts;
|
int max_depth = numeric_limits<int>::max();
|
||||||
indices_t indices;
|
float proposed_cuts = 0;
|
||||||
samples_t X;
|
indices_t indices = indices_t();
|
||||||
labels_t y;
|
samples_t X = samples_t();
|
||||||
Metrics metrics;
|
labels_t y = labels_t();
|
||||||
|
Metrics metrics = Metrics(y, indices);
|
||||||
cutPoints_t cutPoints;
|
cutPoints_t cutPoints;
|
||||||
size_t num_cut_points;
|
size_t num_cut_points = numeric_limits<size_t>::max();
|
||||||
|
|
||||||
static indices_t sortIndices(samples_t&, labels_t&);
|
static indices_t sortIndices(samples_t&, labels_t&);
|
||||||
void computeCutPoints(size_t, size_t, int);
|
void computeCutPoints(size_t, size_t, int);
|
||||||
|
Reference in New Issue
Block a user