#include <SDBVMat.h>
Inheritance diagram for PLearn::SDBVMFieldDiscrete:
Public Member Functions | |
SDBVMFieldDiscrete (SDBVMSource source, int num_classes=0, real missing_values_mapping=MISSING_VALUE, SDBVMOutputCoding oc=SDBVMNumeric, VMField::FieldType ft=VMField::DiscrGeneral) | |
SDBVMFieldDiscrete (SDBVMSource source, SDBVMOutputCoder *oc, int num_classes=0, real missing_values_mapping=MISSING_VALUE, VMField::FieldType ft=VMField::DiscrGeneral) | |
Version of the constructor that takes an OutputCoder object. | |
virtual void | convertField (const SDBWithStats &sdb, const Row &row, const Vec &output) const |
virtual int | fieldWidth () const |
Width that the field occupies in the VMat. | |
virtual SDBVMOutputCoding | getOutputCoding () const |
virtual real | getDiscreteValue (const SDBWithStats &sdb, const Row &row) const =0 |
int | getNumClasses () const |
Return the number of possible discrete values from 0 to N-1. | |
void | setNumClasses (int) |
Call this function to set the number of classes (don't play with num_classes_ directly ==> important). | |
void | setOutputCoder (SDBVMOutputCoder *oc) |
Set the currently-active output coder (captures ownership of passed object). | |
Protected Attributes | |
int | num_classes_ |
must be >0 for one-hot coding | |
PSDBVMOutputCoder | output_coder_ |
perform actual formatting | |
Private Types | |
typedef SDBVMFieldSource1 | inherited |
Definition at line 604 of file SDBVMat.h.
|
Reimplemented from PLearn::SDBVMFieldSource1. Reimplemented in PLearn::SDBVMFieldDateGreater, PLearn::SDBVMFieldCodeAsIs, PLearn::SDBVMFieldRemapReals, PLearn::SDBVMFieldRemapStrings, PLearn::SDBVMFieldRemapIntervals, and PLearn::SDBVMFieldMultiDiscrete. Definition at line 606 of file SDBVMat.h. Referenced by SDBVMFieldDiscrete(). |
|
All constructors now specify the number of classes (between 0 and n-1), and whether one_hot output coding is desired (true) or direct integer codes (false, the default). By default, num_classes is not known at construction time, and must be set by derived classes. A remapping for missing values can also be provided. Definition at line 588 of file SDBVMat.cc. References inherited, and output_coder_. |
|
Version of the constructor that takes an OutputCoder object.
Definition at line 597 of file SDBVMat.cc. References output_coder_. |
|
This function is implemented as a call to a virtual function getDiscreteValue(), followed by a call to setOutput of the OutputCoder. Implements PLearn::SDBVMField. Reimplemented in PLearn::SDBVMFieldDateGreater. Definition at line 605 of file SDBVMat.cc. References getDiscreteValue(), output_coder_, and PLearn::Vec. |
|
Width that the field occupies in the VMat.
Implements PLearn::SDBVMField. Reimplemented in PLearn::SDBVMFieldDateGreater. Definition at line 612 of file SDBVMat.cc. References output_coder_. |
|
This function must be overridden in derived classes to get the correctly-mapped discrete value obtained from the SDB. The semantics prescribe missing values to be remapped to missing_values_mapping_. Implemented in PLearn::SDBVMFieldDateGreater, PLearn::SDBVMFieldCodeAsIs, PLearn::SDBVMFieldRemapReals, PLearn::SDBVMFieldRemapStrings, PLearn::SDBVMFieldRemapIntervals, and PLearn::SDBVMFieldMultiDiscrete. Referenced by convertField(). |
|
Return the number of possible discrete values from 0 to N-1.
|
|
Reimplemented from PLearn::SDBVMField. Definition at line 617 of file SDBVMat.cc. References output_coder_, and PLearn::SDBVMOutputCoding. |
|
Call this function to set the number of classes (don't play with num_classes_ directly ==> important).
Definition at line 622 of file SDBVMat.cc. References num_classes_, and output_coder_. |
|
Set the currently-active output coder (captures ownership of passed object).
|
|
must be >0 for one-hot coding
Definition at line 657 of file SDBVMat.h. Referenced by setNumClasses(). |
|
perform actual formatting
Definition at line 658 of file SDBVMat.h. Referenced by convertField(), fieldWidth(), getOutputCoding(), SDBVMFieldDiscrete(), and setNumClasses(). |