![]() |
Ultra 0.9.4
|
#include <oracle.h>
Public Member Functions | |
| class_oracle_adaptor (O, std::vector< std::string >={}) | |
| bool | is_valid () const override |
| classification_result | tag (const std::vector< value_t > &) const override |
| Public Member Functions inherited from ultra::src::basic_class_oracle | |
| value_t | operator() (const std::vector< value_t > &) const final |
| Returns the predicted class label. | |
| std::string | name (const value_t &) const final |
| Returns the class name, falling back to a numeric name for unknown IDs. | |
Additional Inherited Members | |
| Protected Member Functions inherited from ultra::src::basic_class_oracle | |
| basic_class_oracle (std::vector< std::string >={}) | |
| bool | load_names (std::istream &) |
| Loads the class names, accepting a zero count for omitted names. | |
| bool | save_names (std::ostream &) const |
| Saves a count followed by one class name per line. | |
| Static Protected Member Functions inherited from ultra::src::basic_class_oracle | |
| static std::vector< std::string > | class_names (const dataframe &) |
| Collects the class names from the training set. | |
Adapts a classification predictor to the basic_oracle interface.
| O | predictor type |
This adaptor allows any user-defined classification predictor to be used wherever a basic_oracle is required, without inheritance or dynamic polymorphism.
The wrapped predictor must satisfy ClassificationPredictor; the numeric output is derived from tag() by returning the predicted class label.
|
explicit |
| [in] | oracle | predictor instance to adapt |
| [in] | names | optional class names used for human-readable output |
|
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.
|
nodiscardoverridevirtual |
Returns the classification result for the input example.
| [in] | x | input example |
This function forwards the call to the underlying predictor.
Implements ultra::src::basic_oracle.