#include <Limits.hpp>
|
| Limits () |
|
| Limits (const VectorDouble &mini, const VectorDouble &maxi, const VectorBool &incmini=VectorBool(), const VectorBool &incmaxi=VectorBool()) |
|
| Limits (const VectorDouble &bounds, bool addFromZero=false) |
|
| Limits (int nclass) |
|
| Limits (const Limits &m) |
|
Limits & | operator= (const Limits &m) |
|
virtual | ~Limits () |
|
virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
|
int | getLimitNumber () const |
|
std::vector< Interval > & | getBounds () |
|
VectorDouble | getBound (int iclass, int mode=0) const |
|
VectorDouble | getLowerBounds () const |
|
VectorDouble | getUpperBounds () const |
|
VectorBool | getLowerIncluded () const |
|
VectorBool | getUpperIncluded () const |
|
bool | isInside (double value) const |
|
bool | empty () const |
|
int | toCategory (Db *db, const String &name="", const NamingConvention &namconv=NamingConvention("Category")) const |
|
int | toIndicator (Db *db, const String &name="", int OptionIndicator=1, bool flagBelow=false, bool flagAbove=false, const NamingConvention &namconv=NamingConvention("Indicator")) const |
|
VectorDouble | statistics (Db *db, const String &name, int optionStat=1, bool flagBelow=false, bool flagAbove=false) |
|
int | toCategoryByAttribute (Db *db, int iatt, const NamingConvention &namconv) const |
|
int | toIndicatorByAttribute (Db *db, int iatt, int OptionIndicator=1, bool flagBelow=false, bool flagAbove=false, const NamingConvention &namconv=NamingConvention("Indicator")) const |
|
| AStringable () |
|
| AStringable (const AStringable &r) |
|
AStringable & | operator= (const AStringable &r) |
|
virtual | ~AStringable () |
|
virtual void | display (const AStringFormat *strfmt=nullptr) const final |
|
virtual void | display (int level) const final |
|
◆ Limits() [1/5]
◆ Limits() [2/5]
◆ Limits() [3/5]
Limits::Limits |
( |
const VectorDouble & |
bounds, |
|
|
bool |
addFromZero = false |
|
) |
| |
Create the limits from a list of bounds. Intervals are delimited between two given bounds: [z_i, z_(i+1)[
- Parameters
-
bounds | List of cutoffs used to create the limits. The number of limits is equal to the number of elements in the 'bounds' vector minus one. |
addFromZero | When TRUE, add a class from 0 to bounds[0] |
◆ Limits() [4/5]
Limits::Limits |
( |
int |
nclass | ) |
|
◆ Limits() [5/5]
Limits::Limits |
( |
const Limits & |
m | ) |
|
◆ ~Limits()
◆ create() [1/3]
◆ create() [2/3]
◆ create() [3/3]
Limits * Limits::create |
( |
int |
nclass | ) |
|
|
static |
◆ empty()
bool Limits::empty |
( |
| ) |
const |
|
inline |
◆ getBound()
VectorDouble Limits::getBound |
( |
int |
iclass, |
|
|
int |
mode = 0 |
|
) |
| const |
Retrieve the set of bounds or one bound
- Parameters
-
iclass | Rank of the class |
mode | 0 for both bounds; 1 for lower bound; 2 for upper bound |
- Returns
- The vector of bound values
◆ getBounds()
std::vector<Interval>& Limits::getBounds |
( |
| ) |
|
|
inline |
◆ getLimitNumber()
int Limits::getLimitNumber |
( |
| ) |
const |
|
inline |
◆ getLowerBounds()
◆ getLowerIncluded()
◆ getUpperBounds()
◆ getUpperIncluded()
◆ isInside()
bool Limits::isInside |
( |
double |
value | ) |
const |
◆ operator=()
◆ statistics()
VectorDouble Limits::statistics |
( |
Db * |
db, |
|
|
const String & |
name, |
|
|
int |
optionStat = 1 , |
|
|
bool |
flagBelow = false , |
|
|
bool |
flagAbove = false |
|
) |
| |
Calculate the statistics per Class
- Parameters
-
db | Target Db |
name | Name of the Target Variable |
optionStat | 1 for Mean; 2 for Proportions |
flagBelow | When TRUE, add a class for samples below lowest bound |
flagAbove | When TRUE, add a class for samples above highest bound |
- Returns
◆ toCategory()
◆ toCategoryByAttribute()
int Limits::toCategoryByAttribute |
( |
Db * |
db, |
|
|
int |
iatt, |
|
|
const NamingConvention & |
namconv |
|
) |
| const |
◆ toIndicator()
int Limits::toIndicator |
( |
Db * |
db, |
|
|
const String & |
name = "" , |
|
|
int |
OptionIndicator = 1 , |
|
|
bool |
flagBelow = false , |
|
|
bool |
flagAbove = false , |
|
|
const NamingConvention & |
namconv = NamingConvention("Indicator") |
|
) |
| const |
Create indicators variables on the intervals defined by the limits for a given variable in a Db.
Note:
- If OptionIndicator is 1, the Db-class will contain the new indicator variables. There are as many new variables as they are classes. Each sample of the indicator variable for class 'iclass' is set to 1 if the sample belongs to this class or 0 otherwise.
- If OptionIndicator is 0, the Db-class will contain one variable such that each sample contains the average of the variable calculated over the samples whose value belong to this class.
- Parameters
-
db | Db containing the variable to be discretized (from which the indicators are computed) |
name | Name of the variable in the Db to be discretized. |
OptionIndicator | When 1, the function assignes the indicator variables. When 0, the function assignes the average of the class. |
flagBelow | When True, consider samples below lowest bound |
flagAbove | When True, consider samples above highest bound |
namconv | Naming convention |
- Returns
◆ toIndicatorByAttribute()
int Limits::toIndicatorByAttribute |
( |
Db * |
db, |
|
|
int |
iatt, |
|
|
int |
OptionIndicator = 1 , |
|
|
bool |
flagBelow = false , |
|
|
bool |
flagAbove = false , |
|
|
const NamingConvention & |
namconv = NamingConvention("Indicator") |
|
) |
| const |
◆ toString()
The documentation for this class was generated from the following files: