aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::learning::DBTranslator4ContinuousVariable< ALLOC > Class Template Reference

The databases' cell translators for continuous variables. More...

#include <agrum/tools/database/DBTranslator4ContinuousVariable.h>

+ Inheritance diagram for gum::learning::DBTranslator4ContinuousVariable< ALLOC >:
+ Collaboration diagram for gum::learning::DBTranslator4ContinuousVariable< ALLOC >:

Public Member Functions

Constructors / Destructors
template<template< typename > class XALLOC>
 DBTranslator4ContinuousVariable (const std::vector< std::string, XALLOC< std::string > > &missing_symbols, const bool fit_range=false, const allocator_type &alloc=allocator_type())
 default constructor without any initial variable More...
 
 DBTranslator4ContinuousVariable (const bool fit_range=false, const allocator_type &alloc=allocator_type())
 default constructor without any initial variable nor missing symbol More...
 
template<typename GUM_SCALAR , template< typename > class XALLOC>
 DBTranslator4ContinuousVariable (const ContinuousVariable< GUM_SCALAR > &var, const std::vector< std::string, XALLOC< std::string > > &missing_symbols, const bool fit_range=false, const allocator_type &alloc=allocator_type())
 default constructor with a continuous variable as translator More...
 
template<typename GUM_SCALAR >
 DBTranslator4ContinuousVariable (const ContinuousVariable< GUM_SCALAR > &var, const bool fit_range=false, const allocator_type &alloc=allocator_type())
 default constructor with a continuous variable as translator but without missing symbol More...
 
template<template< typename > class XALLOC>
 DBTranslator4ContinuousVariable (const IContinuousVariable &var, const std::vector< std::string, XALLOC< std::string > > &missing_symbols, const bool fit_range=false, const allocator_type &alloc=allocator_type())
 default constructor with a IContinuous variable as translator More...
 
 DBTranslator4ContinuousVariable (const IContinuousVariable &var, const bool fit_range=false, const allocator_type &alloc=allocator_type())
 default constructor with a IContinuous variable as translator but without missing symbol More...
 
 DBTranslator4ContinuousVariable (const DBTranslator4ContinuousVariable< ALLOC > &from)
 copy constructor More...
 
 DBTranslator4ContinuousVariable (const DBTranslator4ContinuousVariable< ALLOC > &from, const allocator_type &alloc)
 copy constructor with a given allocator More...
 
 DBTranslator4ContinuousVariable (DBTranslator4ContinuousVariable< ALLOC > &&from)
 move constructor More...
 
 DBTranslator4ContinuousVariable (DBTranslator4ContinuousVariable< ALLOC > &&from, const allocator_type &alloc)
 move constructor with a given allocator More...
 
virtual DBTranslator4ContinuousVariable< ALLOC > * clone () const
 virtual copy constructor More...
 
virtual DBTranslator4ContinuousVariable< ALLOC > * clone (const allocator_type &alloc) const
 virtual copy constructor with a given allocator More...
 
virtual ~DBTranslator4ContinuousVariable ()
 destructor More...
 
Operators
DBTranslator4ContinuousVariable< ALLOC > & operator= (const DBTranslator4ContinuousVariable< ALLOC > &from)
 copy operator More...
 
DBTranslator4ContinuousVariable< ALLOC > & operator= (DBTranslator4ContinuousVariable< ALLOC > &&from)
 move operator More...
 
Accessors / Modifiers
virtual DBTranslatedValue translate (const std::string &str) final
 returns the translation of a string More...
 
virtual std::string translateBack (const DBTranslatedValue translated_val) const final
 returns the original value for a given translation More...
 
virtual std::size_t domainSize () const final
 returns std::numeric_limits<std::size_t>::max () More...
 
virtual bool needsReordering () const final
 indicates that the translations should never be reordered More...
 
virtual HashTable< std::size_t, std::size_t, ALLOC< std::pair< std::size_t, std::size_t > > > reorder () final
 returns an empty mapping, indicating that old tanslations are equal to the newly reordered ones. More...
 
virtual const IContinuousVariablevariable () const final
 returns the variable stored into the translator More...
 
virtual DBTranslatedValue missingValue () const final
 returns the translation of a missing value More...
 
Operators
DBTranslatedValue operator<< (const std::string &str)
 alias for method translate More...
 
std::string operator>> (const DBTranslatedValue translated_val)
 alias for method translateBack More...
 
Accessors / Modifiers
virtual bool hasEditableDictionary () const
 indicates whether the translator has an editable dictionary or not More...
 
virtual void setEditableDictionaryMode (bool new_mode)
 sets/unset the editable dictionary mode More...
 
const Set< std::string, ALLOC< std::string > > & missingSymbols () const
 returns the set of missing symbols taken into account by the translator More...
 
bool isMissingSymbol (const std::string &str) const
 indicates whether a string corresponds to a missing symbol More...
 
void setVariableName (const std::string &str) const
 sets the name of the variable stored into the translator More...
 
void setVariableDescription (const std::string &str) const
 sets the name of the variable stored into the translator More...
 
DBTranslatedValueType getValType () const
 returns the type of values handled by the translator More...
 
allocator_type getAllocator () const
 returns the allocator used by the translator More...
 
bool isMissingValue (const DBTranslatedValue &val) const
 indicates whether a translated value corresponds to a missing value More...
 

Public Types

using allocator_type = typename DBTranslator< ALLOC >::allocator_type
 type for the allocators passed in arguments of methods More...
 

Protected Attributes

bool is_dictionary_dynamic_
 indicates whether the dictionary can be updated or not More...
 
std::size_t max_dico_entries_
 the maximum number of entries that the dictionary is allowed to contain More...
 
Set< std::string, ALLOC< std::string > > missing_symbols_
 the set of missing symbols More...
 
Bijection< std::size_t, std::string, ALLOC< std::pair< float, std::string > > > back_dico_
 the bijection relating back translated values and their original strings. More...
 
DBTranslatedValueType val_type_
 the type of the values translated by the translator More...
 

Detailed Description

template<template< typename > class ALLOC = std::allocator>
class gum::learning::DBTranslator4ContinuousVariable< ALLOC >

The databases' cell translators for continuous variables.

Translators are used by DatabaseTable instances to transform datasets' strings into DBTranslatedValue instances. The point is that strings are not adequate for fast learning, they need to be preprocessed into a type that can be analyzed quickly (the so-called DBTranslatedValue type).

A DBTranslator4ContinuousVariable is a translator that contains and exploits a ContinuousVariable for translations. Each time a string needs be translated, we ask the ContinuousVariable whether it belongs to its domain (which is supposed to be of type [x_min,x_max]). If this is the case, then the DBTranslatedValue corresponding to the translation of the string contains the floating point number specified in the string.

