Turi Create  4.0
turi::supervised::logistic_regression Class Referenceabstract

#include <toolkits/supervised_learning/logistic_regression.hpp>

Public Member Functions

 ~logistic_regression ()
 
void set_default_evaluation_metric () override
 
void set_default_tracking_metric () override
 
void model_specific_init (const ml_data &data, const ml_data &valid_data) override
 
bool is_classifier () const override
 
void init_options (const std::map< std::string, flexible_type > &_options) override
 
size_t get_version () const override
 
void train () override
 
void set_coefs (const DenseVector &_coefs) override
 
void save_impl (turi::oarchive &oarc) const override
 
void load_version (turi::iarchive &iarc, size_t version) override
 
flexible_type predict_single_example (const DenseVector &x, const prediction_type_enum &output_type=prediction_type_enum::NA) override
 
gl_sframe fast_predict_topk (const std::vector< flexible_type > &rows, const std::string &missing_value_action="error", const std::string &output_type="", const size_t topk=5) override
 
flexible_type predict_single_example (const SparseVector &x, const prediction_type_enum &output_type=prediction_type_enum::NA) override
 
void get_coefficients (DenseVector &_coefs) const
 
std::shared_ptr< coreml::MLModelWrapper > export_to_coreml () override
 
std::vector< std::vector< flexible_type > > get_metadata_mapping ()
 
virtual flexible_type predict_single_example (const ml_data_iterator &it, const prediction_type_enum &output_type=prediction_type_enum::NA)
 
virtual std::map< std::string, variant_typeevaluate (const ml_data &test_data, const std::string &evaluation_type="", bool with_prediction=false)
 
virtual std::map< std::string, variant_typeevaluate (const sframe &X, const sframe &y, const std::string &evaluation_type="", bool with_prediction=false)
 
virtual std::shared_ptr< sarray< flexible_type > > predict (const ml_data &test_data, const std::string &output_type="")
 
virtual std::shared_ptr< sarray< flexible_type > > predict (const sframe &X, const std::string &output_type="")
 
virtual std::shared_ptr< sarray< flexible_type > > extract_features (const sframe &X, ml_missing_value_action missing_value_action)
 
virtual sframe predict_topk (const sframe &test_data, const std::string &output_type="", size_t topk=5)
 
virtual sframe predict_topk (const ml_data &test_data, const std::string &output_type="", size_t topk=5)
 
virtual sframe classify (const ml_data &test_data, const std::string &output_type="")
 
virtual sframe classify (const sframe &X, const std::string &output_type="")
 
virtual gl_sarray fast_predict (const std::vector< flexible_type > &rows, const std::string &missing_value_action="error", const std::string &output_type="")
 
virtual gl_sframe fast_classify (const std::vector< flexible_type > &rows, const std::string &missing_value_action="error")
 
virtual void init (const sframe &X, const sframe &y, const sframe &valid_X=sframe(), const sframe &valid_y=sframe(), ml_missing_value_action mva=ml_missing_value_action::ERROR)
 
void set_evaluation_metric (std::vector< std::string > _metrics)
 
void set_tracking_metric (std::vector< std::string > _metrics)
 
void set_more_warnings (bool more_warnings)
 
std::map< std::string, flexible_typeget_train_stats () const
 
sframe impute_missing_columns_using_current_metadata (const sframe &X) const
 
ml_data construct_ml_data_using_current_metadata (const sframe &X, const sframe &y, ml_missing_value_action mva=ml_missing_value_action::ERROR) const
 
ml_data construct_ml_data_using_current_metadata (const sframe &X, ml_missing_value_action mva=ml_missing_value_action::ERROR) const
 
size_t num_features () const
 
size_t num_examples () const
 
size_t num_unpacked_features () const
 
std::vector< std::string > get_feature_names () const
 
std::string get_target_name () const
 
std::shared_ptr< ml_metadataget_ml_metadata () const
 
bool is_dense ()
 
std::vector< std::string > get_metrics () const
 
std::vector< std::string > get_tracking_metrics () const
 
std::string get_metric_display_name (const std::string &metric) const
 
void display_regression_training_summary (std::string model_display_name) const
 
void display_classifier_training_summary (std::string model_display_name, bool simple_mode=false) const
 
virtual bool support_missing_value () const
 
void api_train (gl_sframe data, const std::string &target, const variant_type &validation_data, const std::map< std::string, flexible_type > &_options)
 
