SNAP Library 2.1, User Reference  2013-09-25 10:47:25
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>

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 169 of file agm.h.


Constructor & Destructor Documentation

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

Definition at line 175 of file agm.h.

: Theta(_bb) { };
TLogRegPredict::TLogRegPredict ( TSIn SIn) [inline]

Definition at line 178 of file agm.h.

{ Theta.Load(SIn); };

Member Function Documentation

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

Definition at line 913 of file agm.cpp.

                                                                                    {
  OutV.Gen(X.Len());
  for (int r = 0; r < X.Len(); r++) {
    OutV[r] = GetCfy(X[r], NewTheta);
  }
}
double TLogRegPredict::GetCfy ( const TFltV AttrV,
const TFltV NewTheta 
) [static]

Definition at line 902 of file agm.cpp.

                                                                       {
    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;
}
double TLogRegPredict::GetCfy ( const TFltV AttrV) [inline]

Definition at line 187 of file agm.h.

{ return GetCfy(AttrV, Theta); }
void TLogRegPredict::GetCfy ( const TVec< TFltV > &  X,
TFltV OutV 
) [inline]

Definition at line 189 of file agm.h.

{ GetCfy(X, OutV, Theta); }
void TLogRegPredict::GetTheta ( TFltV _Theta) [inline]

Definition at line 188 of file agm.h.

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

Definition at line 179 of file agm.h.

{ return new TLogRegPredict(SIn); };
void TLogRegPredict::PrintTheta ( ) [inline]

Definition at line 190 of file agm.h.

{ for (int t = 0; t < Theta.Len(); t++) { printf("Theta[%d] = %f\n", t, Theta[t].Val); } }
void TLogRegPredict::Save ( TSOut SOut) const [inline]

Definition at line 180 of file agm.h.

{ Theta.Save(SOut); };

Friends And Related Function Documentation

friend class TPt< TLogRegPredict > [friend]

Definition at line 191 of file agm.h.


Member Data Documentation

Definition at line 171 of file agm.h.

Definition at line 173 of file agm.h.


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