Here is an example of how to use this class:
// create the translator, with possible missing symbols: "N/A" and "???"
// i.e., each time the translator reads a "N/A" or a "???" string, it
// won't translate it into a number but into a missing value.
std::vector<std::string> missing { "N/A", "???" };
// gets the DBTranslatedValue corresponding to some strings
auto val1 = translator.translate("5"); // val1 = DBTranslatedValue {5.0f}
auto val2 = translator.translate("4.2"); // val2 = DBTRanslatedValue {4.2f}
auto val3 = translator << "3.4"; // val3 = DBTranslatedValue {3.4f}
// add the numbers assigned to val1, val2, val3
float sum = val1.cont_val + val2.cont_val + val3.cont_val;
// translate missing values: val4 and val5 will be equal to:
// DBTranslatedValue { std::numeric_limits<float>::max () }
auto val4 = translator << "N/A";
auto val5 = translator.translate ( "???" );
// the following instructions raise TypeError exceptions because the
// strings cannot be translated into real numbers
auto val6 = translator << "4.22x";
auto val7 = translator.translate ( "xxx" );
// given a DBTranslatedValue that is supposed to contain a float, get
// the corresponding string. The strings should be equivalent to those
// indicated below (maybe they could contain more zeroes after the dot).
std::string str;
str = translator.translateBack ( val1 ); // str ~ "5.0"
str = translator >> val2; // str ~ "4.2"
str = translator >> gum::learning::DBTranslatedValue {7.2e3f};
// str ~ "7.2 e3"
// translate back missing values: the string will corresponds to one of
// the missing symbols known to the translator
str = translator >> val4; // str = "N/A" or "???"
str = translator >> val5; // str = "N/A" or "???"
// get the variable stored within the translator
dynamic_cast<const gum::ContinuousVariable<float>*>
( translator.variable () );
// it is possible to create a translator for an already known variable.
// In this case, by default, the translator is not in editable mode, but
// this behavior can be changed passing the right arguments to the
// constructor of the translator, or using the setEditableDictionaryMode
// method. Here, we create a continuous variable whose domain is [-2,10]
gum::ContinuousVariable<float> var ( "X", "", -2, 10 );
float xval1 = translator2.translate ( "-1.4" ).cont_val; // xval1 = -1.4
float xval2 = translator2.translate ( "7" ).cont_val; // xval2 = 7
float xval3 = translator2.translate ( "N/A" ).cont_val;
// here xval3 corresponds to a missing value, hence it is equal to
// std::numeric_limits<float>::max ()
// trying to translate a string which is outside the domain of var will
// raise Exception NotFound
translator2.translate ( "20" ); // NotFound

Definition at line 126 of file DBTranslator4ContinuousVariable.h.

Member Typedef Documentation

◆ allocator_type

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DBTranslator4ContinuousVariable< ALLOC >::allocator_type = typename DBTranslator< ALLOC >::allocator_type

type for the allocators passed in arguments of methods

Definition at line 129 of file DBTranslator4ContinuousVariable.h.

Constructor & Destructor Documentation

◆ DBTranslator4ContinuousVariable() [1/10]

template<template< typename > class ALLOC = std::allocator>
template<template< typename > class XALLOC>
gum::learning::DBTranslator4ContinuousVariable< ALLOC >::DBTranslator4ContinuousVariable ( const std::vector< std::string, XALLOC< std::string > > &  missing_symbols,
const bool  fit_range = false,
const allocator_type alloc = allocator_type() 
)

default constructor without any initial variable

When using this constructor, it is assumed implicitly that the continuous variable has a range from minus infinity to plus infinity. If the fit_range parameter is on, the range of the variable is updated so that it precisely fits the range of the observed values in the database.

Parameters
missing_symbolsthe set of symbols in the database representing missing values
fit_rangeif true, the range of the variable is updated so that it precisely fits the range of the observed values in the database, else the range is kept to (-inf,inf)
allocThe allocator used to allocate memory for all the fields of the DBTranslator4ContinuousVariable

◆ DBTranslator4ContinuousVariable() [2/10]

template<template< typename > class ALLOC = std::allocator>
gum::learning::DBTranslator4ContinuousVariable< ALLOC >::DBTranslator4ContinuousVariable ( const bool  fit_range = false,
const allocator_type alloc = allocator_type() 
)

default constructor without any initial variable nor missing symbol

When using this constructor, it is assumed implicitly that the continuous variable has a range from minus infinity to plus infinity. If the fit_range parameter is on, the range of the variable is updated so that it precisely fits the range of the observed values in the database.

Parameters
fit_rangeif true, the range of the variable is updated so that it precisely fits the range of the observed values in the database, else the range is kept to (-inf,inf)
allocThe allocator used to allocate memory for all the fields of the DBTranslator4ContinuousVariable

◆ DBTranslator4ContinuousVariable() [3/10]

template<template< typename > class ALLOC = std::allocator>
template<typename GUM_SCALAR , template< typename > class XALLOC>
gum::learning::DBTranslator4ContinuousVariable< ALLOC >::DBTranslator4ContinuousVariable ( const ContinuousVariable< GUM_SCALAR > &  var,
const std::vector< std::string, XALLOC< std::string > > &  missing_symbols,
const bool  fit_range = false,
const allocator_type alloc = allocator_type() 
)

default constructor with a continuous variable as translator

Parameters
vara continuous variable that will be used for translations. The translator keeps a copy of this variable
missing_symbolsthe set of symbols in the database representing missing values
fit_rangeif true, the range of the variable is updated so that it precisely fits the range of the observed values in the database, else the range is kept to (-inf,inf)
allocThe allocator used to allocate memory for all the fields of the DBTranslator4ContinuousVariable
Warning
If a missing value symbol is a number included in the range of the continuous variable, it will be discarded. If the fit_range parameter is on, the range of the variable is updated so that it can contain the range of the observed values in the database.

◆ DBTranslator4ContinuousVariable() [4/10]

template<template< typename > class ALLOC = std::allocator>
template<typename GUM_SCALAR >
gum::learning::DBTranslator4ContinuousVariable< ALLOC >::DBTranslator4ContinuousVariable ( const ContinuousVariable< GUM_SCALAR > &  var,
const bool  fit_range = false,
const allocator_type alloc = allocator_type() 
)

default constructor with a continuous variable as translator but without missing symbol

Parameters
vara continuous variable that will be used for translations. The translator keeps a copy of this variable
fit_rangeif true, the range of the variable is updated so that it precisely fits the range of the observed values in the database, else the range is kept to (-inf,inf)
allocThe allocator used to allocate memory for all the fields of the DBTranslator4ContinuousVariable
Warning
If a missing value symbol is a number included in the range of the continuous variable, it will be discarded. If the fit_range parameter is on, the range of the variable is updated so that it can contain the range of the observed values in the database.

◆ DBTranslator4ContinuousVariable() [5/10]

template<template< typename > class ALLOC = std::allocator>
template<template< typename > class XALLOC>
gum::learning::DBTranslator4ContinuousVariable< ALLOC >::DBTranslator4ContinuousVariable ( const IContinuousVariable var,
const std::vector< std::string, XALLOC< std::string > > &  missing_symbols,
const bool  fit_range = false,
const allocator_type alloc = allocator_type() 
)

default constructor with a IContinuous variable as translator

Parameters
vara IContinuous variable that will be used for translations. The translator keeps a copy of this variable
missing_symbolsthe set of symbols in the database representing missing values
fit_rangeif true, the range of the variable is updated so that it precisely fits the range of the observed values in the database, else the range is kept to (-inf,inf)
allocThe allocator used to allocate memory for all the fields of the DBTranslator4ContinuousVariable
Warning
If a missing value symbol is a number included in the range of the continuous variable, it will be discarded. If the fit_range parameter is on, the range of the variable is updated so that it can contain the range of the observed values in the database.

◆ DBTranslator4ContinuousVariable() [6/10]

template<template< typename > class ALLOC = std::allocator>
gum::learning::DBTranslator4ContinuousVariable< ALLOC >::DBTranslator4ContinuousVariable ( const IContinuousVariable var,
const bool  fit_range = false,
const allocator_type alloc = allocator_type() 
)

default constructor with a IContinuous variable as translator but without missing symbol

Parameters
vara IContinuous variable that will be used for translations. The translator keeps a copy of this variable
fit_rangeif true, the range of the variable is updated so that it precisely fits the range of the observed values in the database, else the range is kept to (-inf,inf)
allocThe allocator used to allocate memory for all the fields of the DBTranslator4ContinuousVariable
Warning
If a missing value symbol is a number included in the range of the continuous variable, it will be discarded. If the fit_range parameter is on, the range of the variable is updated so that it can contain the range of the observed values in the database.

◆ DBTranslator4ContinuousVariable() [7/10]

template<template< typename > class ALLOC = std::allocator>
gum::learning::DBTranslator4ContinuousVariable< ALLOC >::DBTranslator4ContinuousVariable ( const DBTranslator4ContinuousVariable< ALLOC > &  from)

copy constructor

◆ DBTranslator4ContinuousVariable() [8/10]

template<template< typename > class ALLOC = std::allocator>
gum::learning::DBTranslator4ContinuousVariable< ALLOC >::DBTranslator4ContinuousVariable ( const DBTranslator4ContinuousVariable< ALLOC > &  from,
const allocator_type alloc 
)

copy constructor with a given allocator

◆ DBTranslator4ContinuousVariable() [9/10]

template<template< typename > class ALLOC = std::allocator>
gum::learning::DBTranslator4ContinuousVariable< ALLOC >::DBTranslator4ContinuousVariable ( DBTranslator4ContinuousVariable< ALLOC > &&  from)

move constructor

◆ DBTranslator4ContinuousVariable() [10/10]

template<template< typename > class ALLOC = std::allocator>
gum::learning::DBTranslator4ContinuousVariable< ALLOC >::DBTranslator4ContinuousVariable ( DBTranslator4ContinuousVariable< ALLOC > &&  from,
const allocator_type alloc 
)

move constructor with a given allocator

◆ ~DBTranslator4ContinuousVariable()

template<template< typename > class ALLOC = std::allocator>
virtual gum::learning::DBTranslator4ContinuousVariable< ALLOC >::~DBTranslator4ContinuousVariable ( )
virtual

destructor

Member Function Documentation

◆ clone() [1/2]

template<template< typename > class ALLOC = std::allocator>
virtual DBTranslator4ContinuousVariable< ALLOC >* gum::learning::DBTranslator4ContinuousVariable< ALLOC >::clone ( ) const
virtual

virtual copy constructor

Implements gum::learning::DBTranslator< ALLOC >.

◆ clone() [2/2]

template<template< typename > class ALLOC = std::allocator>
virtual DBTranslator4ContinuousVariable< ALLOC >* gum::learning::DBTranslator4ContinuousVariable< ALLOC >::clone ( const allocator_type alloc) const
virtual

virtual copy constructor with a given allocator

Implements gum::learning::DBTranslator< ALLOC >.

◆ domainSize()

template<template< typename > class ALLOC = std::allocator>
virtual std::size_t gum::learning::DBTranslator4ContinuousVariable< ALLOC >::domainSize ( ) const
finalvirtual

returns std::numeric_limits<std::size_t>::max ()

Implements gum::learning::DBTranslator< ALLOC >.

◆ getAllocator()

template<template< typename > class ALLOC = std::allocator>
allocator_type gum::learning::DBTranslator< ALLOC >::getAllocator ( ) const
inherited

returns the allocator used by the translator

◆ getValType()

template<template< typename > class ALLOC = std::allocator>
DBTranslatedValueType gum::learning::DBTranslator< ALLOC >::getValType ( ) const
inherited

returns the type of values handled by the translator

Returns
either DBTranslatedValueType::DISCRETE if the translator includes a discrete variable or DBTranslatedValueType::CONTINUOUS if it contains a continuous variable. This is convenient to know how to interpret the DBTranslatedValue instances produced by the DBTranslator: either using their discr_val field or their cont_val field.

◆ hasEditableDictionary()

template<template< typename > class ALLOC = std::allocator>
virtual bool gum::learning::DBTranslator< ALLOC >::hasEditableDictionary ( ) const
virtualinherited

indicates whether the translator has an editable dictionary or not

Reimplemented in gum::learning::DBTranslator4DiscretizedVariable< ALLOC >.

◆ isMissingSymbol()

template<template< typename > class ALLOC = std::allocator>
bool gum::learning::DBTranslator< ALLOC >::isMissingSymbol ( const std::string &  str) const
inherited

indicates whether a string corresponds to a missing symbol

