Ultra 0.9.4
Loading...
Searching...
No Matches
ultra::src::reg_oracle_adaptor< O > Class Template Referencefinal

#include <oracle.h>

Inheritance diagram for ultra::src::reg_oracle_adaptor< O >:
ultra::src::basic_oracle

Public Member Functions

 reg_oracle_adaptor (O)
value_t operator() (const std::vector< value_t > &) const override
bool is_valid () const override
std::string name (const value_t &v) const override

Detailed Description

template<RegressionPredictor O>
class ultra::src::reg_oracle_adaptor< O >

Adapts a regression predictor to the basic_oracle interface.

Template Parameters
Opredictor type

This adaptor allows any user-defined regression predictor to be used as a basic_oracle. The wrapped predictor must satisfy RegressionPredictor, i.e. be callable with an input example and return a value_t.

Note
Calling tag() on this adaptor is invalid and results in an exception.
The adaptor is intentionally non-serializable.

Constructor & Destructor Documentation

◆ reg_oracle_adaptor()

template<RegressionPredictor O>
reg_oracle_adaptor::reg_oracle_adaptor ( O oracle)
explicit
Parameters
[in]oraclepredictor instance to adapt

Member Function Documentation

◆ is_valid()

template<RegressionPredictor O>
bool ultra::src::reg_oracle_adaptor< O >::is_valid ( ) const
inlinenodiscardoverridevirtual

This adaptor does not impose additional validity constraints beyond those of the underlying predictor, therefore it always returns true.

Implements ultra::src::basic_oracle.

◆ name()

template<RegressionPredictor O>
std::string reg_oracle_adaptor::name ( const value_t & v) const
nodiscardoverridevirtual

Returns a string representation of the predicted value.

Parameters
[in]vnumeric prediction
Returns
string representation of v

Implements ultra::src::basic_oracle.

◆ operator()()

template<RegressionPredictor O>
value_t reg_oracle_adaptor::operator() ( const std::vector< value_t > & x) const
nodiscardoverridevirtual

Returns the predicted value for the input example.

Parameters
[in]xinput example
Returns
predicted value

This function forwards the call to the underlying regression predictor.

Implements ultra::src::basic_oracle.


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