#include <RealMapping.h>
Inheritance diagram for PLearn::RealMapping:
Public Types | |
typedef pair< RealRange, real > | single_mapping_t |
typedef TVec< single_mapping_t > | ordered_mapping_t |
typedef map< RealRange, real > | mapping_t |
typedef mapping_t::iterator | iterator |
typedef mapping_t::const_iterator | const_iterator |
typedef Object | inherited |
Public Member Functions | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual RealMapping * | deepCopy (CopiesMap &copies) const |
RealMapping () | |
int | size () const |
int | length () const |
void | clear () |
Removes all entries in mapping. Does not change other params. | |
void | buildOrderedMapping () |
bool | checkConsistency () |
void | removeMapping (const RealRange &range) |
void | removeMapping (real x) |
void | addMapping (const RealRange &range, real val) |
void | setMappingForMissing (real what_missing_mapsto) |
Set mapping for missing value (by default it maps to MISSING_VALUE). | |
void | setMappingForOther (real what_other_mapsto) |
Set mapping for any other value (by default it is kept as is). | |
void | keepOtherAsIs () |
real | map (real val) const |
int | binnumber (real val) const |
void | transform (const Vec &v) const |
pair< RealRange, real > | lastMapping () |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
void | erase (iterator it) |
bool | operator== (const RealMapping &rm) const |
virtual void | print (ostream &out) const |
virtual void | write (ostream &out) const |
virtual void | read (istream &in) |
real | maxMappedToValue () |
Vec | getCutPoints () const |
If all ranges in the mapping are consecutive, return the cut points between different ranges. | |
Static Public Member Functions | |
string | _classname_ () |
OptionList & | _getOptionList_ () |
Object * | _new_instance_for_typemap_ () |
bool | _isa_ (Object *o) |
void | _static_initialize_ () |
Public Attributes | |
mapping_t | mapping |
ordered_mapping_t | o_mapping |
real | missing_mapsto |
bool | keep_other_as_is |
real | other_mapsto |
Static Public Attributes | |
StaticInitializer | _static_initializer_ |
Static Protected Member Functions | |
void | declareOptions (OptionList &ol) |
redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down) |
|
Definition at line 134 of file RealMapping.h. |
|
Reimplemented from PLearn::Object. Definition at line 145 of file RealMapping.h. |
|
Definition at line 133 of file RealMapping.h. Referenced by buildOrderedMapping(). |
|
Definition at line 132 of file RealMapping.h. |
|
Definition at line 131 of file RealMapping.h. |
|
Definition at line 130 of file RealMapping.h. Referenced by PLearn::operator<(). |
|
Definition at line 148 of file RealMapping.h. References MISSING_VALUE. |
|
Reimplemented from PLearn::Object. Definition at line 52 of file RealMapping.cc. |
|
Reimplemented from PLearn::Object. Definition at line 52 of file RealMapping.cc. |
|
Reimplemented from PLearn::Object. Definition at line 52 of file RealMapping.cc. |
|
Reimplemented from PLearn::Object. Definition at line 52 of file RealMapping.cc. |
|
Reimplemented from PLearn::Object. Definition at line 52 of file RealMapping.cc. |
|
Definition at line 169 of file RealMapping.cc. Referenced by PLearn::StatsCollector::getAllValuesMapping(), PLearn::StatsCollector::getBinMapping(), and read(). |
|
Definition at line 214 of file RealMapping.h. |
|
Definition at line 212 of file RealMapping.h. Referenced by buildOrderedMapping(). |
|
Definition at line 182 of file RealMapping.cc. References PLearn::is_missing(), mapping, and val. |
|
Definition at line 147 of file RealMapping.cc. References PLearn::TVec< T >::begin(), begin(), PLearn::TVec< T >::end(), end(), iterator, o_mapping, PLearn::TVec< T >::push_back(), and PLearn::TVec< T >::resize(). |
|
Definition at line 321 of file RealMapping.cc. References mapping, and PLearn::max(). |
|
Reimplemented from PLearn::Object. Definition at line 52 of file RealMapping.cc. |
|
Removes all entries in mapping. Does not change other params.
Definition at line 158 of file RealMapping.h. Referenced by read(). |
|
redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down) ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); } Reimplemented from PLearn::Object. Definition at line 138 of file RealMapping.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
Reimplemented from PLearn::Object. Definition at line 52 of file RealMapping.cc. |
|
Definition at line 218 of file RealMapping.h. |
|
Definition at line 216 of file RealMapping.h. Referenced by buildOrderedMapping(). |
|
Definition at line 220 of file RealMapping.h. |
|
If all ranges in the mapping are consecutive, return the cut points between different ranges. e.g.: [0,1[ [1, 5[ [5, 10] ]10, 15]--> <0,1,5,10,15>. Definition at line 310 of file RealMapping.cc. References PLearn::TVec< T >::first(), length(), and mapping. |
|
Reimplemented from PLearn::Object. Definition at line 52 of file RealMapping.cc. |
|
Definition at line 192 of file RealMapping.h. |
|
Definition at line 204 of file RealMapping.h. Referenced by PLearn::StatsCollector::getBinMapping(). |
|
Definition at line 155 of file RealMapping.h. Referenced by PLearn::ConditionalStatsCollector::findrange(), and getCutPoints(). |
|
Definition at line 155 of file RealMapping.cc. References PLearn::is_missing(), keep_other_as_is, mapping, missing_mapsto, other_mapsto, and val. Referenced by PLearn::ConditionalStatsCollector::findrange(), and transform(). |
|
Definition at line 127 of file RealMapping.cc. References mapping, and PLearn::max(). |
|
Definition at line 114 of file RealMapping.cc. References keep_other_as_is, mapping, missing_mapsto, other_mapsto, and PLearn::rm(). |
|
Prints a human-readable, short (not necessarily complete) description of this object instance (default prints info()). This is what is called by operator<< on Object Reimplemented from PLearn::Object. Definition at line 206 of file RealMapping.cc. References PLearn::endl(), PLearn::is_missing(), keep_other_as_is, mapping, missing_mapsto, and other_mapsto. |
|
DEPRECATED (use the declareOption / build_ mecanism instead, that provides automatic serialization) The read method is the counterpart of the write method. It should be able to reconstruct an object that has been previously written with the write method. The current implementation automatically decides whether to call newread() (which is based on the new declareOptions/build mechanism) or oldread() for backward compatibility (if the header is of the form <classname>). Reimplemented from PLearn::Object. Definition at line 227 of file RealMapping.cc. References addMapping(), clear(), PLearn::PStream::get(), keep_other_as_is, missing_mapsto, MISSING_VALUE, PLearn::peekAfterSkipBlanks(), PLERROR, PLearn::RealRange::read(), PLearn::readFooter(), PLearn::readHeader(), PLearn::removeblanks(), setMappingForMissing(), setMappingForOther(), PLearn::upperstring(), val, and PLearn::ws(). |
|
Definition at line 173 of file RealMapping.h. References PLWARNING, PLearn::RealRange::RealRange(), and x. |
|
Definition at line 164 of file RealMapping.h. References PLWARNING. Referenced by PLearn::StatsCollector::getBinMapping(). |
|
Set mapping for missing value (by default it maps to MISSING_VALUE).
Definition at line 185 of file RealMapping.h. Referenced by read(). |
|
Set mapping for any other value (by default it is kept as is).
Definition at line 189 of file RealMapping.h. Referenced by PLearn::StatsCollector::getBinMapping(), and read(). |
|
Definition at line 154 of file RealMapping.h. Referenced by PLearn::StatsCollector::getBinMapping(). |
|
Definition at line 195 of file RealMapping.cc. References PLearn::TVec< T >::data(), PLearn::TVec< T >::length(), map(), and PLearn::Vec. |
|
DEPRECATED (use the declareOption / build_ mecanism instead, that provides automatic serialization) The write method should write a complete description of the object to the given stream, that should be enough to later reconstruct it. (a somewhat human-readable ascii format is usually preferred). The new default version simply calls newwrite(...) which simply writes all the "options" declared in declareOptions, so there is no need to overload write in subclasses. Old classes that still overload write should progressively be moved to the new declareOptions/build mechanism. Reimplemented from PLearn::Object. Definition at line 220 of file RealMapping.cc. References PLearn::print(), PLearn::writeFooter(), and PLearn::writeHeader(). |
|
Reimplemented from PLearn::Object. |
|
Definition at line 141 of file RealMapping.h. Referenced by PLearn::StatsCollector::getAllValuesMapping(), map(), operator==(), print(), and read(). |
|
Definition at line 135 of file RealMapping.h. Referenced by addMapping(), binnumber(), checkConsistency(), getCutPoints(), map(), maxMappedToValue(), operator==(), and print(). |
|
Definition at line 140 of file RealMapping.h. Referenced by map(), operator==(), print(), and read(). |
|
Definition at line 139 of file RealMapping.h. Referenced by buildOrderedMapping(). |
|
Definition at line 142 of file RealMapping.h. Referenced by PLearn::StatsCollector::getAllValuesMapping(), map(), operator==(), and print(). |