Turi Create  4.0
turi::v2::ml_data_side_features Class Reference

#include <toolkits/ml_data_2/side_features.hpp>

Public Member Functions

side_feature_info get_side_feature_block (size_t main_column_index, size_t main_feature_index) const GL_HOT_INLINE_FLATTEN
 
template<typename EntryType >
void add_partial_side_features_to_row (std::vector< EntryType > &x, size_t main_column_index, size_t feature_index) const
 
template<typename EntryType , size_t n>
void add_partial_side_features_to_row (std::array< EntryType, n > &x, size_t main_column_index, size_t feature_index) const
 Dummy overload to make a number of compiler issues easier.
 
void add_partial_side_features_to_row (std::vector< ml_data_entry > &x, size_t main_column_index) const GL_HOT
 
template<typename GlobalEntryType >
void add_partial_side_features_to_row (std::vector< GlobalEntryType > &x, size_t main_column_index) const
 
template<typename EntryType , size_t n>
void add_partial_side_features_to_row (std::array< EntryType, n > &x, size_t main_column_index) const
 Dummy overload to make a number of compiler issues easier.
 
std::pair< size_t, size_t > column_indices_of_side_information_block (size_t main_column_index) const
 
std::pair< size_t, size_t > global_indices_of_side_information_block (size_t main_column_index) const
 
void add_side_features_to_row (std::vector< ml_data_entry > &x) const
 
template<typename GlobalEntryType >
void add_side_features_to_row (std::vector< GlobalEntryType > &x) const
 
template<typename EntryType , size_t n>
void add_side_features_to_row (std::array< EntryType, n > &x) const
 
void strip_side_features_from_row (size_t main_column_index, std::vector< ml_data_entry > &x) const
 
template<typename GlobalEntryType >
void strip_side_features_from_row (size_t main_column_index, std::vector< GlobalEntryType > &x) const
 
template<typename EntryType , size_t n>
void strip_side_features_from_row (size_t main_column_index, std::array< EntryType, n > &x) const
 
size_t num_columns (size_t main_column_index) const
 

Detailed Description

A class to manage possible sources of side information.

Definition at line 26 of file side_features.hpp.

Member Function Documentation

◆ add_partial_side_features_to_row() [1/3]

template<typename EntryType >
void turi::v2::ml_data_side_features::add_partial_side_features_to_row ( std::vector< EntryType > &  x,
size_t  main_column_index,
size_t  feature_index 
) const
inline

Overload of the above. Appends the side features associated with exactly one of the main columns to the observation vector x.

Definition at line 108 of file side_features.hpp.

◆ add_partial_side_features_to_row() [2/3]

void turi::v2::ml_data_side_features::add_partial_side_features_to_row ( std::vector< ml_data_entry > &  x,
size_t  main_column_index 
) const
inline

Appends the side features associated with exactly one of the main columns to the observation vector x.

Definition at line 141 of file side_features.hpp.

◆ add_partial_side_features_to_row() [3/3]

template<typename GlobalEntryType >
void turi::v2::ml_data_side_features::add_partial_side_features_to_row ( std::vector< GlobalEntryType > &  x,
size_t  main_column_index 
) const
inline

Appends the side features associated with exactly one of the main columns to the observation vector x.

Definition at line 149 of file side_features.hpp.

◆ add_side_features_to_row() [1/3]

void turi::v2::ml_data_side_features::add_side_features_to_row ( std::vector< ml_data_entry > &  x) const
inline

Appends all available side information to the vector x based on current values in x.

Definition at line 203 of file side_features.hpp.

◆ add_side_features_to_row() [2/3]

template<typename GlobalEntryType >
void turi::v2::ml_data_side_features::add_side_features_to_row ( std::vector< GlobalEntryType > &  x) const
inline

Appends all available side information to the vector x based on current values in x.

Definition at line 218 of file side_features.hpp.

◆ add_side_features_to_row() [3/3]

template<typename EntryType , size_t n>
void turi::v2::ml_data_side_features::add_side_features_to_row ( std::array< EntryType, n > &  x) const
inline

Overload of above; this case shouldn't ever be called – i.e., if you are using side features, you should be using vectors, not arrays.

Definition at line 233 of file side_features.hpp.

◆ column_indices_of_side_information_block()

std::pair<size_t, size_t> turi::v2::ml_data_side_features::column_indices_of_side_information_block ( size_t  main_column_index) const
inline

Returns the bounds on the column indices of data associated with a particular column.

In a full std::vector<ml_data_entry> observation, the entries with column indices between these two values will be from the side data associated with main_column_index.

Definition at line 170 of file side_features.hpp.

◆ get_side_feature_block()

side_feature_info turi::v2::ml_data_side_features::get_side_feature_block ( size_t  main_column_index,
size_t  main_feature_index 
) const
inline

Returns a pointer to the raw location

Definition at line 85 of file side_features.hpp.

◆ global_indices_of_side_information_block()

std::pair<size_t, size_t> turi::v2::ml_data_side_features::global_indices_of_side_information_block ( size_t  main_column_index) const
inline

Returns the bounds on the global indices of data associated with a particular column.

In a full std::vector<ml_data_entry> observation, the entries with column indices between these two values will be from the side data associated with main_column_index.

Definition at line 185 of file side_features.hpp.

◆ num_columns()

size_t turi::v2::ml_data_side_features::num_columns ( size_t  main_column_index) const

Returns the number of columns joined off of column main_column_index in the main data.

◆ strip_side_features_from_row() [1/3]

void turi::v2::ml_data_side_features::strip_side_features_from_row ( size_t  main_column_index,
std::vector< ml_data_entry > &  x 
) const
inline

Strips out the side features in the row associated with main_column_index.

Definition at line 240 of file side_features.hpp.

◆ strip_side_features_from_row() [2/3]

template<typename GlobalEntryType >
void turi::v2::ml_data_side_features::strip_side_features_from_row ( size_t  main_column_index,
std::vector< GlobalEntryType > &  x 
) const
inline

Strips out the side features in the row associated with main_column_index –

Definition at line 257 of file side_features.hpp.

◆ strip_side_features_from_row() [3/3]

template<typename EntryType , size_t n>
void turi::v2::ml_data_side_features::strip_side_features_from_row ( size_t  main_column_index,
std::array< EntryType, n > &  x 
) const
inline

Can't strip out arrays.

Definition at line 273 of file side_features.hpp.


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