PLearn 0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types
PLearn::MulticlassErrorCostFunction Class Reference

#include <MulticlassErrorCostFunction.h>

Inheritance diagram for PLearn::MulticlassErrorCostFunction:
Inheritance graph
[legend]
Collaboration diagram for PLearn::MulticlassErrorCostFunction:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MulticlassErrorCostFunction ()
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual
MulticlassErrorCostFunction
deepCopy (CopiesMap &copies) const
virtual string info () const
 Returns a bit more informative string about object (default returns classname())
virtual real evaluate (const Vec &output, const Vec &target) const
 ** Subclasses must override this method **

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 PPathdeclaringFile ()

Static Public Attributes

static StaticInitializer _static_initializer_

Private Types

typedef Kernel inherited

Detailed Description

cost = sum_i class_error_i

Definition at line 57 of file MulticlassErrorCostFunction.h.


Member Typedef Documentation

Reimplemented from PLearn::Kernel.

Definition at line 59 of file MulticlassErrorCostFunction.h.


Constructor & Destructor Documentation

PLearn::MulticlassErrorCostFunction::MulticlassErrorCostFunction ( ) [inline]

Definition at line 62 of file MulticlassErrorCostFunction.h.

{}

Member Function Documentation

string PLearn::MulticlassErrorCostFunction::_classname_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file MulticlassErrorCostFunction.cc.

OptionList & PLearn::MulticlassErrorCostFunction::_getOptionList_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file MulticlassErrorCostFunction.cc.

RemoteMethodMap & PLearn::MulticlassErrorCostFunction::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file MulticlassErrorCostFunction.cc.

bool PLearn::MulticlassErrorCostFunction::_isa_ ( const Object o) [static]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file MulticlassErrorCostFunction.cc.

Object * PLearn::MulticlassErrorCostFunction::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Object.

Definition at line 51 of file MulticlassErrorCostFunction.cc.

StaticInitializer MulticlassErrorCostFunction::_static_initializer_ & PLearn::MulticlassErrorCostFunction::_static_initialize_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file MulticlassErrorCostFunction.cc.

string PLearn::MulticlassErrorCostFunction::classname ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 51 of file MulticlassErrorCostFunction.cc.

static const PPath& PLearn::MulticlassErrorCostFunction::declaringFile ( ) [inline, static]

Reimplemented from PLearn::Kernel.

Definition at line 64 of file MulticlassErrorCostFunction.h.

{ return "multiclass_error"; }
MulticlassErrorCostFunction * PLearn::MulticlassErrorCostFunction::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file MulticlassErrorCostFunction.cc.

real PLearn::MulticlassErrorCostFunction::evaluate ( const Vec x1,
const Vec x2 
) const [virtual]

** Subclasses must override this method **

returns K(x1,x2)

Implements PLearn::Kernel.

Definition at line 53 of file MulticlassErrorCostFunction.cc.

References i, PLearn::TVec< T >::length(), and PLERROR.

{
    if (output.length() != target.length())
        PLERROR("In MulticlassErrorCostFunction::evaluate: Output vec and target vec must have the same length (%d!=%d", output.length(),target.length());

    real cost = 0.0;
    for (int i=0; i<output.length(); i++)
    {
        real output_i = output[i];
        int target_i = (int)target[i];
        cost += (target_i==1) ? output_i<0.5 : output_i>0.5;
    }
    return cost;
}

Here is the call graph for this function:

OptionList & PLearn::MulticlassErrorCostFunction::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 51 of file MulticlassErrorCostFunction.cc.

OptionMap & PLearn::MulticlassErrorCostFunction::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 51 of file MulticlassErrorCostFunction.cc.

RemoteMethodMap & PLearn::MulticlassErrorCostFunction::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 51 of file MulticlassErrorCostFunction.cc.

virtual string PLearn::MulticlassErrorCostFunction::info ( ) const [inline, virtual]

Returns a bit more informative string about object (default returns classname())

Returns:
Information about the object

Reimplemented from PLearn::Object.

Definition at line 66 of file MulticlassErrorCostFunction.h.

    { return "multiclass_error"; }

Member Data Documentation

Reimplemented from PLearn::Kernel.

Definition at line 64 of file MulticlassErrorCostFunction.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines