Vowpal Wabbit
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions | Variables
interactions.h File Reference
#include "vw/common/future_compat.h"
#include "vw/core/constant.h"
#include "vw/core/example_predict.h"
#include "vw/core/feature_group.h"
#include "vw/core/vw_fwd.h"
#include "vw/core/vw_math.h"
#include <algorithm>
#include <cstddef>
#include <limits>
#include <set>
#include <vector>

Classes

class  VW::interactions_generator
 

Namespaces

namespace  VW
 
namespace  VW::details
 
namespace  INTERACTIONS
 

Typedefs

template<typename T >
using VW::generate_func_t = std::vector< std::vector< T > >(const std::set< T > &namespaces, size_t num_to_pick)
 

Functions

constexpr bool VW::is_interaction_ns (const unsigned char ns)
 
bool VW::contains_wildcard (const std::vector< VW::namespace_index > &interaction)
 
bool VW::contains_wildcard (const std::vector< VW::extent_term > &interaction)
 
float VW::eval_sum_ft_squared_of_generated_ft (bool permutations, const std::vector< std::vector< VW::namespace_index > > &interactions, const std::vector< std::vector< VW::extent_term > > &extent_interactions, const std::array< VW::features, VW::NUM_NAMESPACES > &feature_spaces)
 
template<typename T >
std::vector< T > VW::details::indices_to_values_one_based (const std::vector< size_t > &indices, const std::set< T > &values)
 
template<typename T >
std::vector< T > VW::details::indices_to_values_ignore_last_index (const std::vector< size_t > &indices, const std::set< T > &values)
 
template<typename T >
bool VW::details::must_be_left_sorted (const std::vector< T > &oi)
 
template<typename T >
void VW::details::sort_and_filter_duplicate_interactions (std::vector< std::vector< T > > &vec, bool filter_duplicates, size_t &removed_cnt, size_t &sorted_cnt)
 
template<typename T >
std::vector< std::vector< T > > VW::details::generate_namespace_combinations_with_repetition (const std::set< T > &namespaces, size_t num_to_pick)
 
template<typename T >
std::vector< std::vector< T > > VW::details::generate_namespace_permutations_with_repetition (const std::set< T > &namespaces, size_t num_to_pick)
 
std::vector< std::vector< VW::namespace_index > > VW::details::expand_quadratics_wildcard_interactions (bool leave_duplicate_interactions, const std::set< VW::namespace_index > &new_example_indices)
 
bool VW::details::sort_interactions_comparator (const std::vector< VW::namespace_index > &a, const std::vector< VW::namespace_index > &b)
 
template<generate_func_t< VW::namespace_index > generate_func, bool leave_duplicate_interactions>
std::vector< std::vector< VW::namespace_index > > VW::details::compile_interaction (const std::vector< VW::namespace_index > &interaction, const std::set< VW::namespace_index > &indices)
 
template<generate_func_t< VW::extent_term > generate_func, bool leave_duplicate_interactions>
std::vector< std::vector< VW::extent_term > > VW::details::compile_extent_interaction (const std::vector< VW::extent_term > &interaction, const std::set< VW::extent_term > &_all_seen_extents)
 
template<generate_func_t< VW::namespace_index > generate_func, bool leave_duplicate_interactions>
std::vector< std::vector< VW::namespace_index > > VW::details::compile_interactions (const std::vector< std::vector< VW::namespace_index > > &interactions, const std::set< VW::namespace_index > &indices)
 
template<generate_func_t< VW::extent_term > generate_func, bool leave_duplicate_interactions>
std::vector< std::vector< VW::extent_term > > VW::details::compile_extent_interactions (const std::vector< std::vector< VW::extent_term > > &interactions, const std::set< VW::extent_term > &indices)
 
constexpr bool INTERACTIONS::is_interaction_ns (const unsigned char ns)
 
bool INTERACTIONS::contains_wildcard (const std::vector< VW::namespace_index > &interaction)
 
bool INTERACTIONS::contains_wildcard (const std::vector< VW::extent_term > &interaction)
 
float INTERACTIONS::eval_sum_ft_squared_of_generated_ft (bool permutations, const std::vector< std::vector< VW::namespace_index > > &interactions, const std::vector< std::vector< VW::extent_term > > &extent_interactions, const std::array< VW::features, VW::NUM_NAMESPACES > &feature_spaces)
 
template<typename T >
void INTERACTIONS::sort_and_filter_duplicate_interactions (std::vector< std::vector< T > > &vec, bool filter_duplicates, size_t &removed_cnt, size_t &sorted_cnt)
 

Variables

constexpr unsigned char VW::details::INTERACTION_NS_START = ' '
 
constexpr unsigned char VW::details::INTERACTION_NS_END = '~'