aGrUM  0.13.2
gum::learning::DatabaseTable< ALLOC > Class Template Reference

The class representing a tabular database as used by learning tasks. More...

#include <agrum/learning/database/databaseTable.h>

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

Public Member Functions

Constructors / Destructors
template<template< typename > class XALLOC>
 DatabaseTable (const MissingValType< XALLOC > &missing_symbols, const DBTranslatorSet< ALLOC > &translators=DBTranslatorSet< ALLOC >(), const allocator_type &alloc=allocator_type())
 default constructor More...
 
 DatabaseTable (const DBTranslatorSet< ALLOC > &translators=DBTranslatorSet< ALLOC >(), const allocator_type &alloc=allocator_type())
 default constructor More...
 
 DatabaseTable (const DatabaseTable< ALLOC > &from)
 copy constructor More...
 
 DatabaseTable (const DatabaseTable< ALLOC > &from, const allocator_type &alloc)
 copy constructor with a given allocator More...
 
 DatabaseTable (DatabaseTable< ALLOC > &&from)
 move constructor More...
 
 DatabaseTable (DatabaseTable< ALLOC > &&from, const allocator_type &alloc)
 move constructor with a given allocator More...
 
virtual DatabaseTable< ALLOC > * clone () const final
 virtual copy constructor More...
 
virtual DatabaseTable< ALLOC > * clone (const allocator_type &alloc) const final
 virtual copy constructor with a given allocator More...
 
virtual ~DatabaseTable ()
 destructor More...
 
Operators
DatabaseTable< ALLOC > & operator= (const DatabaseTable< ALLOC > &from)
 copy operator More...
 
DatabaseTable< ALLOC > & operator= (DatabaseTable< ALLOC > &&from)
 move constructor More...
 
Accessors / Modifiers
void insertTranslator (const DBTranslator< ALLOC > &translator, const std::size_t input_column)
 insert a new translator into the database table More...
 
template<template< typename > class XALLOC = ALLOC>
void insertTranslator (const Variable &var, const std::size_t input_column, std::vector< std::string, XALLOC< std::string > > missing_symbols=std::vector< std::string, XALLOC< std::string > >())
 insert a new translator into the database table More...
 
void eraseTranslator (const std::size_t k, const bool k_is_input_col=false)
 erases either the kth translator or that parsing the kth column of the input dataset More...
 
const DBTranslatorSet< ALLOC > & translatorSet () const
 returns the set of translators More...
 
const DBTranslator< ALLOC > & translator (const std::size_t k, const bool k_is_input_col=false) const
 returns either the kth translator of the database table or that reading the kth column of the input database More...
 
const Variablevariable (const std::size_t k, const bool k_is_input_col=false) const
 returns either the kth variable of the database table or that corresponding to the kth column of the input database More...
 
virtual void setVariableNames (const std::vector< std::string, ALLOC< std::string > > &names, const bool from_external_object=true) final
 sets the names of the variables More...
 
virtual void ignoreColumn (const std::size_t k, const bool from_external_object=true) final
 makes the database table ignore from now on the kth column More...
 
virtual const DBVector< std::size_t > ignoredColumns () const final
 returns the set of columns of the original dataset that are ignored More...
 
virtual const DBVector< std::size_t > inputColumns () const final
 returns the set of columns of the original dataset that are present in the DatabaseTable More...
 
std::size_t domainSize (const std::size_t k, const bool k_is_input_col=false) const
 returns the domain size of the kth variable of the database table or of that corresponding to the kth column of the input database More...
 
DBVector< std::size_t > domainSizes () const
 returns the domain sizes of all the variables in the database table More...
 
bool needsReordering (const std::size_t k, const bool k_is_input_col=false) const
 indicates whether a reordering is needed to make the kth translator sorted More...
 
void reorder (const std::size_t k, const bool k_is_input_col=false)
 performs a reordering of the kth translator or of the translator corresponding to the kth column of the input database More...
 
void reorder ()
 performs a reordering of all the columns More...
 
virtual void insertRow (const std::vector< std::string, ALLOC< std::string > > &new_row) final
 insert a new row at the end of the database More...
 
virtual void insertRow (Row< DBTranslatedValue > &&new_row, const IsMissing contains_missing_data) final
 insert a new DBRow at the end of the database More...
 
virtual void insertRow (const Row< DBTranslatedValue > &new_row, const IsMissing contains_missing_data) final
 insert a new row at the end of the database More...
 
virtual void insertRow (const Row< DBCell > &new_row) final
 insert a new DBRow of DBCells at the end of the database More...
 
virtual void insertRow (Row< DBCell > &&new_row) final
 insert a new DBRow of DBCells at the end of the database More...
 
virtual void insertRows (Matrix< DBTranslatedValue > &&new_rows, const DBVector< IsMissing > &rows_have_missing_vals) final
 insert a set of new DBRows at the end of the database More...
 
virtual void insertRows (const Matrix< DBTranslatedValue > &new_rows, const DBVector< IsMissing > &rows_have_missing_vals) final
 insert a set of new DBRows at the end of the database More...
 
virtual void insertRows (Matrix< DBCell > &&new_rows) final
 insert a set of new DBRows at the end of the database More...
 
virtual void insertRows (const Matrix< DBCell > &new_rows) final
 insert a set of new DBRows at the end of the database More...
 
virtual void clear () final
 erase the content of the database, including the names of the variables More...
 
Iterators
iterator begin () const
 returns a new unsafe handler pointing to the beginning of the database More...
 
iterator_safe beginSafe () const
 returns a new safe handler pointing to the beginning of the database More...
 
const iteratorend () const noexcept
 returns a new unsafe handler pointing to the end of the database More...
 
const iterator_safeendSafe () const noexcept
 returns a new safe handler pointing to the end of the database More...
 
Accessors / Modifiers
const Matrix< DBTranslatedValue > & content () const noexcept
 returns the content of the database More...
 
iterator handler () const
 returns a new unsafe handler on the database More...
 
iterator_safe handlerSafe () const
 returns a new safe handler on the database More...
 
const DBVector< std::string > & variableNames () const noexcept
 returns the variable names for all the columns of the database More...
 
void setVariableNames (const std::vector< std::string, OTHER_ALLOC< std::string > > &names, const bool from_external_object=true)
 sets the names of the variables More...
 
const std::string & variableName (const std::size_t k) const
 returns the name of the kth column of the database More...
 
std::size_t columnFromVariableName (const std::string &name) const
 returns the index of the column whose name is passed in argument More...
 
std::size_t nbVariables () const noexcept
 returns the number of variables (columns) of the database More...
 
std::size_t size () const noexcept
 returns the number of records (rows) in the database More...
 
bool hasMissingValues () const
 indicates whether the database contains some missing values More...
 
bool hasMissingValues (const std::size_t k) const
 indicates whether the kth row contains some missing values More...
 
void insertRow (const std::vector< std::string, OTHER_ALLOC< std::string > > &new_row)
 insert a new row at the end of the database More...
 
virtual void insertRow (Row< DBTranslatedValue > &&new_row, const IsMissing contains_missing_data)
 insert a new DBRow at the end of the database More...
 
virtual void insertRow (const Row< DBTranslatedValue > &new_row, const IsMissing contains_missing_data)
 insert a new row at the end of the database More...
 
virtual void insertRows (Matrix< DBTranslatedValue > &&new_rows, const DBVector< IsMissing > &rows_have_missing_vals)
 insert a set of new DBRows at the end of the database More...
 
virtual void insertRows (const Matrix< DBTranslatedValue > &new_rows, const DBVector< IsMissing > &rows_have_missing_vals)
 insert a set of new DBRows at the end of the database More...
 
void eraseRow (std::size_t index)
 erase a given row specified by its index in the table More...
 
void eraseFirstRow ()
 erase the first row More...
 
void eraseLastRow ()
 erase the last row More...
 
void eraseFirstRows (const std::size_t k)
 erase the k first rows More...
 
void eraseLastRows (const std::size_t k)
 erase the k last rows More...
 
void eraseRows (std::size_t deb, std::size_t end)
 erase the rows from the debth to the endth (not included) More...
 
void eraseAllRows ()
 erase all the rows More...
 
ALLOC< DBTranslatedValuegetAllocator () const
 returns the allocator of the database More...
 
const DBVector< std::string > & missingSymbols () const
 returns the set of missing symbols More...
 

Public Types

template<typename TX_DATA >
using DBVector = std::vector< TX_DATA, ALLOC< TX_DATA > >
 the type for the vectors used in the DatabaseTable More...
 
template<typename TX_DATA >
using Row = DBRow< TX_DATA, ALLOC >
 a row of the database More...
 
template<typename TX_DATA >
using Matrix = std::vector< DBRow< TX_DATA, ALLOC >, ALLOC< DBRow< TX_DATA, ALLOC > > >
 the type for the matrices stored into the database More...
 
template<template< typename > class XALLOC>
using MissingValType = std::vector< std::string, XALLOC< std::string > >
 
using Handler = typename IDatabaseTable< DBTranslatedValue, ALLOC >::Handler
 the unsafe handler type More...
 
using HandlerSafe = typename IDatabaseTable< DBTranslatedValue, ALLOC >::HandlerSafe
 the safe handler type More...
 
using IsMissing = typename IDatabaseTable< DBTranslatedValue, ALLOC >::IsMissing
 
using value_type = Row< DBTranslatedValue >
 Types for STL compliance. More...
 
using reference = value_type &
 Types for STL compliance. More...
 
using const_reference = const value_type &
 Types for STL compliance. More...
 
using pointer = value_type *
 Types for STL compliance. More...
 
using const_pointer = const value_type *
 Types for STL compliance. More...
 
using size_type = std::size_t
 Types for STL compliance. More...
 
using difference_type = std::ptrdiff_t
 Types for STL compliance. More...
 
using iterator = Handler
 Types for STL compliance. More...
 
using iterator_safe = HandlerSafe
 Types for STL compliance. More...
 
using allocator_type = ALLOC< DBTranslatedValue >
 Types for STL compliance. More...
 
using const_iterator = const Handler
 Types for STL compliance. More...
 
using const_iterator_safe = const HandlerSafe
 Types for STL compliance. More...
 

Protected Attributes

DBVector< std::string > _variable_names
 the names of the variables for each column More...
 

Protected Member Functions

Matrix< DBTranslatedValue > & _content () noexcept
 returns the content of the database More...
 
DBVector< IsMissing > & _hasRowMissingVal () noexcept
 returns the vector indicating whether a row contains missing values More...
 
const DBVector< std::string > & _missingSymbols () const
 returns the set of symbols for the missing values More...
 
bool _isRowSizeOK (const std::size_t size) const
 checks whether a size corresponds to the number of columns of the database More...
 

Detailed Description

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

The class representing a tabular database as used by learning tasks.

Class DatabaseTable represents a tabular database that stores in the computer's random access memory (RAM) its content as a vector of DBRows of DBTranslatedValue instances. This class is very well suited for fast learning algorithms.

Usage example:
// create the database from a CSV. This is not compulsory for
// DatabaseTable instances, but this is how we usually create
// DatabaseTable instances
gum::learning::DBInitializerFromCSV<> initializer ( "asia.csv" );
const auto& var_names = initializer.variableNames ();
for ( std::size_t i = 0; i < var_names.size(); ++i )
translator_set.insertTranslator ( translator, i );
gum::learning::DatabaseTable<> database ( translator_set );
database.setVariableNames( initializer.variableNames () );
// here, database contains the content of the asia.csv file.
// determine how many columns and rows the database contains
std::size_t nb_rows = database.content().size()
std::size_t nb_cols = database.nbVariables ();
// manually add a new row into the database
std::vector<std::string> row( 8, "toto" ); // asia has 8 columns
database.insertRow ( row );
dbrow ( 8, gum::learning::DBTranslatedValue { std::size_t(0) } );
database.insertRow ( dbrow );
// insert 4 rows in a single call:
database.insertRows(
( 4, dbrow ) );
// erase some rows
database.eraseRow ( 12 ); // erase the 13th row of the database
database.eraseFirstRow (); // erase the first row of the database
database.eraseLastRow (); // erase the last row of the database
database.eraseFirstRows ( 2 ); // erase the first two rows
database.eraseLastRows ( 3 ); // erase the last three rows
database.eraseRows ( 2,4 ); // erase rows indexed from 2 to 4 (excluded)
// parse the content of the database, the usual way
for ( const auto& dbrow : database )
std::cout << dbrow.row() << " weight: " << dbrow.weight() << std::endl;
// ignore some columns of the database, i.e., remove them
database.ignoreColumn ( 3 ); // remove the 4th column of the CSV file
// now, the database contains columns 0, 1, 2, 4, 5, 6, 7 of the
// CSV file. If we wish to remove Column 5 of the CSV file:
database.ignoreColumn ( 3 ); // remove the 4th column of the CSV file
// now, the database contains columns 0, 1, 2, 4, 6, 7 of the CSV file.
// if we wish to remove the 3rd column of the DatabaseTable, i.e.,
// column 2 of the CSV, either we determine that this actually correspond
// to column 2 of the CSV and we use database.ignoreColumn ( 2 ) or
// we call:
database.ignoreColumn ( 2, false ); // false => 2 = the 3rd column of
// the DatabaseTable, not the 3rd column of the CSV file
// display the columns of the CSV that were ignored and those that
// were kept:
std::vector<std::size_t> ignored_cols = database.ignoredColumns ();
std::vector<std::size_t> kept_cols = database.inputColumns ();
// parse the content of the database using handlers
typename gum::learning::DatabaseTable<>::Handler uhandler( database );
// by default, the handlers range over the whole database
// change the range of rows handled by the DBHandler
std::cout << handler.setRange ( 1, 40 ); // now parses rows [1,40)
std::cout << handler.size (); // displays 39: rows 1,...,39
std::cout << handler.DBSize (); // shows the number of rows in the database
std::cout << handler.numRow (); // displays 0: the handler currently
// points on the first row of its managed area [1,40)
// move the handler to the next row
handler.nextRow();
std::cout << handler.numRow (); // displays 1: the handler points now
// on the second row of its managed area. This corresponds to the third
// DBRow of the database since the range of handler is [1,40)
++handler; // move again to the next row
std::cout << handler.numRow (); // displays 2
handler += 4; // advances the pointer by 4 rows
std::cout << handler.numRow (); // displays 6
// get the DBRow pointed to by the handler: this is the 7th DBRow
// of the database
const auto& xrow7 = handler.row (); // get the DBRow, unsafe version
const auto& yrow7 = handler.rowSafe (); // get the DBRow, safe version
const std::vector<gum::learning::DBCell>& xrow = xrow7.row ();
const double xweight = xrow27.weight ();
// another way to access the row
const auto& zrow7 = *handler; // get the DBRow, unsafe version
// check whether there exist other rows managed by the handler after
// the current row
bool has_rows = handler.hasRows (); // true: there remains 33 rows
// makes the handler point again on the 2nd row of the database
handler.reset (); // the handler points to the beginning of its area
std::cout << handler.numRow (); // displays 0: the handler currently
// points on the first row of its managed area [1,40)
// see the variables' names, i.e., the names of the database's columns
const auto& vars = handler.variableNames();
// parse all the rows managed
handler.reset ();
for ( auto end = handler.end (); handler != end; ++handler )
std::cout << handler.row ().weight () << std::endl;
// another possibility:
for ( const auto& row : handler )
std::cout << row.weight () << std::endl;
// clear the content of the database and update the database's
// handlers
database.clear ();

Definition at line 178 of file databaseTable.h.

Member Typedef Documentation

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::allocator_type = ALLOC< DBTranslatedValue >

Types for STL compliance.

Definition at line 217 of file databaseTable.h.

Types for STL compliance.

Definition at line 763 of file IDatabaseTable.h.

Types for STL compliance.

Definition at line 764 of file IDatabaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::const_pointer = const value_type*

Types for STL compliance.

Definition at line 212 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::const_reference = const value_type&

Types for STL compliance.

Definition at line 210 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
template<typename TX_DATA >
using gum::learning::DatabaseTable< ALLOC >::DBVector = std::vector< TX_DATA, ALLOC< TX_DATA > >

the type for the vectors used in the DatabaseTable

Definition at line 182 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::difference_type = std::ptrdiff_t

Types for STL compliance.

Definition at line 214 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::Handler = typename IDatabaseTable< DBTranslatedValue, ALLOC >::Handler

the unsafe handler type

Definition at line 197 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::HandlerSafe = typename IDatabaseTable< DBTranslatedValue, ALLOC >::HandlerSafe

the safe handler type

Definition at line 201 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::IsMissing = typename IDatabaseTable< DBTranslatedValue, ALLOC >::IsMissing

Definition at line 204 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::iterator = Handler

Types for STL compliance.

Definition at line 215 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::iterator_safe = HandlerSafe

Types for STL compliance.

Definition at line 216 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
template<typename TX_DATA >
using gum::learning::DatabaseTable< ALLOC >::Matrix = std::vector< DBRow< TX_DATA, ALLOC >, ALLOC< DBRow< TX_DATA, ALLOC > > >

the type for the matrices stored into the database

Definition at line 191 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
template<template< typename > class XALLOC>
using gum::learning::DatabaseTable< ALLOC >::MissingValType = std::vector< std::string, XALLOC< std::string > >

Definition at line 194 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::pointer = value_type*

Types for STL compliance.

Definition at line 211 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::reference = value_type&

Types for STL compliance.

Definition at line 209 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
template<typename TX_DATA >
using gum::learning::DatabaseTable< ALLOC >::Row = DBRow< TX_DATA, ALLOC >

a row of the database

Definition at line 186 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::size_type = std::size_t

Types for STL compliance.

Definition at line 213 of file databaseTable.h.

template<template< typename > class ALLOC = std::allocator>
using gum::learning::DatabaseTable< ALLOC >::value_type = Row< DBTranslatedValue >

Types for STL compliance.

Definition at line 208 of file databaseTable.h.

Constructor & Destructor Documentation

template<template< typename > class ALLOC = std::allocator>
template<template< typename > class XALLOC>
gum::learning::DatabaseTable< ALLOC >::DatabaseTable ( const MissingValType< XALLOC > &  missing_symbols,
const DBTranslatorSet< ALLOC > &  translators = DBTranslatorSet< ALLOC >(),
const allocator_type alloc = allocator_type() 
)

default constructor

template<template< typename > class ALLOC = std::allocator>
gum::learning::DatabaseTable< ALLOC >::DatabaseTable ( const DBTranslatorSet< ALLOC > &  translators = DBTranslatorSet< ALLOC >(),
const allocator_type alloc = allocator_type() 
)

default constructor

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

copy constructor

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

copy constructor with a given allocator

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

move constructor

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

move constructor with a given allocator

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

destructor

Member Function Documentation

Matrix< DBTranslatedValue >& gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::_content ( )
protectednoexceptinherited

returns the content of the database

DBVector< IsMissing >& gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::_hasRowMissingVal ( )
protectednoexceptinherited

returns the vector indicating whether a row contains missing values

bool gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::_isRowSizeOK ( const std::size_t  size) const
protectedinherited

checks whether a size corresponds to the number of columns of the database

const DBVector< std::string >& gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::_missingSymbols ( ) const
protectedinherited

returns the set of symbols for the missing values

iterator gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::begin ( ) const
inherited

returns a new unsafe handler pointing to the beginning of the database

iterator_safe gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::beginSafe ( ) const
inherited

returns a new safe handler pointing to the beginning of the database

template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::clear ( )
finalvirtual

erase the content of the database, including the names of the variables

Reimplemented from gum::learning::IDatabaseTable< DBTranslatedValue, ALLOC >.

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

virtual copy constructor

Implements gum::learning::IDatabaseTable< DBTranslatedValue, ALLOC >.

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

virtual copy constructor with a given allocator

Implements gum::learning::IDatabaseTable< DBTranslatedValue, ALLOC >.

std::size_t gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::columnFromVariableName ( const std::string &  name) const
inherited

returns the index of the column whose name is passed in argument

Exceptions
UndefinedElementis raised if there exists no column with the given name
const Matrix< DBTranslatedValue >& gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::content ( ) const
noexceptinherited

returns the content of the database

template<template< typename > class ALLOC = std::allocator>
std::size_t gum::learning::DatabaseTable< ALLOC >::domainSize ( const std::size_t  k,
const bool  k_is_input_col = false 
) const

returns the domain size of the kth variable of the database table or of that corresponding to the kth column of the input database

Translators read an input dataset that is not necessarily the same as the content of the DatabaseTable. For instance, a CSV may contain 10 columns, but if a DatabaseTable only contains two translators reading columns 3 and 5 respectively, then the DatabaseTable only contains 2 columns. When k_is_input_col is set to false, Parameter k passed in argument corresponds to either 0 or 1, i.e., the index of one of these two columns. When k_is_input_col is set to true, the variable is that of the translator that parses the kth column of the input database.

Exceptions
UndefinedElementis raised if there is no translator corresponding to k.
template<template< typename > class ALLOC = std::allocator>
DBVector< std::size_t > gum::learning::DatabaseTable< ALLOC >::domainSizes ( ) const

returns the domain sizes of all the variables in the database table

Referenced by gum::learning::genericBNLearner::Database::Database().

+ Here is the caller graph for this function:

const iterator& gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::end ( ) const
noexceptinherited

returns a new unsafe handler pointing to the end of the database

const iterator_safe& gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::endSafe ( ) const
noexceptinherited

returns a new safe handler pointing to the end of the database

void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::eraseAllRows ( )
inherited

erase all the rows

void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::eraseFirstRow ( )
inherited

erase the first row

Warning
if the row does not exist, nothing is done. In particular, no exception is raised.
void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::eraseFirstRows ( const std::size_t  k)
inherited

erase the k first rows

Warning
if there are fewer than k rows in the database, the database is completely emptied
void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::eraseLastRow ( )
inherited

erase the last row

Warning
if the row does not exist, nothing is done. In particular, no exception is raised.
void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::eraseLastRows ( const std::size_t  k)
inherited

erase the k last rows

Warning
if there are fewer than k rows in the database, the database is completely emptied
void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::eraseRow ( std::size_t  index)
inherited

erase a given row specified by its index in the table

In the database, rows are indexed, starting from 0.

Warning
If the row does not exist, nothing is done. In particular, no exception is raised.
void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::eraseRows ( std::size_t  deb,
std::size_t  end 
)
inherited

erase the rows from the debth to the endth (not included)

In the database, rows are indexed, starting from 0.

template<template< typename > class ALLOC = std::allocator>
void gum::learning::DatabaseTable< ALLOC >::eraseTranslator ( const std::size_t  k,
const bool  k_is_input_col = false 
)

erases either the kth translator or that parsing the kth column of the input dataset

Translators read an input dataset that is not necessarily the same as the content of the DatabaseTable. For instance, a CSV may contain 10 columns, but if a DatabaseTable only contains two translators reading columns 3 and 5 respectively, then the DatabaseTable only contains 2 columns. When k_is_input_col is set to false, Parameter k passed in argument corresponds to either 0 or 1, i.e., to the index of one of these two output columns. When k_is_input_col is set to true, the translator to be erased is the one that parses the kth column of the input database.

Warning
if the translator does not exists, nothing is done. In particular, no exception is raised.
ALLOC< DBTranslatedValue > gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::getAllocator ( ) const
inherited

returns the allocator of the database

iterator gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::handler ( ) const
inherited

returns a new unsafe handler on the database

iterator_safe gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::handlerSafe ( ) const
inherited

returns a new safe handler on the database

bool gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::hasMissingValues ( ) const
inherited

indicates whether the database contains some missing values

Referenced by gum::learning::genericBNLearner::__readFile().

bool gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::hasMissingValues ( const std::size_t  k) const
inherited

indicates whether the kth row contains some missing values

template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::ignoreColumn ( const std::size_t  k,
const bool  from_external_object = true 
)
finalvirtual

makes the database table ignore from now on the kth column

This method can be called in two different ways: either k refers to the current kth column of the database table (in this case parameter from_external_object is set to false), or k corresponds to the kth column of an original database used to fill the database table (in this case from_external_object is set to true). Depending on from_external_object's value, the ignored columns may differ. As an example, imagine that the database table is created from a CSV file with 5 columns named X0, X1, X2, X3 and X4 respectivly. Then a call to ignoreColumn ( 1, true ) will exclude column X1 from the database table. As a result, the database table columns are X0, X2, X3 and X4. Therefore, subsequently calling ignoreColumn ( 1, false ) will result in excluding X2 since X2 is the 2nd column (columns are indexed starting from 0). So, now the database table's columns are X0, X3 and X4. If, now, we call ignoreColumn ( 3, true ), this will remove column X3 because, in the original database, X3 was the 4th column.

The method also erases the translator assigned to column k, if any. If the DatabaseTable contains some rows, then their column corresponding to k is removed. If the resulting DatabaseTable contains only empty rows, then those are removed.

Parameters
kthe column to remove. See Method setVariableNames for a detailed description on how k is computed.
from_external_objectindicates whether k refers to the kth column of an original external database (true) or to the current kth column of the DatabaseTable (false).

Implements gum::learning::IDatabaseTable< DBTranslatedValue, ALLOC >.

template<template< typename > class ALLOC = std::allocator>
virtual const DBVector< std::size_t > gum::learning::DatabaseTable< ALLOC >::ignoredColumns ( ) const
finalvirtual

returns the set of columns of the original dataset that are ignored

In this vector, all the column indices higher than its last element are also ignored.

Implements gum::learning::IDatabaseTable< DBTranslatedValue, ALLOC >.

template<template< typename > class ALLOC = std::allocator>
virtual const DBVector< std::size_t > gum::learning::DatabaseTable< ALLOC >::inputColumns ( ) const
finalvirtual

returns the set of columns of the original dataset that are present in the DatabaseTable

Implements gum::learning::IDatabaseTable< DBTranslatedValue, ALLOC >.

template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::insertRow ( const std::vector< std::string, ALLOC< std::string > > &  new_row)
finalvirtual

insert a new row at the end of the database

The new_row passed in argument is supposed to come from an external database. So it must contain data for the ignored columns.

Exceptions
SizeErroris raised if the vector of string cannot be inserted in the DatabaseTable because its size does not allow a matching with the columns of the DatabaseTable (taking into account the ignored columns)

Referenced by gum::learning::BNDatabaseGenerator< GUM_SCALAR >::toDatabaseTable().

+ Here is the caller graph for this function:

template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::insertRow ( Row< DBTranslatedValue > &&  new_row,
const IsMissing  contains_missing_data 
)
finalvirtual

insert a new DBRow at the end of the database

Unlike methods insertRow for data whose type is different from DBTranslatedValue, this method assumes that the new row passed in argument does not contain any data of the ignored columns. So, basically, it could be copied as is into the database table.

Exceptions
SizeErroris raised if the size of the new_row is not equal to the number of translators of the DatabaseTable
template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::insertRow ( const Row< DBTranslatedValue > &  new_row,
const IsMissing  contains_missing_data 
)
finalvirtual

insert a new row at the end of the database

Unlike methods insertRow for data whose type is different from DBTranslatedValue, this method assumes that the new row passed in argument does not contain any data of the ignored columns. So, basically, it could be copied as is into the database table.

Exceptions
SizeErroris raised if the size of the new_row is not equal to the number of translators of the DatabaseTable
template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::insertRow ( const Row< DBCell > &  new_row)
finalvirtual

insert a new DBRow of DBCells at the end of the database

The new_row passed in argument is supposed to come from an external database. So it must contain data for the ignored columns.

Exceptions
SizeErroris raised if the vector of string cannot be inserted in the DatabaseTable because its size does not allow a matching with the columns of the DatabaseTable (taking into account the ignored columns)
template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::insertRow ( Row< DBCell > &&  new_row)
finalvirtual

insert a new DBRow of DBCells at the end of the database

The new_row passed in argument is supposed to come from an external database. So it must contain data for the ignored columns.

Exceptions
SizeErroris raised if the vector of string cannot be inserted in the DatabaseTable because its size does not allow a matching with the columns of the DatabaseTable (taking into account the ignored columns)
void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::insertRow ( const std::vector< std::string, OTHER_ALLOC< std::string > > &  new_row)
inherited

insert a new row at the end of the database

The new_row passed in argument is supposed to come from an external database. So it must contain data for the ignored columns.

Exceptions
SizeErroris raised if the vector of string cannot be inserted in the IDatabaseTable because its size does not allow a matching with the columns of the IDatabaseTable (taking into account the ignored columns)
virtual void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::insertRow ( Row< DBTranslatedValue > &&  new_row,
const IsMissing  contains_missing_data 
)
virtualinherited

insert a new DBRow at the end of the database

Unlike methods insertRow for data whose type is different from T_DATA, this method assumes that the new row passed in argument does not contain any data of the ignored columns. So, basically, it could be copied as is into the database table.

Exceptions
SizeErroris raised if the size of the new_row is not equal to the number of columns retained in the IDatabaseTable
virtual void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::insertRow ( const Row< DBTranslatedValue > &  new_row,
const IsMissing  contains_missing_data 
)
virtualinherited

insert a new row at the end of the database

Unlike methods insertRow for data whose type is different from T_DATA, this method assumes that the new row passed in argument does not contain any data of the ignored columns. So, basically, it could be copied as is into the database table.

Exceptions
SizeErroris raised if the size of the new_row is not equal to the number of columns retained in the IDatabaseTable
template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::insertRows ( Matrix< DBTranslatedValue > &&  new_rows,
const DBVector< IsMissing > &  rows_have_missing_vals 
)
finalvirtual

insert a set of new DBRows at the end of the database

Unlike methods insertRows for data whose type is different from DBTranslatedValue, this method assumes that the new rows passed in argument do not contain any data of the ignored columns. So, basically, these rows could be copied as is into the database table.

Exceptions
SizeErroris raised if the size of at least one row in new_rows is not equal to the number of translators in the DatabaseTable
template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::insertRows ( const Matrix< DBTranslatedValue > &  new_rows,
const DBVector< IsMissing > &  rows_have_missing_vals 
)
finalvirtual

insert a set of new DBRows at the end of the database

Unlike methods insertRows for data whose type is different from DBTranslatedValue, this method assumes that the new rows passed in argument do not contain any data of the ignored columns. So, basically, these rows could be copied as is into the database table.

Exceptions
SizeErroris raised if the size of at least one row in new_rows is not equal to the number of translators in the DatabaseTable
template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::insertRows ( Matrix< DBCell > &&  new_rows)
finalvirtual

insert a set of new DBRows at the end of the database

The new rows passed in argument are supposed to come from an external database. So they must contain data for the ignored columns.

Exceptions
SizeErroris raised if the vector of string cannot be inserted in the DatabaseTable because its size does not allow a matching with the columns of the DatabaseTable (taking into account the ignored columns)
template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::insertRows ( const Matrix< DBCell > &  new_rows)
finalvirtual

insert a set of new DBRows at the end of the database

The new rows passed in argument are supposed to come from an external database. So they must contain data for the ignored columns.

Exceptions
SizeErroris raised if the vector of string cannot be inserted in the DatabaseTable because its size does not allow a matching with the columns of the DatabaseTable (taking into account the ignored columns)
virtual void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::insertRows ( Matrix< DBTranslatedValue > &&  new_rows,
const DBVector< IsMissing > &  rows_have_missing_vals 
)
virtualinherited

insert a set of new DBRows at the end of the database

Unlike methods insertRows for data whose type is different from T_DATA, this method assumes that the new rows passed in argument do not contain any data of the ignored columns. So, basically, these rows could be copied as is into the database table.

Exceptions
SizeErroris raised if the size of at least one row in new_rows is not equal to the number of columns retained in the IDatabaseTable
virtual void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::insertRows ( const Matrix< DBTranslatedValue > &  new_rows,
const DBVector< IsMissing > &  rows_have_missing_vals 
)
virtualinherited

insert a set of new DBRows at the end of the database

Unlike methods insertRows for data whose type is different from T_DATA, this method assumes that the new rows passed in argument do not contain any data of the ignored columns. So, basically, these rows could be copied as is into the database table.

Exceptions
SizeErroris raised if the size of at least one row in new_rows is not equal to the number of columns retained in the IDatabaseTable
template<template< typename > class ALLOC = std::allocator>
void gum::learning::DatabaseTable< ALLOC >::insertTranslator ( const DBTranslator< ALLOC > &  translator,
const std::size_t  input_column 
)

insert a new translator into the database table

Parameters
translatorThis translator is copied into the DatabaseTable
input_columnindicates which column in the original dataset (usually a CSV file) the translator will read
Exceptions
OperationNotAllowedif the databaseTable is not empty, i.e., it already contains some rows, or if the column is marked as being ignored (through method ignoreColumn).
Warning
if there already exists a translator reading the input column passed in argument, the method does nothing. In particular, it raises no exception.
Exceptions
DuplicateElementis raised if there already exists a translator reading the column passed in argument.

Referenced by gum::learning::genericBNLearner::Database::Database(), and gum::learning::BNDatabaseGenerator< GUM_SCALAR >::toDatabaseTable().

+ Here is the caller graph for this function:

template<template< typename > class ALLOC = std::allocator>
template<template< typename > class XALLOC = ALLOC>
void gum::learning::DatabaseTable< ALLOC >::insertTranslator ( const Variable var,
const std::size_t  input_column,
std::vector< std::string, XALLOC< std::string > >  missing_symbols = std::vector< std::string, XALLOC< std::string > >() 
)

insert a new translator into the database table

The first template parameter (GUM_SCALAR) is necessary only for inserting variables of true types DiscretizedVariable and ContinuousVariable, which depend on the GUM_SCALAR parameter type. However, usually, when you use this function, this is to add into the TranslatorSet the variables of a BayesNet<GUM_SCALAR>. As such, you can safely call insert all the variables of this Bayesian network using inertTranslator<GUM_SCALAR> ( bn.variable() ... ) instructions.

Parameters
varthe variable that will be contained into the translator
input_columnthe index of the column that this new translator should read in the database.
missing_symbolsthe set of symbols in the database representing missing values
Warning
if there already exists a translator reading the input column passed in argument, the method does nothing. In particular, it raises no exception.
Exceptions
OperationNotAllowedif the databaseTable is not empty, i.e., it already contains some rows, or if the column is marked as being ignored (through method ignoreColumn).
DuplicateElementis raised if there already exists a translator reading the column passed in argument.
const DBVector< std::string >& gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::missingSymbols ( ) const
inherited

returns the set of missing symbols

std::size_t gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::nbVariables ( ) const
noexceptinherited

returns the number of variables (columns) of the database

template<template< typename > class ALLOC = std::allocator>
bool gum::learning::DatabaseTable< ALLOC >::needsReordering ( const std::size_t  k,
const bool  k_is_input_col = false 
) const

indicates whether a reordering is needed to make the kth translator sorted

For a given translator, if the strings represented by the translations are only numbers, the translations are considered to be sorted if and only if they are sorted by increasing number. If the strings do not only represent numbers, then translations are considered to be sorted if and only if they are sorted lexicographically.

When constructing dynamically its dictionary, the translator may assign wrong DBTranslatedValue values to strings. For instance, a translator reading sequentially integer strings 4, 1, 3, may map 4 into DBTranslatedValue{std::size_t(0)}, 1 into DBTranslatedValue{std::size_t(1)} and 3 into DBTranslatedValue{std::size_t(2)}, resulting in random variables having domain {4,1,3}. The user may prefer having domain {1,3,4}, i.e., a domain specified with increasing values. This requires a reordering. Method needsReodering() returns a Boolean indicating whether such a reordering should be performed or whether the current order is OK.

Translators read an input dataset that is not necessarily the same as the content of the DatabaseTable. For instance, a CSV may contain 10 columns, but if a DatabaseTable only contains two translators reading columns 3 and 5 respectively, then the DatabaseTable only contains 2 columns. When k_is_input_col is set to false, Parameter k passed in argument corresponds to either 0 or 1, i.e., the index of one of these two columns. When k_is_input_col is set to true, the translator to be reordered is that which parses the kth column of the input database.

Exceptions
UndefinedElementis raised if there is no translator corresponding to k.
template<template< typename > class ALLOC = std::allocator>
DatabaseTable< ALLOC >& gum::learning::DatabaseTable< ALLOC >::operator= ( const DatabaseTable< ALLOC > &  from)

copy operator

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

move constructor

template<template< typename > class ALLOC = std::allocator>
void gum::learning::DatabaseTable< ALLOC >::reorder ( const std::size_t  k,
const bool  k_is_input_col = false 
)

performs a reordering of the kth translator or of the translator corresponding to the kth column of the input database

For a given translator, if the strings represented by the translations are only numbers, the translations are considered to be sorted if and only if they are sorted by increasing number. If the strings do not only represent numbers, then translations are considered to be sorted if and only if they are sorted lexicographically.

Translators read an input dataset that is not necessarily the same as the content of the DatabaseTable. For instance, a CSV may contain 10 columns, but if a DatabaseTable only contains two translators reading columns 3 and 5 respectively, then the DatabaseTable only contains 2 columns. When k_is_input_col is set to false, Parameter k passed in argument corresponds to either 0 or 1, i.e., the index of one of these two columns. When k_is_input_col is set to true, the translator to be reordered is that which parses the kth column of the input database.

Exceptions
UndefinedElementis raised if there is no translator corresponding to k.

Referenced by gum::learning::genericBNLearner::__readFile().

+ Here is the caller graph for this function:

template<template< typename > class ALLOC = std::allocator>
void gum::learning::DatabaseTable< ALLOC >::reorder ( )

performs a reordering of all the columns

For a given translator, if the strings represented by the translations are only numbers, the translations are considered to be sorted if and only if they are sorted by increasing number. If the strings do not only represent numbers, then translations are considered to be sorted if and only if they are sorted lexicographically.

template<template< typename > class ALLOC = std::allocator>
virtual void gum::learning::DatabaseTable< ALLOC >::setVariableNames ( const std::vector< std::string, ALLOC< std::string > > &  names,
const bool  from_external_object = true 
)
finalvirtual

sets the names of the variables

This method can be called in two different ways: either the names correspond precisely to the columns stored into the database table (in this case, parameter from_external_object is equal to false), or they corresponds to the columns of an external database (e.g., a CSV file) from which we potentially excluded some columns and, consequently, these columns should not be taken into account (in this case, parameter from_external_object is equal to true). As an example, imagine that the database table is created from a CSV file with 5 columns named X0, X1, X2, X3 and X4 respectivly. Suppose that we asked the database table to ignore columns X1 and X3. Then setVariableNames( { "X0", "X1", "X2", "X3", "X4" }, true ) will set the columns of the database table as { "X0", "X2", "X4" }. The same result could be obtained by executing setVariableNames( { "X0", "X2", "X4" }, false ), which specifies directly the set of names to retain in the database table.

Parameters
namesthe names of all the columns, including the ignored columns if from_external_object is set to true, else excluding them (i.e., this should precisely correspond to the columns stored into the database table).
from_external_objecta Boolean indicating whether parameter names includes the columns ignored by the database table (true) or not (false).
Exceptions
SizeErroris raised if the names passed in arguments cannot be assigned to the columns of the DatabaseTable because the size of their vector is inadequate.

Implements gum::learning::IDatabaseTable< DBTranslatedValue, ALLOC >.

Referenced by gum::learning::genericBNLearner::__readFile(), and gum::learning::readFile().

+ Here is the caller graph for this function:

void gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::setVariableNames ( const std::vector< std::string, OTHER_ALLOC< std::string > > &  names,
const bool  from_external_object = true 
)
inherited

sets the names of the variables

This method can be called in two different ways: either the names correspond precisely to the columns stored into the database table (in this case, parameter from_external_object is equal to false), or they corresponds to the columns of an external database (e.g., a CSV file) from which we potentially excluded some columns and, consequently, these columns should not be taken into account (in this case, parameter from_external_object is equal to true). As an example, imagine that the database table is created from a CSV file with 5 columns named X0, X1, X2, X3 and X4 respectivly. Suppose that we asked the database table to ignore columns X1 and X3. Then setVariableNames( { "X0", "X1", "X2", "X3", "X4" }, true ) will set the columns of the database table as { "X0", "X2", "X4" }. The same result could be obtained by executing setVariableNames( { "X0", "X2", "X4" }, false ), which specifies directly the set of names to retain in the database table.

Parameters
namesthe names of all the columns, including the ignored columns if from_external_object is set to true, else excluding them (i.e., this should precisely correspond to the columns stored into the database table).
from_external_objecta Boolean indicating whether parameter names includes the columns ignored by the database table (true) or not (false).
Exceptions
SizeErroris raised if the names passed in arguments cannot be assigned to the columns of the IDatabaseTable because the size of their vector is inadequate.
std::size_t gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::size ( ) const
noexceptinherited

returns the number of records (rows) in the database

template<template< typename > class ALLOC = std::allocator>
const DBTranslator< ALLOC >& gum::learning::DatabaseTable< ALLOC >::translator ( const std::size_t  k,
const bool  k_is_input_col = false 
) const

returns either the kth translator of the database table or that reading the kth column of the input database

Translators read an input dataset that is not necessarily the same as the content of the DatabaseTable. For instance, a CSV may contain 10 columns, but if a DatabaseTable only contains two translators reading columns 3 and 5 respectively, then the DatabaseTable only contains 2 columns. When k_is_input_col is set to false, Parameter k passed in argument corresponds to either 0 or 1, i.e., the index of one of these two columns. When k_is_input_col is set to true, the translator returned is that which parses the kth column of the input database.

Exceptions
UndefinedElementis raised if there is no translator corresponding to k.

Referenced by gum::learning::BNDatabaseGenerator< GUM_SCALAR >::toDatabaseTable().

+ Here is the caller graph for this function:

template<template< typename > class ALLOC = std::allocator>
const DBTranslatorSet< ALLOC >& gum::learning::DatabaseTable< ALLOC >::translatorSet ( ) const

returns the set of translators

template<template< typename > class ALLOC = std::allocator>
const Variable& gum::learning::DatabaseTable< ALLOC >::variable ( const std::size_t  k,
const bool  k_is_input_col = false 
) const

returns either the kth variable of the database table or that corresponding to the kth column of the input database

Translators read an input dataset that is not necessarily the same as the content of the DatabaseTable. For instance, a CSV may contain 10 columns, but if a DatabaseTable only contains two translators reading columns 3 and 5 respectively, then the DatabaseTable only contains 2 columns. When k_is_input_col is set to false, Parameter k passed in argument corresponds to either 0 or 1, i.e., the index of one of these two columns. When k_is_input_col is set to true, the variable is that of the translator that parses the kth column of the input database.

Exceptions
UndefinedElementis raised if there is no translator corresponding to k.

Referenced by gum::learning::genericBNLearner::Database::__BNVars(), and gum::learning::genericBNLearner::Database::Database().

+ Here is the caller graph for this function:

const std::string& gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::variableName ( const std::size_t  k) const
inherited

returns the name of the kth column of the database

Exceptions
OutOfBoundsis raised if the dtabase contains fewer than k columns.
const DBVector< std::string >& gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::variableNames ( ) const
noexceptinherited

returns the variable names for all the columns of the database

The names do not include the ignored columns.

Member Data Documentation

DBVector< std::string > gum::learning::IDatabaseTable< DBTranslatedValue , ALLOC >::_variable_names
protectedinherited

the names of the variables for each column

Definition at line 1076 of file IDatabaseTable.h.


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