PLearn 0.1
|
#include <EpanechnikovKernel.h>
Public Member Functions | |
EpanechnikovKernel () | |
Default constructor. | |
virtual void | build () |
Simply calls inherited::build() then build_(). | |
virtual void | makeDeepCopyFromShallowCopy (CopiesMap &copies) |
Transforms a shallow copy into a deep copy. | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual EpanechnikovKernel * | deepCopy (CopiesMap &copies) const |
virtual real | evaluate (const Vec &x1, const Vec &x2) const |
Compute K(x1,x2). | |
Static Public Member Functions | |
static string | _classname_ () |
static OptionList & | _getOptionList_ () |
static RemoteMethodMap & | _getRemoteMethodMap_ () |
static Object * | _new_instance_for_typemap_ () |
static bool | _isa_ (const Object *o) |
static void | _static_initialize_ () |
static const PPath & | declaringFile () |
Public Attributes | |
real | gamma |
Smoothing parameter for the Epanechnikov kernel (default=1.0) | |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Static Protected Member Functions | |
static void | declareOptions (OptionList &ol) |
Declares this class' options. | |
Private Types | |
typedef Kernel | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
Definition at line 51 of file EpanechnikovKernel.h.
typedef Kernel PLearn::EpanechnikovKernel::inherited [private] |
Reimplemented from PLearn::Kernel.
Definition at line 53 of file EpanechnikovKernel.h.
PLearn::EpanechnikovKernel::EpanechnikovKernel | ( | ) |
string PLearn::EpanechnikovKernel::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 68 of file EpanechnikovKernel.cc.
OptionList & PLearn::EpanechnikovKernel::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 68 of file EpanechnikovKernel.cc.
RemoteMethodMap & PLearn::EpanechnikovKernel::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 68 of file EpanechnikovKernel.cc.
Reimplemented from PLearn::Kernel.
Definition at line 68 of file EpanechnikovKernel.cc.
Object * PLearn::EpanechnikovKernel::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 68 of file EpanechnikovKernel.cc.
StaticInitializer EpanechnikovKernel::_static_initializer_ & PLearn::EpanechnikovKernel::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 68 of file EpanechnikovKernel.cc.
void PLearn::EpanechnikovKernel::build | ( | ) | [virtual] |
Simply calls inherited::build() then build_().
Reimplemented from PLearn::Kernel.
Definition at line 87 of file EpanechnikovKernel.cc.
References PLearn::Kernel::build(), and build_().
{ // ### Nothing to add here, simply calls build_ inherited::build(); build_(); }
void PLearn::EpanechnikovKernel::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::Kernel.
Definition at line 97 of file EpanechnikovKernel.cc.
References gamma, and PLERROR.
Referenced by build().
{ if (gamma <= 0.0) PLERROR("EpanechnikovKernel::build_: the 'gamma' option must be strictly positive"); }
string PLearn::EpanechnikovKernel::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 68 of file EpanechnikovKernel.cc.
void PLearn::EpanechnikovKernel::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Declares this class' options.
Reimplemented from PLearn::Kernel.
Definition at line 74 of file EpanechnikovKernel.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::Kernel::declareOptions(), and gamma.
{ declareOption(ol, "gamma", &EpanechnikovKernel::gamma, OptionBase::buildoption, "Smoothing parameter for the Epanechnikov kernel (default=1.0)"); // Now call the parent class' declareOptions inherited::declareOptions(ol); }
static const PPath& PLearn::EpanechnikovKernel::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::Kernel.
Definition at line 102 of file EpanechnikovKernel.h.
EpanechnikovKernel * PLearn::EpanechnikovKernel::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::Kernel.
Definition at line 68 of file EpanechnikovKernel.cc.
Compute K(x1,x2).
Implements PLearn::Kernel.
Definition at line 106 of file EpanechnikovKernel.cc.
References gamma, and PLearn::L2distance().
{ real t = L2distance(x1,x2) / gamma; if (t <= 1.0) return 3 * (1-t*t) / 4; return 0; }
OptionList & PLearn::EpanechnikovKernel::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 68 of file EpanechnikovKernel.cc.
OptionMap & PLearn::EpanechnikovKernel::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 68 of file EpanechnikovKernel.cc.
RemoteMethodMap & PLearn::EpanechnikovKernel::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 68 of file EpanechnikovKernel.cc.
void PLearn::EpanechnikovKernel::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::Kernel.
Definition at line 117 of file EpanechnikovKernel.cc.
References PLearn::Kernel::makeDeepCopyFromShallowCopy().
{ inherited::makeDeepCopyFromShallowCopy(copies); }
Reimplemented from PLearn::Kernel.
Definition at line 102 of file EpanechnikovKernel.h.
Smoothing parameter for the Epanechnikov kernel (default=1.0)
Definition at line 62 of file EpanechnikovKernel.h.
Referenced by build_(), declareOptions(), and evaluate().