![]() |
Ultra 0.9.4
|
#include <dataframe.h>
Classes | |
| struct | params |
Public Types | |
| using | examples_t = std::vector<src::example> |
| using | value_type = examples_t::value_type |
| using | iterator = examples_t::iterator |
| using | const_iterator = examples_t::const_iterator |
| using | difference_type = examples_t::difference_type |
Public Member Functions | |
| dataframe (std::istream &) | |
| dataframe (std::istream &, const params &) | |
| dataframe (const std::filesystem::path &) | |
| dataframe (const std::filesystem::path &, const params &) | |
| template<DataframeMatrix R> | |
| dataframe (const R &) | |
| template<DataframeMatrix R> | |
| dataframe (const R &, params) | |
| iterator | begin () noexcept |
| const_iterator | begin () const noexcept |
| iterator | end () noexcept |
| const_iterator | end () const noexcept |
| const value_type & | front () const |
| value_type & | front () |
| void | clear () |
| iterator | erase (iterator, iterator) |
| void | push_back (src::example, bool=false) |
| template<std::input_iterator InputIt> | |
| iterator | insert (const_iterator, InputIt, InputIt) |
| void | swap (dataframe &) |
| std::size_t | read (const std::filesystem::path &) |
| std::size_t | read (const std::filesystem::path &, const params &) |
| std::size_t | read (std::istream &) |
| std::size_t | read (std::istream &, params) |
| template<DataframeMatrix R> | |
| std::size_t | read (const R &) |
| template<DataframeMatrix R> | |
| std::size_t | read (const R &, params) |
| bool | operator! () const noexcept |
| bool | clone_schema (const dataframe &) |
| bool | set_schema (const std::vector< std::pair< std::string, domain_t > > &) |
| std::size_t | size () const noexcept |
| bool | empty () const noexcept |
| class_t | classes () const noexcept |
| unsigned | variables () const |
| std::string | class_name (class_t) const noexcept |
| task_t | task () const noexcept |
| bool | is_valid () const |
| template<std::ranges::range R> | |
| example | to_example (const R &r) const |
| template<DataframeRow R> | |
| bool | read_record (R r, std::optional< std::size_t > output_index, bool add_instance) |
| template<DataframeMatrix R> | |
| std::size_t | read (const R &container, params p) |
| template<DataframeMatrix R> | |
| std::size_t | read (const R &container) |
| template<DataframeMatrix R> | |
| dataframe (const R &t, params p) | |
| template<DataframeMatrix R> | |
| dataframe (const R &t) | |
Public Attributes | |
| src::columns_info | columns {} |
Related Symbols | |
(Note that these are not member symbols.) | |
| std::ostream & | operator<< (std::ostream &os, const dataframe &d) |
Owning container for tabular data and its schema.
The dataframe class provides a uniform interface to load, store and validate datasets coming from files, streams or in-memory ranges.
| ultra::src::dataframe::dataframe | ( | std::istream & | is, |
| const params & | p ) |
New dataframe instance containing the learning collection from a stream.
| [in] | is | input stream |
| [in] | p | additional, optional, parameters (see params structure) |
| ultra::src::dataframe::dataframe | ( | const std::filesystem::path & | fn, |
| const params & | p ) |
New dataframe instance containing the learning collection from a file.
| [in] | fn | name of the file containing the learning collection (CSV / XRFF format) |
| [in] | p | additional, optional, parameters (see params structure) |
| ultra::src::dataframe::dataframe | ( | const R & | t | ) |
Construct a dataframe from a matrix-like range.
| R | a DataframeMatrix type |
| [in] | t | the data source |
| ultra::src::dataframe::dataframe | ( | const R & | t, |
| params | p ) |
Construct a dataframe from a matrix-like range.
| R | a DataframeMatrix type |
| [in] | t | the data source |
| [in] | p | additional, optional, parameters (see params structure) |
| ultra::src::dataframe::dataframe | ( | const R & | t, |
| params | p ) |
Construct a dataframe from a matrix-like range.
| R | a DataframeMatrix type |
| [in] | t | the data source |
| [in] | p | additional, optional, parameters (see params structure) |
| ultra::src::dataframe::dataframe | ( | const R & | t | ) |
Construct a dataframe from a matrix-like range.
| R | a DataframeMatrix type |
| [in] | t | the data source |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
Retrieve the external name of a class.
| [in] | i | internal class identifier |
|
nodiscardnoexcept |
| void ultra::src::dataframe::clear | ( | ) |
Removes all elements from the container.
Invalidates any references, pointers or iterators referring to contained examples. Any past-the-end iterators are also invalidated.
Leaves the associated metadata unchanged.
| bool ultra::src::dataframe::clone_schema | ( | const dataframe & | other | ) |
Creates a copy of a given schema in an empty dataframe.
| [in] | other | dataframe we copy schema from |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
| dataframe::iterator ultra::src::dataframe::erase | ( | iterator | first, |
| iterator | last ) |
Removes specified elements from the dataframe.
| [in] | first | first element of the range |
| [in] | last | end of the range |
|
nodiscard |
Returns a reference to the first element in the dataframe.
|
nodiscard |
Returns a constant reference to the first element in the dataframe.
| dataframe::iterator ultra::src::dataframe::insert | ( | dataframe::const_iterator | pos, |
| InputIt | first, | ||
| InputIt | last ) |
Inserts elements from range [first, last[ before pos.
| [in] | pos | iterator before which the content will be inserted (may be the end() iterator) |
| [in] | first | first iterator of the range of elements to insert, cannot be iterator into container for which insert is called |
| [in] | last | last iterator of the range of elements to insert, cannot be iterator into container for which insert is called |
|
nodiscard |
|
nodiscardnoexcept |
| void ultra::src::dataframe::push_back | ( | src::example | e, |
| bool | add_instance = false ) |
Appends the given element to the end of the active dataset.
| [in] | e | the value of the element to append |
| [in] | add_instance | should we automatically add instances for text features? |
| std::size_t ultra::src::dataframe::read | ( | const R & | container, |
| params | p ) |
Populate the dataframe from an in-memory range.
| [in] | container | the input data |
| [in] | p | parsing and typing parameters. Only p.data_typing and p.output_index are used |
This function clears existing data, infers the schema using columns_info::build and then loads all rows into the dataframe.
| std::size_t ultra::src::dataframe::read | ( | const R & | container, |
| params | p ) |
Populate the dataframe from an in-memory range.
| [in] | container | the input data |
| [in] | p | parsing and typing parameters. Only p.data_typing and p.output_index are used |
This function clears existing data, infers the schema using columns_info::build and then loads all rows into the dataframe.
| std::size_t ultra::src::dataframe::read | ( | const std::filesystem::path & | fn, |
| const params & | p ) |
Loads the content of a file into the active dataset.
| [in] | fn | name of the file containing the data set (CSV / XRFF format) |
| [in] | p | additional, optional, parameters (see params structure) |
| std::invalid_argument | missing dataset file name |
| bool ultra::src::dataframe::read_record | ( | R | r, |
| std::optional< std::size_t > | output_index, | ||
| bool | add_instance ) |
| [in] | r | an example in raw format |
| [in] | output_index | index of the output column |
| [in] | add_instance | should we automatically add instances for text features? |
| bool ultra::src::dataframe::set_schema | ( | const std::vector< std::pair< std::string, domain_t > > & | schema | ) |
Sets the schema of the dataframe.
| [in] | schema | the dataframe schema |
|
nodiscardnoexcept |
| void ultra::src::dataframe::swap | ( | dataframe & | other | ) |
Exchanges the contents and capacity of the container with those of other.
| [in] | other | dataframe to exchange the contents with |
|
nodiscardnoexcept |
Return the learning task associated with the dataframe.
The task reflects the role and domain of the output column and may be classification, regression or unsupervised learning.
| example ultra::src::dataframe::to_example | ( | const R & | r | ) | const |
| [in] | r | a range containing the example |
|
nodiscard |
Return the number of input variables.
|
Prints the content of the dataframe on a given stream (markdown format).
| [out] | os | output stream |
| [in] | d | dataframe to be printed |