gl_sarray api_predict (gl_sframe data, std::string missing_value_action, std::string output_type)
 
gl_sframe api_predict_topk (gl_sframe data, std::string missing_value_action, std::string output_type, size_t topk=5)
 
gl_sframe api_classify (gl_sframe data, std::string missing_value_action, std::string output_type)
 
variant_map_type api_evaluate (gl_sframe data, std::string missing_value_action, std::string metric, gl_sarray predictions=gl_sarray(), bool with_prediction=false)
 
gl_sarray api_extract_features (gl_sframe data, std::string missing_value_action)
 
std::vector< std::string > list_fields ()
 
const variant_typeget_value_from_state (std::string key)
 
const std::map< std::string, flexible_type > & get_current_options () const
 
std::map< std::string, flexible_typeget_default_options () const
 
const flexible_typeget_option_value (const std::string &name) const
 
const std::map< std::string, variant_type > & get_state () const
 
bool is_trained () const
 
void set_options (const std::map< std::string, flexible_type > &_options)
 
void add_or_update_state (const std::map< std::string, variant_type > &dict)
 
const std::vector< option_handling::option_info > & get_option_info () const
 
virtual const char * name ()=0
 
virtual const std::string & uid ()=0
 
void save_to_url (const std::string &url, const variant_map_type &side_data={})
 
void save_model_to_data (std::ostream &out)
 
const std::map< std::string, std::vector< std::string > > & list_functions ()
 
const std::vector< std::string > & list_get_properties ()
 
const std::vector< std::string > & list_set_properties ()
 
variant_type call_function (const std::string &function, variant_map_type argument)
 
variant_type get_property (const std::string &property)
 
variant_type set_property (const std::string &property, variant_map_type argument)
 
const std::string & get_docstring (const std::string &symbol)
 
virtual void perform_registration ()
 

Protected Member Functions

void register_defaults (const std::string &fnname, const variant_map_type &arguments)
 
void register_function (std::string fnname, const std::vector< std::string > &arguments, impl_fn fn)
 
void register_setter (const std::string &propname, impl_fn setfn)
 
void register_getter (const std::string &propname, impl_fn getfn)
 
void register_docstring (const std::pair< std::string, std::string > &fnname_docstring)
 

Protected Attributes

Eigen::Matrix< double, Eigen::Dynamic, 1 > coefs
 
size_t num_classes = 0
 
size_t num_coefficients = 0
 
std::map< std::string, variant_typestate
 

Detailed Description

Logistic regression model class definition.

Definition at line 35 of file logistic_regression.hpp.

Constructor & Destructor Documentation

◆ ~logistic_regression()

turi::supervised::logistic_regression::~logistic_regression ( )

Destructor. Make sure bad things don't happen

Member Function Documentation

◆ add_or_update_state()

void turi::ml_model_base::add_or_update_state ( const std::map< std::string, variant_type > &  dict)
inherited

Append the key value store of the model.

Parameters
[in]dictOptions (Key-Value pairs) to set

◆ api_classify()

gl_sframe turi::supervised::supervised_learning_model_base::api_classify ( gl_sframe  data,
std::string  missing_value_action,
std::string  output_type 
)
inherited

API interface through the unity server.

Run classification.

◆ api_evaluate()

variant_map_type turi::supervised::supervised_learning_model_base::api_evaluate ( gl_sframe  data,
std::string  missing_value_action,
std::string  metric,
gl_sarray  predictions = gl_sarray(),
bool  with_prediction = false 
)
inherited

API interface through the unity server.

Evaluate the model

◆ api_extract_features()

gl_sarray turi::supervised::supervised_learning_model_base::api_extract_features ( gl_sframe  data,
std::string  missing_value_action 
)
inherited

API interface through the unity server.

Extract features!

◆ api_predict()

gl_sarray turi::supervised::supervised_learning_model_base::api_predict ( gl_sframe  data,
std::string  missing_value_action,
std::string  output_type 
)
inherited

API interface through the unity server.

Run prediction.

◆ api_predict_topk()

gl_sframe turi::supervised::supervised_learning_model_base::api_predict_topk ( gl_sframe  data,
std::string  missing_value_action,
std::string  output_type,
size_t  topk = 5 
)
inherited

API interface through the unity server.

Run multiclass prediction.

◆ api_train()