◆ isMissingValue()

template<template< typename > class ALLOC = std::allocator>
bool gum::learning::DBTranslator< ALLOC >::isMissingValue ( const DBTranslatedValue val) const
inherited

indicates whether a translated value corresponds to a missing value

◆ missingSymbols()

template<template< typename > class ALLOC = std::allocator>
const Set< std::string, ALLOC< std::string > >& gum::learning::DBTranslator< ALLOC >::missingSymbols ( ) const
inherited

returns the set of missing symbols taken into account by the translator

◆ missingValue()

template<template< typename > class ALLOC = std::allocator>
virtual DBTranslatedValue gum::learning::DBTranslator4ContinuousVariable< ALLOC >::missingValue ( ) const
finalvirtual

returns the translation of a missing value

Implements gum::learning::DBTranslator< ALLOC >.

◆ needsReordering()

template<template< typename > class ALLOC = std::allocator>
virtual bool gum::learning::DBTranslator4ContinuousVariable< ALLOC >::needsReordering ( ) const
finalvirtual

indicates that the translations should never be reordered

Implements gum::learning::DBTranslator< ALLOC >.

◆ operator<<()

template<template< typename > class ALLOC = std::allocator>
DBTranslatedValue gum::learning::DBTranslator< ALLOC >::operator<< ( const std::string &  str)
inherited

alias for method translate

◆ operator=() [1/2]

template<template< typename > class ALLOC = std::allocator>
DBTranslator4ContinuousVariable< ALLOC >& gum::learning::DBTranslator4ContinuousVariable< ALLOC >::operator= ( const DBTranslator4ContinuousVariable< ALLOC > &  from)

copy operator

◆ operator=() [2/2]

template<template< typename > class ALLOC = std::allocator>
DBTranslator4ContinuousVariable< ALLOC >& gum::learning::DBTranslator4ContinuousVariable< ALLOC >::operator= ( DBTranslator4ContinuousVariable< ALLOC > &&  from)

move operator

◆ operator>>()

template<template< typename > class ALLOC = std::allocator>
std::string gum::learning::DBTranslator< ALLOC >::operator>> ( const DBTranslatedValue  translated_val)
inherited

alias for method translateBack

◆ reorder()

template<template< typename > class ALLOC = std::allocator>
virtual HashTable< std::size_t, std::size_t, ALLOC< std::pair< std::size_t, std::size_t > > > gum::learning::DBTranslator4ContinuousVariable< ALLOC >::reorder ( )
finalvirtual

returns an empty mapping, indicating that old tanslations are equal to the newly reordered ones.

Implements gum::learning::DBTranslator< ALLOC >.

◆ setEditableDictionaryMode()

template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DBTranslator< ALLOC >::setEditableDictionaryMode ( bool  new_mode)
virtualinherited

sets/unset the editable dictionary mode

Reimplemented in gum::learning::DBTranslator4DiscretizedVariable< ALLOC >.

◆ setVariableDescription()

template<template< typename > class ALLOC = std::allocator>
void gum::learning::DBTranslator< ALLOC >::setVariableDescription ( const std::string &  str) const
inherited

sets the name of the variable stored into the translator

◆ setVariableName()

template<template< typename > class ALLOC = std::allocator>
void gum::learning::DBTranslator< ALLOC >::setVariableName ( const std::string &  str) const
inherited

sets the name of the variable stored into the translator

◆ translate()

template<template< typename > class ALLOC = std::allocator>
virtual DBTranslatedValue gum::learning::DBTranslator4ContinuousVariable< ALLOC >::translate ( const std::string &  str)
finalvirtual

returns the translation of a string

This method tries to translate a given string into the DBTranslatedValue that should be stored into a DatabaseTable. If the translator cannot find the translation in its current dictionary, then two situations can obtain:

  1. if the translator is not in an editable dictionary mode, then the translator raises a NotFound exception.
  2. if the translator is in an editable dictionary mode, i.e., it is allowed to update its dictionary, then it tries to update the range of its dictionary to include the new value. Upon success, it returns the translated value, otherwise, it raises either:
    • a TypeError exception if the string cannot be converted into a value that can be inserted into the dictionary
    • an OperationNotAllowed exception if the translation would induce incoherent behavior (e.g., a DBTranslator4ContinuousVariable that contains a variable whose domain is [x,y] as well as a missing value symbol z \(\in\) [x,y]).
Warning
Note that missing values (i.e., string encoded as missing symbols) are translated as std::numeric_limits<float>::max ().
If the variable contained into the translator has a value in its domain equal to a missing value symbol, this value will be taken into account in the translations, not the missing value.
Returns
the translated value of the string to be stored into a DatabaseTable
Exceptions
UnknownLabelInDatabaseis raised if the number represented by the string is out of the range of the continuous variable and the translator is not in an editable dictionary mode.
OperationNotAllowedexception is raised if the translation cannot be found and the insertion of the string into the translator's dictionary fails because it would induce incoherent behavior (e.g., a DBTranslator4ContinuousVariable that contains a variable whose domain is [x,y] as well as a missing value symbol z \(\in\) [x,y]).
TypeErroris raised if the translation cannot be found and the insertion of the string into the translator's dictionary fails due to str being impossible to be converted into an appropriate type.

Implements gum::learning::DBTranslator< ALLOC >.

◆ translateBack()

template<template< typename > class ALLOC = std::allocator>
virtual std::string gum::learning::DBTranslator4ContinuousVariable< ALLOC >::translateBack ( const DBTranslatedValue  translated_val) const
finalvirtual

returns the original value for a given translation

Returns
the string that was translated into a given DBTranslatedValue.
Exceptions
UnknownLabelInDatabaseis raised if this original value is outside the domain of the continuous variable stored within the translator

Implements gum::learning::DBTranslator< ALLOC >.

◆ variable()

template<template< typename > class ALLOC = std::allocator>
virtual const IContinuousVariable* gum::learning::DBTranslator4ContinuousVariable< ALLOC >::variable ( ) const
finalvirtual

returns the variable stored into the translator

Implements gum::learning::DBTranslator< ALLOC >.

Member Data Documentation

◆ back_dico_

template<template< typename > class ALLOC = std::allocator>
Bijection< std::size_t, std::string, ALLOC< std::pair< float, std::string > > > gum::learning::DBTranslator< ALLOC >::back_dico_
mutableprotectedinherited

the bijection relating back translated values and their original strings.

Note that the translated values considered here are of type std::size_t because only the values for discrete variables need be stored, those for continuous variables are actually identity mappings.

Warning
only the values of the random variable are stored into this bijection. Missing values are not considered here.

Definition at line 388 of file DBTranslator.h.

◆ is_dictionary_dynamic_

template<template< typename > class ALLOC = std::allocator>
bool gum::learning::DBTranslator< ALLOC >::is_dictionary_dynamic_
protectedinherited

indicates whether the dictionary can be updated or not

Definition at line 373 of file DBTranslator.h.

◆ max_dico_entries_

template<template< typename > class ALLOC = std::allocator>
std::size_t gum::learning::DBTranslator< ALLOC >::max_dico_entries_
protectedinherited

the maximum number of entries that the dictionary is allowed to contain

Definition at line 376 of file DBTranslator.h.

◆ missing_symbols_

template<template< typename > class ALLOC = std::allocator>
Set< std::string, ALLOC< std::string > > gum::learning::DBTranslator< ALLOC >::missing_symbols_
protectedinherited

the set of missing symbols

Definition at line 379 of file DBTranslator.h.

◆ val_type_

template<template< typename > class ALLOC = std::allocator>
DBTranslatedValueType gum::learning::DBTranslator< ALLOC >::val_type_
protectedinherited

the type of the values translated by the translator

Definition at line 391 of file DBTranslator.h.


The documentation for this class was generated from the following file: