Turi Create  4.0
turi::groupby_operators::quantile Class Reference

#include <core/storage/sframe_data/groupby_aggregate_operators.hpp>

Public Member Functions

void init (const std::vector< double > &quantiles_to_query)
 
group_aggregate_valuenew_instance () const
 
void add_element_simple (const flexible_type &flex)
 Adds a new element.
 
void partial_finalize ()
 Done adding elements.
 
void combine (const group_aggregate_value &other)
 combines two partial quantile sketches
 
virtual flexible_type emit () const
 Emits the desired quantiles.
 
bool support_type (flex_type_enum type) const
 The types supported by the quantile sketch (int, float)
 
flex_type_enum set_input_type (flex_type_enum type)
 The input type.
 
virtual std::string name () const
 Name of the class.
 
void save (oarchive &oarc) const
 Serializer.
 
void load (iarchive &iarc)
 Deserializer.
 
virtual void add_element (const std::vector< flexible_type > &values)
 
virtual flex_type_enum set_input_types (const std::vector< flex_type_enum > &types)
 
virtual void print (std::ostream &os) const
 

Detailed Description

Impelments the quantile operator.

Definition at line 912 of file groupby_aggregate_operators.hpp.

Member Function Documentation

◆ add_element()

virtual void turi::group_aggregate_value::add_element ( const std::vector< flexible_type > &  values)
inlinevirtualinherited

Adds an element to the aggregate. Elements to be added will be either the input_type (as set by set_input_type()) or UNDEFINED.

Operator that expects more than one input values need to overwrite this function

Reimplemented in turi::groupby_operators::zip_dict, turi::groupby_operators::argmax, and turi::groupby_operators::argmin.

Definition at line 60 of file group_aggregate_value.hpp.

◆ init()

void turi::groupby_operators::quantile::init ( const std::vector< double > &  quantiles_to_query)
inline

Used to initialize the operator. To set the configuration for what quantiles to query.

Definition at line 919 of file groupby_aggregate_operators.hpp.

◆ new_instance()

group_aggregate_value* turi::groupby_operators::quantile::new_instance ( ) const
inlinevirtual

Returns a new empty instance of quantile with the same set of quantiles to be queried

Implements turi::group_aggregate_value.

Definition at line 926 of file groupby_aggregate_operators.hpp.

◆ print()

virtual void turi::group_aggregate_value::print ( std::ostream &  os) const
inlinevirtualinherited

Override this function for allowing the operator to be easily printed.

std::cout << aggregator <<s std::endl;

Reimplemented in turi::groupby_operators::variance.

Definition at line 134 of file group_aggregate_value.hpp.

◆ set_input_types()

virtual flex_type_enum turi::group_aggregate_value::set_input_types ( const std::vector< flex_type_enum > &  types)
inlinevirtualinherited

Sets the input types and returns the output type. For instance, a sum aggregator when summing integers will return an integer, and when summing doubles will return doubles.

Default implementation assumes there is ony one input, and output type is the same as input type.

Reimplemented in turi::groupby_operators::zip_list, turi::groupby_operators::zip_dict, turi::groupby_operators::non_null_count, turi::groupby_operators::count, turi::groupby_operators::argmax, and turi::groupby_operators::argmin.

Definition at line 102 of file group_aggregate_value.hpp.


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