void turi::supervised::supervised_learning_model_base::api_train ( gl_sframe  data,
const std::string &  target,
const variant_type validation_data,
const std::map< std::string, flexible_type > &  _options 
)
inherited

API interface through the unity server.

Train the model

◆ call_function()

variant_type turi::model_base::call_function ( const std::string &  function,
variant_map_type  argument 
)
inherited

Calls a user defined function.

◆ classify() [1/2]

virtual sframe turi::supervised::supervised_learning_model_base::classify ( const ml_data test_data,
const std::string &  output_type = "" 
)
virtualinherited

Make classification using a trained supervised_learning model.

Parameters
[in]XTest data (only independent variables)
[in]output_typeType of classifcation (future proof).
Returns
ret SFrame with "class" and probability (if applicable)
Note
Already assumes that data is of the right shape.

Reimplemented in turi::supervised::linear_svm.

◆ classify() [2/2]

virtual sframe turi::supervised::supervised_learning_model_base::classify ( const sframe X,
const std::string &  output_type = "" 
)
inlinevirtualinherited

Same as classify(ml_data), but takes SFrame as input.

Definition at line 361 of file supervised_learning.hpp.

◆ construct_ml_data_using_current_metadata() [1/2]

ml_data turi::supervised::supervised_learning_model_base::construct_ml_data_using_current_metadata ( const sframe X,
const sframe y,
ml_missing_value_action  mva = ml_missing_value_action::ERROR 
) const
inherited

Construct ml-data from the predictors and target using the current value of the metadata.

Parameters
[in]XPredictors
[in]ytarget
[in]new_optsAdditional options.
Returns
A constructed ml_data object

◆ construct_ml_data_using_current_metadata() [2/2]

ml_data turi::supervised::supervised_learning_model_base::construct_ml_data_using_current_metadata ( const sframe X,
ml_missing_value_action  mva = ml_missing_value_action::ERROR 
) const
inherited

Construct ml-data from the predictors using the current value of the metadata.

Parameters
[in]XPredictors
[in]new_optsAdditional options.
Returns
A constructed ml_data object

◆ display_classifier_training_summary()

void turi::supervised::supervised_learning_model_base::display_classifier_training_summary ( std::string  model_display_name,
bool  simple_mode = false 
) const
inherited

Display model training data summary for classifier.

Parameters
[in]model_display_nameName to be displayed

◆ display_regression_training_summary()

void turi::supervised::supervised_learning_model_base::display_regression_training_summary ( std::string  model_display_name) const
inherited

Display model training data summary for regression.

Parameters
[in]model_display_nameName to be displayed

◆ evaluate() [1/2]

virtual std::map<std::string, variant_type> turi::supervised::supervised_learning_model_base::evaluate ( const ml_data test_data,
const std::string &  evaluation_type = "",
bool  with_prediction = false 
)
virtualinherited

Evaluate the model.

Parameters
[in]test_dataTest data.
[in]evaluation_typeEvalution type.
Note
Already assumes that data is of the right shape. Test data must contain target column also.

Reimplemented in turi::supervised::xgboost::xgboost_model.

◆ evaluate() [2/2]

virtual std::map<std::string, variant_type> turi::supervised::supervised_learning_model_base::evaluate ( const sframe X,
const sframe y,
const std::string &  evaluation_type = "",
bool  with_prediction = false 
)
inlinevirtualinherited

Same as evaluate(ml_data), but take SFrame as input.

Definition at line 278 of file supervised_learning.hpp.

◆ export_to_coreml()

std::shared_ptr<coreml::MLModelWrapper> turi::supervised::logistic_regression::export_to_coreml ( )
overridevirtual

Export to CoreML.

Implements turi::supervised::supervised_learning_model_base.

◆ extract_features()

virtual std::shared_ptr<sarray<flexible_type> > turi::supervised::supervised_learning_model_base::extract_features ( const sframe X,
ml_missing_value_action  missing_value_action 
)
inlinevirtualinherited

Extract features!

Reimplemented in turi::supervised::xgboost::xgboost_model.

Definition at line 309 of file supervised_learning.hpp.

◆ fast_classify()

virtual gl_sframe turi::supervised::supervised_learning_model_base::fast_classify ( const std::vector< flexible_type > &  rows,
const std::string &  missing_value_action = "error" 
)
virtualinherited

Fast path predictions given a row of flexible_types

Parameters
[in]rowsList of rows (each row is a flex_dict)
[in]output_typeOutput type.

Reimplemented in turi::supervised::linear_svm.

◆ fast_predict()

virtual gl_sarray turi::supervised::supervised_learning_model_base::fast_predict ( const std::vector< flexible_type > &  rows,
const std::string &  missing_value_action = "error",
const std::string &  output_type = "" 
)
virtualinherited

Fast path predictions given a row of flexible_types.

Parameters
[in]rowsList of rows (each row is a flex_dict)
[in]missing_value_actionMissing value action string
[in]output_typeOutput type.

Reimplemented in turi::supervised::xgboost::xgboost_model.

◆ fast_predict_topk()

gl_sframe turi::supervised::logistic_regression::fast_predict_topk ( const std::vector< flexible_type > &  rows,
const std::string &  missing_value_action = "error",
const std::string &  output_type = "",
const size_t  topk = 5 
)
overridevirtual

Fast path predictions given a row of flexible_types.

Parameters
[in]rowsList of rows (each row is a flex_dict)
[in]output_typeOutput type.

Reimplemented from turi::supervised::supervised_learning_model_base.

◆ get_coefficients()

void turi::supervised::logistic_regression::get_coefficients ( DenseVector &  _coefs) const
inline

Get coefficients for a trained model.

Definition at line 168 of file logistic_regression.hpp.

◆ get_current_options()

const std::map<std::string, flexible_type>& turi::ml_model_base::get_current_options ( ) const
inherited

Get current options.

Returns
Dictionary containing current options.

Python side interface

Interfaces with the get_current_options function in the Python side.

◆ get_default_options()

std::map<std::string, flexible_type> turi::ml_model_base::get_default_options ( ) const
inherited

Get default options.

Returns
Dictionary with default options.

Python side interface

Interfaces with the get_default_options function in the Python side.

◆ get_docstring()

const std::string& turi::model_base::get_docstring ( const std::string &  symbol)
inherited

Returns the toolkit documentation for a function or property.

◆ get_feature_names()

std::vector<std::string> turi::supervised::supervised_learning_model_base::get_feature_names ( ) const
inherited

Get names of predictor variables.

Returns
Names of features (Vector of string names).

◆ get_metadata_mapping()

std::vector<std::vector<flexible_type> > turi::supervised::supervised_learning_model_base::get_metadata_mapping ( )
inherited

Get metadata mapping.

◆ get_metric_display_name()

std::string turi::supervised::supervised_learning_model_base::get_metric_display_name ( const std::string &  metric) const
inherited

Get metric display name.

◆ get_metrics()

std::vector<std::string> turi::supervised::supervised_learning_model_base::get_metrics ( ) const
inherited

Get metrics strings.

◆ get_ml_metadata()

std::shared_ptr<ml_metadata> turi::supervised::supervised_learning_model_base::get_ml_metadata ( ) const
inlineinherited

Get ml_metadata.

Returns
Get the ml_metadata.

Definition at line 564 of file supervised_learning.hpp.

◆ get_option_info()

const std::vector<option_handling::option_info>& turi::ml_model_base::get_option_info ( ) const
inherited

Returns the option information struct for each of the set parameters.

◆ get_option_value()

const flexible_type& turi::ml_model_base::get_option_value ( const std::string &  name) const
inherited

Returns the value of an option. Throws an error if the option does not exist.

Parameters
[in]nameName of the option to get.

◆ get_property()

variant_type turi::model_base::get_property ( const std::string &  property)
inherited

Reads a property.

◆ get_state()

const std::map<std::string, variant_type>& turi::ml_model_base::get_state ( ) const
inherited

Get model.

Returns
Model map.

◆ get_target_name()

std::string turi::supervised::supervised_learning_model_base::get_target_name ( ) const
inherited

Get name of the target column.

Returns
Names of target.

◆ get_tracking_metrics()

std::vector<std::string> turi::supervised::supervised_learning_model_base::get_tracking_metrics ( ) const
inherited

Get tracking metrics strings.

◆ get_train_stats()

std::map<std::string, flexible_type> turi::supervised::supervised_learning_model_base::get_train_stats ( ) const
inherited

Get training stats.

Returns
The training stats map.

Python side interface

The dictionary returned to the user can be transfered as is to the python side. You MUST use this to return a dictionary to the object.

◆ get_value_from_state()

const variant_type& turi::ml_model_base::get_value_from_state ( std::string  key)
inherited

Returns the value of a particular key from the state.

Returns
Value of a key model_base for details.

Python side interface

From the python side, this is interfaced with the get() function or the [] operator in python.

◆ get_version()

size_t turi::supervised::logistic_regression::get_version ( ) const
overridevirtual

Gets the model version number

Reimplemented from turi::model_base.

◆ impute_missing_columns_using_current_metadata()

sframe turi::supervised::supervised_learning_model_base::impute_missing_columns_using_current_metadata ( const sframe X) const
inherited

Impute missing columns with 'None' values.

Parameters
[in]XPredictors
Returns
An SFrame with 'None' written to all columns that are missing.

◆ init()

virtual void turi::supervised::supervised_learning_model_base::init ( const sframe X,
const sframe y,
const sframe valid_X = sframe(),
const sframe valid_y = sframe(),
ml_missing_value_action  mva = ml_missing_value_action::ERROR 
)
virtualinherited

Methods with already meaningful default implementations.

Init the model with the data.

Parameters
[in]XPredictors
[in]ytarget

Python side interface

NA.

◆ init_options()

void turi::supervised::logistic_regression::init_options ( const std::map< std::string, flexible_type > &  _options)
overridevirtual

Initialize the options.

Parameters
[in]_optionsOptions to set

Reimplemented from turi::ml_model_base.

◆ is_classifier()

bool turi::supervised::logistic_regression::is_classifier ( ) const
inlineoverridevirtual

Returns true if the model is a classifier.

Implements turi::supervised::supervised_learning_model_base.

Definition at line 92 of file logistic_regression.hpp.

◆ is_dense()

bool turi::supervised::supervised_learning_model_base::is_dense ( )
inlineinherited

Returns true if the model is a classifier.

Definition at line 576 of file supervised_learning.hpp.

◆ is_trained()

bool turi::ml_model_base::is_trained ( ) const
inherited

Is this model trained.

Returns
True if already trained.

◆ list_fields()

std::vector<std::string> turi::ml_model_base::list_fields ( )
inherited

Methods with already meaningful default implementations.

Lists all the keys accessible in the "model" map.

Returns
List of keys in the model map. model_base for details.

Python side interface

This is the function that the list_fields should call in python.

◆ list_functions()

const std::map<std::string, std::vector<std::string> >& turi::model_base::list_functions ( )
inherited

Lists all the registered functions. Returns a map of function name to array of argument names for the function.

◆ list_get_properties()

const std::vector<std::string>& turi::model_base::list_get_properties ( )
inherited

Lists all the get-table properties of the class.

◆ list_set_properties()

const std::vector<std::string>& turi::model_base::list_set_properties ( )
inherited

Lists all the set-table properties of the class.

◆ load_version()

void turi::supervised::logistic_regression::load_version ( turi::iarchive iarc,
size_t  version 
)
overridevirtual

Load the object

Reimplemented from turi::model_base.

◆ model_specific_init()

void turi::supervised::logistic_regression::model_specific_init ( const ml_data data,
const ml_data valid_data 
)
overridevirtual

Initialize things that are specific to your model.

Parameters
[in]dataML-Data object created by the init function.

Reimplemented from turi::supervised::supervised_learning_model_base.

◆ name()

virtual const char* turi::model_base::name ( )
pure virtualinherited

Returns the name of the toolkit class, as exposed to client code. For example, the Python proxy for this instance will have a type with this name.

Note: this function is typically overridden using the BEGIN_CLASS_MEMBER_REGISTRATION macro.

◆ num_examples()

size_t turi::supervised::supervised_learning_model_base::num_examples ( ) const
inherited

Get the number of examples in the model

Returns
Number of examples.

◆ num_features()

size_t turi::supervised::supervised_learning_model_base::num_features ( ) const
inherited

Get the number of feature columns in the model

Returns
Number of features.

◆ num_unpacked_features()

size_t turi::supervised::supervised_learning_model_base::num_unpacked_features ( ) const
inherited

Get the number of features in the model (unpacked)

Returns
Number of features.

◆ perform_registration()

virtual void turi::model_base::perform_registration ( )
virtualinherited

Declare the base registration function. This class has to be handled specially; the macros don't work here due to the override declarations.

Reimplemented in turi::model_proxy.

◆ predict() [1/2]

virtual std::shared_ptr<sarray<flexible_type> > turi::supervised::supervised_learning_model_base::predict ( const ml_data test_data,
const std::string &  output_type = "" 
)
virtualinherited

Make predictions using a trained supervised_learning model.

Parameters
[in]test_XTest data (only independent variables)
[in]output_typeType of prediction.
Returns
ret Shared pointer to an SArray containing predicions.
Note
Already assumes that data is of the right shape.

Reimplemented in turi::supervised::xgboost::xgboost_model.

◆ predict() [2/2]

virtual std::shared_ptr<sarray<flexible_type> > turi::supervised::supervised_learning_model_base::predict ( const sframe X,
const std::string &  output_type = "" 
)
inlinevirtualinherited

Same as predict(ml_data), but takes SFrame as input.

Definition at line 299 of file supervised_learning.hpp.

◆ predict_single_example() [1/3]

flexible_type turi::supervised::logistic_regression::predict_single_example ( const DenseVector &  x,
const prediction_type_enum &  output_type = prediction_type_enum::NA 
)
overridevirtual

Predict for a single example.

Parameters
[in]xSingle example.
[in]output_typeType of prediction.
Returns
Prediction for a single example.

Reimplemented from turi::supervised::supervised_learning_model_base.

◆ predict_single_example() [2/3]

flexible_type turi::supervised::logistic_regression::predict_single_example ( const SparseVector &  x,
const prediction_type_enum &  output_type = prediction_type_enum::NA 
)
overridevirtual

Predict for a single example.

Parameters
[in]xSingle example.
[in]output_typeType of prediction.
Returns
Prediction for a single example.

Reimplemented from turi::supervised::supervised_learning_model_base.

◆ predict_single_example() [3/3]

virtual flexible_type turi::supervised::supervised_learning_model_base::predict_single_example ( const ml_data_iterator it,
const prediction_type_enum &  output_type = prediction_type_enum::NA 
)
inlinevirtualinherited

Methods with default implementations but are in-flux during the

Trees and NeuralNetworks integration

Predict for a single example.

Parameters
[in]xSingle example.
[in]output_typeType of prediction.
Returns
Prediction for a single example.

Definition at line 226 of file supervised_learning.hpp.

◆ predict_topk() [1/2]

virtual sframe turi::supervised::supervised_learning_model_base::predict_topk ( const sframe test_data,
const std::string &  output_type = "",
size_t  topk = 5 
)
inlinevirtualinherited

Make multiclass predictions using a trained supervised_learning model.

Parameters
[in]test_XTest data (only independent variables)
[in]output_typeType of prediction.
[in]topkNumber of classes to return.
Returns
ret SFrame containing {row_id, class, output_type}.
Note
Already assumes that data is of the right shape.
Default throws error, model supporting this method should override this function.

Definition at line 326 of file supervised_learning.hpp.

◆ predict_topk() [2/2]

virtual sframe turi::supervised::supervised_learning_model_base::predict_topk ( const ml_data test_data,
const std::string &  output_type = "",
size_t  topk = 5 
)
virtualinherited

Make multiclass predictions using a trained supervised_learning model.

Parameters
[in]test_XTest data (only independent variables)
[in]output_typeType of prediction.
[in]topkNumber of classes to return.
Returns
ret SFrame containing {row_id, class, output_type}.
Note
Already assumes that data is of the right shape.

Reimplemented in turi::supervised::xgboost::xgboost_model.

◆ register_defaults()

void turi::model_base::register_defaults ( const std::string &  fnname,
const variant_map_type &  arguments 
)
protectedinherited

Registers default argument values

◆ register_docstring()

void turi::model_base::register_docstring ( const std::pair< std::string, std::string > &  fnname_docstring)
protectedinherited

Adds a docstring for the specified function or property name.

◆ register_function()

void turi::model_base::register_function ( std::string  fnname,
const std::vector< std::string > &  arguments,
impl_fn  fn 
)
protectedinherited

Adds a function with the specified name, and argument list.

◆ register_getter()

void turi::model_base::register_getter ( const std::string &  propname,
impl_fn  getfn 
)
protectedinherited

Adds a property getter with the specified name.

◆ register_setter()

void turi::model_base::register_setter ( const std::string &  propname,
impl_fn  setfn 
)
protectedinherited

Adds a property setter with the specified name.

◆ save_impl()

void turi::supervised::logistic_regression::save_impl ( turi::oarchive oarc) const
overridevirtual

Serialize the object.

Reimplemented from turi::model_base.

◆ save_model_to_data()

void turi::model_base::save_model_to_data ( std::ostream &  out)
inherited

Save a toolkit class to a data stream.

◆ save_to_url()

void turi::model_base::save_to_url ( const std::string &  url,
const variant_map_type &  side_data = {} 
)
inherited

Save a toolkit class to disk.

Parameters
urlThe destination url to store the class.
sidedataAny additional side information

◆ set_coefs()

void turi::supervised::logistic_regression::set_coefs ( const DenseVector &  _coefs)
overridevirtual

Setter for model coefficieints.

Reimplemented from turi::supervised::supervised_learning_model_base.

◆ set_default_evaluation_metric()

void turi::supervised::logistic_regression::set_default_evaluation_metric ( )
inlineoverridevirtual

Set the default evaluation metric during model evaluation..

Reimplemented from turi::supervised::supervised_learning_model_base.

Definition at line 62 of file logistic_regression.hpp.

◆ set_default_tracking_metric()

void turi::supervised::logistic_regression::set_default_tracking_metric ( )
inlineoverridevirtual

Set the default evaluation metric for progress tracking.

Reimplemented from turi::supervised::supervised_learning_model_base.

Definition at line 78 of file logistic_regression.hpp.

◆ set_evaluation_metric()

void turi::supervised::supervised_learning_model_base::set_evaluation_metric ( std::vector< std::string >  _metrics)
inlineinherited

Set the evaluation metric. Set to RMSE by default.

Definition at line 439 of file supervised_learning.hpp.

◆ set_more_warnings()

void turi::supervised::supervised_learning_model_base::set_more_warnings ( bool  more_warnings)
inlineinherited

Set the Extra Warnings output. These warnings include telling the user about low-variance features, etc...

Definition at line 455 of file supervised_learning.hpp.

◆ set_options()

void turi::ml_model_base::set_options ( const std::map< std::string, flexible_type > &  _options)
inherited

Set one of the options in the algorithm.

The value are checked with the requirements given by the option instance.

Parameters
[in]nameName of the option.
[in]valueValue for the option.

◆ set_property()

variant_type turi::model_base::set_property ( const std::string &  property,
variant_map_type  argument 
)
inherited

Sets a property. The new value of the property should appear in the argument map under the key "value".

◆ set_tracking_metric()

void turi::supervised::supervised_learning_model_base::set_tracking_metric ( std::vector< std::string >  _metrics)
inlineinherited

Set the evaluation metric. Set to RMSE by default.

Definition at line 447 of file supervised_learning.hpp.

◆ support_missing_value()

virtual bool turi::supervised::supervised_learning_model_base::support_missing_value ( ) const
inlinevirtualinherited

Returns true if the model can handle missing value

Reimplemented in turi::supervised::xgboost::xgboost_model.

Definition at line 628 of file supervised_learning.hpp.

◆ train()

void turi::supervised::logistic_regression::train ( )
overridevirtual

Train a regression model.

Implements turi::supervised::supervised_learning_model_base.

◆ uid()

virtual const std::string& turi::model_base::uid ( )
pure virtualinherited

Returns a unique identifier for the toolkit class. It can be any unique ID. The UID is only used at runtime (to determine the concrete type of an arbitrary model_base instance) and is never stored.

Note: this function is typically overridden using the BEGIN_CLASS_MEMBER_REGISTRATION macro.

Implemented in turi::model_proxy.

Member Data Documentation

◆ coefs

Eigen::Matrix<double, Eigen::Dynamic,1> turi::supervised::logistic_regression::coefs
protected

Coefs

Definition at line 42 of file logistic_regression.hpp.

◆ num_classes

size_t turi::supervised::logistic_regression::num_classes = 0
protected

fast access: num classes

Definition at line 45 of file logistic_regression.hpp.

◆ num_coefficients

size_t turi::supervised::logistic_regression::num_coefficients = 0
protected

fast access: num coefs

Definition at line 46 of file logistic_regression.hpp.

◆ state

std::map<std::string, variant_type> turi::ml_model_base::state
protectedinherited

All things python

Definition at line 206 of file ml_model.hpp.


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