SNAP Library 2.2, Developer Reference  2014-03-11 19:15:55
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TLogRegPredict Class Reference

#include <agm.h>

Collaboration diagram for TLogRegPredict:

List of all members.

Public Member Functions

 TLogRegPredict (const TFltV &_bb)
 TLogRegPredict (TSIn &SIn)
void Save (TSOut &SOut) const
 UndefDefaultCopyAssign (TLogRegPredict)
double GetCfy (const TFltV &AttrV)
void GetTheta (TFltV &_Theta)
void GetCfy (const TVec< TFltV > &X, TFltV &OutV)
void PrintTheta ()

Static Public Member Functions

static PLogRegPredict Load (TSIn &SIn)
static void GetCfy (const TVec< TFltV > &X, TFltV &OutV, const TFltV &NewTheta)
static double GetCfy (const TFltV &AttrV, const TFltV &NewTheta)

Private Attributes

TCRef CRef
TFltV Theta

Friends

class TPt< TLogRegPredict >

Detailed Description

Definition at line 170 of file agm.h.


Constructor & Destructor Documentation

TLogRegPredict::TLogRegPredict ( const TFltV _bb) [inline]

Definition at line 176 of file agm.h.

Referenced by Load().

: Theta(_bb) { };

Here is the caller graph for this function:

TLogRegPredict::TLogRegPredict ( TSIn SIn) [inline]

Definition at line 179 of file agm.h.

References TVec< TVal, TSizeTy >::Load(), and Theta.

{ Theta.Load(SIn); };

Here is the call graph for this function:


Member Function Documentation

void TLogRegPredict::GetCfy ( const TVec< TFltV > &  X,
TFltV OutV,
const TFltV NewTheta 
) [static]

Definition at line 933 of file agm.cpp.

References TVec< TVal, TSizeTy >::Gen(), and TVec< TVal, TSizeTy >::Len().

Referenced by TLogRegFit::Gradient(), TLogRegFit::Hessian(), and TLogRegFit::Likelihood().

                                                                                    {
  OutV.Gen(X.Len());
  for (int r = 0; r < X.Len(); r++) {
    OutV[r] = GetCfy(X[r], NewTheta);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

double TLogRegPredict::GetCfy ( const TFltV AttrV,
const TFltV NewTheta 
) [static]

Definition at line 922 of file agm.cpp.

References TVec< TVal, TSizeTy >::Last(), and TVec< TVal, TSizeTy >::Len().

                                                                       {
    int len = AttrV.Len();
    double res = 0;
    if (len < NewTheta.Len()) { res = NewTheta.Last(); } //if feature vector is shorter, add an intercept
    for (int i = 0; i < len; i++) {
      if (i < NewTheta.Len()) { res += AttrV[i] * NewTheta[i]; }
    }
    double mu = 1 / (1 + exp(-res));
    return mu;
}

Here is the call graph for this function:

double TLogRegPredict::GetCfy ( const TFltV AttrV) [inline]

Definition at line 188 of file agm.h.

References GetCfy(), and Theta.

Referenced by GetCfy().

{ return GetCfy(AttrV, Theta); }

Here is the call graph for this function:

Here is the caller graph for this function:

void TLogRegPredict::GetCfy ( const TVec< TFltV > &  X,
TFltV OutV 
) [inline]

Definition at line 190 of file agm.h.

References GetCfy(), and Theta.

Referenced by GetCfy().

{ GetCfy(X, OutV, Theta); }

Here is the call graph for this function:

Here is the caller graph for this function:

void TLogRegPredict::GetTheta ( TFltV _Theta) [inline]

Definition at line 189 of file agm.h.

References Theta.

{ _Theta = Theta; }
static PLogRegPredict TLogRegPredict::Load ( TSIn SIn) [inline, static]

Definition at line 180 of file agm.h.

References TLogRegPredict().

{ return new TLogRegPredict(SIn); };

Here is the call graph for this function:

void TLogRegPredict::PrintTheta ( ) [inline]

Definition at line 191 of file agm.h.

References TVec< TVal, TSizeTy >::Len(), and Theta.

{ for (int t = 0; t < Theta.Len(); t++) { printf("Theta[%d] = %f\n", t, Theta[t].Val); } }

Here is the call graph for this function:

void TLogRegPredict::Save ( TSOut SOut) const [inline]

Definition at line 181 of file agm.h.

References TVec< TVal, TSizeTy >::Save(), and Theta.

{ Theta.Save(SOut); };

Here is the call graph for this function:


Friends And Related Function Documentation

friend class TPt< TLogRegPredict > [friend]

Definition at line 192 of file agm.h.


Member Data Documentation

Definition at line 172 of file agm.h.

Definition at line 174 of file agm.h.

Referenced by GetCfy(), GetTheta(), PrintTheta(), Save(), and TLogRegPredict().


The documentation for this class was generated from the following files: