![]() |
Ultra 0.9.4
|
#include <columns_info.h>
Classes | |
| class | column_info |
| Information about a single column of the dataset. More... | |
Public Types | |
| using | const_iterator = std::vector<column_info>::const_iterator |
| using | iterator = std::vector<column_info>::iterator |
| using | size_type = std::size_t |
| using | value_type = column_info |
Public Member Functions | |
| columns_info (const columns_info &) | |
| columns_info (const std::vector< std::pair< std::string, domain_t > > &) | |
| columns_info & | operator= (const columns_info &) |
| const column_info & | operator[] (size_type) const |
| column_info & | operator[] (size_type) |
| const column_info & | operator[] (const std::string &) const |
| const column_info & | front () const |
| column_info & | front () |
| const column_info & | back () const |
| column_info & | back () |
| size_type | size () const noexcept |
| bool | empty () const noexcept |
| const_iterator | begin () const noexcept |
| iterator | begin () noexcept |
| const_iterator | end () const noexcept |
| iterator | end () noexcept |
| const_iterator | cbegin () const noexcept |
| const_iterator | cend () const noexcept |
| void | pop_back () |
| void | push_back (const column_info &) |
| void | push_front (const column_info &) |
| void | data_typing (typing) noexcept |
| template<DataframeMatrix R> | |
| void | build (const R &, std::optional< std::size_t >) |
| std::set< symbol::category_t > | used_categories () const |
| domain_t | domain_of_category (symbol::category_t) const |
| task_t | task () const noexcept |
| bool | is_valid () const |
| template<DataframeMatrix R> | |
| void | build (const R &exs, std::optional< std::size_t > output_index) |
Metadata container describing the columns of a dataframe.
This class stores and manages column-level information such as:
It also provides facilities to infer such metadata from a dataframe-like range and to query the resulting schema.
| ultra::src::columns_info::columns_info | ( | const columns_info & | other | ) |
Copy constructor.
| [in] | other | another container to be used as source to initialize the elements of the container with |
Constructs the container with the copy of the contents of other.
| ultra::src::columns_info::columns_info | ( | const std::vector< std::pair< std::string, domain_t > > & | schema | ) |
Constructs the object from a user provided-schema.
| [in] | schema | user-provided schema for the dataframe |
|
nodiscard |
Returns a reference to the last element in the container.
| void ultra::src::columns_info::build | ( | const R & | exs, |
| std::optional< std::size_t > | output_index ) |
Infer column metadata from a dataframe-like range.
| R | a DataframeMatrix type |
| [in] | exs | a non-empty range of rows representing the dataset. The first row must contain column headers |
| [in] | output_index | optional index of the output column. If not provided, a surrogate output column may be inserted |
The first row of exs is interpreted as the header row. An optional output column may be designated via output_index; when present, the corresponding column is treated as the output and is normalised to appear first during analysis.
Domain inference is performed on a bounded reservoir sample of valid input rows.
| void ultra::src::columns_info::build | ( | const R & | exs, |
| std::optional< std::size_t > | output_index ) |
Infer column metadata from a dataframe-like range.
| R | a DataframeMatrix type |
| [in] | exs | a non-empty range of rows representing the dataset. The first row must contain column headers |
| [in] | output_index | optional index of the output column. If not provided, a surrogate output column may be inserted |
The first row of exs is interpreted as the header row. An optional output column may be designated via output_index; when present, the corresponding column is treated as the output and is normalised to appear first during analysis.
Domain inference is performed on a bounded reservoir sample of valid input rows.
|
noexcept |
Set the data typing system used for category identification.
| [in] | t | type of data typing (see typing for details) |
|
nodiscard |
Return the domain associated with a symbol category.
| [in] | target | category of interest |
|
nodiscard |
Returns a reference to the first element in the container.
|
nodiscard |
| columns_info & ultra::src::columns_info::operator= | ( | const columns_info & | other | ) |
Copy assignment operator.
| [in] | other | another container to use as the data source |
Replaces the contents with a copy of the contents of other.
|
nodiscard |
Returns a reference to column_info with specified column header.
| [in] | name | the name of the column_info to find |
| `std::out_of_range` | if the container does not contain a column with the specified name |
|
nodiscard |
Access column metadata by index.
| [in] | i | column index |
|
nodiscard |
Access column metadata by index.
| [in] | i | column index |
| void ultra::src::columns_info::pop_back | ( | ) |
Removes the last column from the container.
| void ultra::src::columns_info::push_back | ( | const column_info & | v | ) |
Adds a new column at the end of the column list.
| [in] | v | information about the new column |
| void ultra::src::columns_info::push_front | ( | const column_info & | v | ) |
Inserts a new column at the beginning of the list, moving existing columns forward.
| [in] | v | information about the new column |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
Return the learning task inferred for the columns.
| std::set< symbol::category_t > ultra::src::columns_info::used_categories | ( | ) | const |