#include <LiftStatsCollector.h>
Inheritance diagram for PLearn::LiftStatsCollector:
Public Types | |
typedef VecStatsCollector | inherited |
Public Member Functions | |
LiftStatsCollector () | |
virtual void | forget () |
clears all previously accumulated statistics | |
virtual void | update (const Vec &x, real weight=1.0) |
updates the statistics when seeing x The weight applies to all elements of x | |
virtual void | finalize () |
This finalize override makes sure only the n_samples_to_keep samples from the matrix n_first_updates with the highest output are left. | |
virtual double | getStat (const string &statspec) |
In addition to the regular VecStatsCollector statistics, we understand specific lift statistics (see the .cc). | |
PLEARN_DECLARE_OBJECT (LiftStatsCollector) | |
virtual void | build () |
simply calls inherited::build() then build_() | |
virtual void | makeDeepCopyFromShallowCopy (map< const void *, void * > &copies) |
Transforms a shallow copy into a deep copy. | |
Public Attributes | |
real | lift_fraction |
int | opposite_lift |
string | output_column |
int | sign_trick |
int | target_column |
int | verbosity |
Protected Member Functions | |
real | computeLift () |
Return the LIFT statistic. | |
real | computeLiftMax () |
Return the LIFT_MAX statistic. | |
Static Protected Member Functions | |
void | declareOptions (OptionList &ol) |
Declares this class' options. | |
Protected Attributes | |
int | count_fin |
Mat | n_first_updates |
Matrix storing the output and target of the samples with highest output, as well as all the other data retrieved since the last call to finalize. | |
bool | is_finalized |
Set to true after each call to finalize(). | |
int | nstored |
Number of examples stored in the n_first_updates matrix. | |
int | nsamples |
Number of samples seen. | |
int | npos |
Number of positive examples that are not retained in the ones with the highest output (that is to say the ones in n_first_updates). | |
int | n_samples_to_keep |
Number of examples to keep (nsamples * lift_fraction). | |
int | output_column_index |
Index of the output column. | |
Private Member Functions | |
void | build_ () |
This does the actual building. |
|
Reimplemented from PLearn::VecStatsCollector. Definition at line 57 of file LiftStatsCollector.h. Referenced by LiftStatsCollector(). |
|
Definition at line 53 of file LiftStatsCollector.cc. References inherited. |
|
simply calls inherited::build() then build_()
Reimplemented from PLearn::VecStatsCollector. Definition at line 133 of file LiftStatsCollector.cc. References build_(). |
|
This does the actual building.
Reimplemented from PLearn::VecStatsCollector. Definition at line 142 of file LiftStatsCollector.cc. References output_column, and output_column_index. Referenced by build(). |
|
Return the LIFT statistic.
Definition at line 160 of file LiftStatsCollector.cc. References PLearn::TMat< T >::column(), PLearn::endl(), finalize(), is_finalized, lift_fraction, n_first_updates, n_samples_to_keep, npos, nsamples, nstored, opposite_lift, output_column, sign_trick, PLearn::sum(), target_column, and verbosity. Referenced by getStat(). |
|
Return the LIFT_MAX statistic.
Definition at line 192 of file LiftStatsCollector.cc. References PLearn::TMat< T >::column(), finalize(), is_finalized, MIN, n_first_updates, n_samples_to_keep, npos, nsamples, and PLearn::sum(). Referenced by getStat(). |
|
Declares this class' options.
Reimplemented from PLearn::VecStatsCollector. Definition at line 98 of file LiftStatsCollector.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
This finalize override makes sure only the n_samples_to_keep samples from the matrix n_first_updates with the highest output are left.
Reimplemented from PLearn::VecStatsCollector. Definition at line 207 of file LiftStatsCollector.cc. References count_fin, PLearn::endl(), is_finalized, lift_fraction, n_first_updates, n_samples_to_keep, npos, nsamples, nstored, PLearn::TMat< T >::resize(), PLearn::selectAndOrder(), and verbosity. Referenced by computeLift(), and computeLiftMax(). |
|
clears all previously accumulated statistics
Reimplemented from PLearn::VecStatsCollector. Definition at line 249 of file LiftStatsCollector.cc. References count_fin, is_finalized, n_first_updates, npos, nsamples, nstored, and PLearn::TMat< T >::resize(). |
|
In addition to the regular VecStatsCollector statistics, we understand specific lift statistics (see the .cc).
Reimplemented from PLearn::VecStatsCollector. Definition at line 264 of file LiftStatsCollector.cc. References computeLift(), computeLiftMax(), and PLearn::PStream::smartReadUntilNext(). |
|
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::VecStatsCollector. Definition at line 282 of file LiftStatsCollector.cc. References PLearn::deepCopyField(), and n_first_updates. |
|
|
|
updates the statistics when seeing x The weight applies to all elements of x
Reimplemented from PLearn::VecStatsCollector. Definition at line 291 of file LiftStatsCollector.cc. References count_fin, PLearn::FABS(), is_finalized, PLearn::is_missing(), PLearn::TMat< T >::length(), MAX, n_first_updates, nsamples, nstored, output_column_index, PLERROR, PLWARNING, PLearn::TMat< T >::resize(), sign_trick, target_column, PLearn::Vec, and x. |
|
Definition at line 63 of file LiftStatsCollector.h. Referenced by finalize(), forget(), and update(). |
|
Set to true after each call to finalize().
Definition at line 72 of file LiftStatsCollector.h. Referenced by computeLift(), computeLiftMax(), finalize(), forget(), and update(). |
|
Definition at line 96 of file LiftStatsCollector.h. Referenced by computeLift(), and finalize(). |
|
Matrix storing the output and target of the samples with highest output, as well as all the other data retrieved since the last call to finalize.
Definition at line 69 of file LiftStatsCollector.h. Referenced by computeLift(), computeLiftMax(), finalize(), forget(), makeDeepCopyFromShallowCopy(), and update(). |
|
Number of examples to keep (nsamples * lift_fraction).
Definition at line 85 of file LiftStatsCollector.h. Referenced by computeLift(), computeLiftMax(), and finalize(). |
|
Number of positive examples that are not retained in the ones with the highest output (that is to say the ones in n_first_updates).
Definition at line 82 of file LiftStatsCollector.h. Referenced by computeLift(), computeLiftMax(), finalize(), and forget(). |
|
Number of samples seen.
Definition at line 78 of file LiftStatsCollector.h. Referenced by computeLift(), computeLiftMax(), finalize(), forget(), and update(). |
|
Number of examples stored in the n_first_updates matrix.
Definition at line 75 of file LiftStatsCollector.h. Referenced by computeLift(), finalize(), forget(), and update(). |
|
Definition at line 97 of file LiftStatsCollector.h. Referenced by computeLift(). |
|
Definition at line 98 of file LiftStatsCollector.h. Referenced by build_(), and computeLift(). |
|
Index of the output column.
Definition at line 88 of file LiftStatsCollector.h. |
|
Definition at line 99 of file LiftStatsCollector.h. Referenced by computeLift(), and update(). |
|
Definition at line 100 of file LiftStatsCollector.h. Referenced by computeLift(), and update(). |
|
Definition at line 101 of file LiftStatsCollector.h. Referenced by computeLift(), and finalize(). |