-
Notifications
You must be signed in to change notification settings - Fork 0
/
Split.h
45 lines (40 loc) · 1.27 KB
/
Split.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include "Dataset.h"
typedef struct sSplit
{
int featureID;
float threshold;
} Split;
/**
* @brief réalise le calcul d’impureté tel qu’il est défini
* plus haut dans le texte, en tenant compte du sous-problème passé
* en paramètre, mais également de la feature et du seuil caractérisant
* le split étudié. Le résultat sera obligatoirement entre 0 et 1 inclus
*
* @param sp
* @param featureID
* @param threshold
* @return float
*/
float Split_gini(Subproblem *sp, int featureID, float threshold);
/**
* @brief réalise le calcul d’impureté tel qu’il est défini
* plus haut dans le texte, en tenant compte du sous-problème passé
* en paramètre, mais également de la feature et du seuil caractérisant
* le split étudié. Le résultat sera obligatoirement entre 0 et 1 inclus
*
* @param sp
* @param featureID
* @param threshold
* @return float
*/
float Split_Entropy(Subproblem *sp, int featureID, float threshold);
/**
* @brief cette fonction va itérer sur les features et générer
* à chaque fois un split comme expliqué plus haut. Le split générant
* le moins d’impureté sera renvoyé.
*
* @param subproblem
* @return Split
*/
Split Split_compute(Subproblem *subproblem, int GiniOrEntropy, bool *featureBagging);