Loading...
Searching...
No Matches
variable.h
Go to the documentation of this file.
129 || (actual == VariableRole::InputTarget && (query == VariableRole::Input || query == VariableRole::Target));
Definition json.h:72
Definition json.h:85
Definition adaptive_moment_estimation.h:14
const EnumMap< ScalerMethod > & scaler_method_map()
Returns the bidirectional string/enum map for ScalerMethod.
Definition variable.h:60
VariableRole
Role a Variable plays in a dataset (input feature, target, decoder, time axis, etc....
Definition variable.h:88
bool role_matches(VariableRole actual, VariableRole query)
Returns true if actual satisfies query, treating InputTarget as Input or Target.
Definition variable.h:126
const EnumMap< VariableRole > & variable_role_map()
Returns the bidirectional string/enum map for VariableRole.
Definition variable.h:98
ScalerMethod
Feature scaling strategy applied to a Variable before training.
Definition variable.h:50
const string & variable_role_to_string(VariableRole role)
Returns the canonical string name for a VariableRole.
Definition variable.h:113
const EnumMap< VariableType > & variable_type_map()
Returns the bidirectional string/enum map for VariableType.
Definition variable.h:22
ScalerMethod string_to_scaler_method(const string &name)
Parses a string into the matching ScalerMethod enumerator.
Definition variable.h:81
const string & scaler_method_to_string(ScalerMethod method)
Returns the canonical string name for a ScalerMethod.
Definition variable.h:75
const string & variable_type_to_string(VariableType type)
Returns the canonical string name for a VariableType.
Definition variable.h:37
VariableRole string_to_variable_role(const string &name)
Parses a string into a VariableRole; "Id" is mapped to VariableRole::None.
Definition variable.h:119
VariableType string_to_variable_type(const string &name)
Parses a string into the matching VariableType enumerator.
Definition variable.h:43
Definition enum_map.h:18
Variable(const string &={}, const string &="None", const VariableType &=VariableType::Numeric, const string &="MeanStandardDeviation", const vector< string > &={})
Constructs a Variable with optional name, role, type, scaler and category list.
void set_categories(const vector< string > &new_categories)
Definition variable.h:179
Index feature_count() const
Returns the number of features generated by this Variable (categories or one).
Definition variable.h:194
Index get_categories_number() const
Returns the number of categories for categorical variables (zero otherwise).
void set_type(const string &)
Sets the Variable type from its canonical string name.
bool is_used() const
Returns true if the Variable has an active role other than Time.
Definition variable.h:191
bool is_categorical() const
Returns true if the Variable type is Categorical.
Definition variable.h:189
vector< string > get_names() const
Returns the expanded feature names (one per category for categorical variables).
void set(const string &={}, const string &="None", const VariableType &=VariableType::Numeric, const string &="MeanStandardDeviation", const vector< string > &={})
Resets the Variable fields to the supplied values.
const string & get_type_string() const
Returns the canonical string name of the Variable type.
bool is_binary() const
Returns true if the Variable type is Binary.
Definition variable.h:187
void from_JSON(const JsonDocument &)
Loads Variable fields from a JSON document.