MetaInfoExtractor< MLAlgorithm, MT, PT, WT > Class Template Reference

MetaInfoExtractor is a tool for extracting meta information about a given machine learning algorithm. More...

Public Types

using PredictionsType = typename Select< TF1, TF2, TF3, TF4, TF5 >::Type::PredictionsType
 The type of predictions used in MLAlgorithm. More...

 
using WeightsType = typename Select< WTF1, WTF2, WTF3, WTF4, WTF5 >::Type::WeightsType
 The type of weights used in MLAlgorithm. More...

 

Static Public Attributes

static const bool IsSupported = !std::is_same<PredictionsType, void*>::value
 An indication whether PredictionsType has been identified (i.e. More...

 
static const bool SupportsWeights = !std::is_same<WeightsType, void*>::value
 An indication whether MLAlgorithm supports weighted learning. More...

 
static const bool TakesDatasetInfo = Selects<TF5>::value
 An indication whether MLAlgorithm takes a data::DatasetInfo parameter. More...

 
static const bool TakesNumClasses = Selects<TF4, TF5>::value
 An indication whether MLAlgorithm takes the numClasses (size_t) parameter. More...

 

Detailed Description


template<typename MLAlgorithm, typename MT = arma::mat, typename PT = arma::Row<size_t>, typename WT = arma::rowvec>
class mlpack::cv::MetaInfoExtractor< MLAlgorithm, MT, PT, WT >

MetaInfoExtractor is a tool for extracting meta information about a given machine learning algorithm.

It can be used to automatically extract the type of predictions and weights (if weighted learning is supported), whether the machine learning algorithm takes a DatasetInfo parameter or a numClasses parameter.

The following assumptions are made about the machine learning algorithm.

  1. All needed information can be extracted from signatures of Train methods.
  2. The machine learning algorithm contains either only non-templated Train methods or only templated ones.
  3. Train methods that can be used for extraction of needed information should be distinguishable by a number of arguments (for more information read discussion in https://github.com/mlpack/mlpack/issues/929).
  4. If weighted learning is supported, passing weights is an option rather than a requirement.
Template Parameters
MLAlgorithmA machine learning algorithm to investigate.
MTThe type of data.
PTThe type of predictions (should be passed when the predictions type is a template parameter in Train methods of MLAlgorithm).
WTThe type of weights (should be passed when weighted learning is supported, and the weights type is a template parameter in Train methods of MLAlgorithm).

Definition at line 272 of file meta_info_extractor.hpp.

Member Typedef Documentation

◆ PredictionsType

using PredictionsType = typename Select<TF1, TF2, TF3, TF4, TF5>::Type::PredictionsType

The type of predictions used in MLAlgorithm.

It is equal to void* if the extraction fails.

Definition at line 319 of file meta_info_extractor.hpp.

◆ WeightsType

using WeightsType = typename Select<WTF1, WTF2, WTF3, WTF4, WTF5>::Type::WeightsType

The type of weights used in MLAlgorithm.

It is equal to void* if the extraction fails.

Definition at line 326 of file meta_info_extractor.hpp.

Member Data Documentation

◆ IsSupported

const bool IsSupported = !std::is_same<PredictionsType, void*>::value
static

An indication whether PredictionsType has been identified (i.e.

MLAlgorithm is supported by MetaInfoExtractor).

Definition at line 332 of file meta_info_extractor.hpp.

◆ SupportsWeights

const bool SupportsWeights = !std::is_same<WeightsType, void*>::value
static

An indication whether MLAlgorithm supports weighted learning.

Definition at line 337 of file meta_info_extractor.hpp.

◆ TakesDatasetInfo

const bool TakesDatasetInfo = Selects<TF5>::value
static

An indication whether MLAlgorithm takes a data::DatasetInfo parameter.

Definition at line 342 of file meta_info_extractor.hpp.

◆ TakesNumClasses

const bool TakesNumClasses = Selects<TF4, TF5>::value
static

An indication whether MLAlgorithm takes the numClasses (size_t) parameter.

Definition at line 347 of file meta_info_extractor.hpp.


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