SNAP Library 4.0, Developer Reference
2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <agm.h>
Public Member Functions | |
TLogRegFit () | |
~TLogRegFit () | |
PLogRegPredict | CalcLogRegGradient (const TVec< TFltV > &XPt, const TFltV &yPt, const TStr &PlotNm=TStr(), const double &ChangeEps=0.01, const int &MaxStep=200, const bool InterceptPt=false) |
PLogRegPredict | CalcLogRegNewton (const TVec< TFltV > &XPt, const TFltV &yPt, const TStr &PlotNm=TStr(), const double &ChangeEps=0.01, const int &MaxStep=200, const bool InterceptPt=false) |
int | MLEGradient (const double &ChangeEps, const int &MaxStep, const TStr PlotNm) |
int | MLENewton (const double &ChangeEps, const int &MaxStep, const TStr PlotNm) |
double | GetStepSizeByLineSearch (const TFltV &DeltaV, const TFltV &GradV, const double &Alpha, const double &Beta) |
double | Likelihood (const TFltV &NewTheta) |
double | Likelihood () |
void | Gradient (TFltV &GradV) |
void | Hessian (TFltVV &HVV) |
void | GetNewtonStep (TFltVV &HVV, const TFltV &GradV, TFltV &DeltaLV) |
Private Attributes | |
TVec< TFltV > | X |
TFltV | Y |
TFltV | Theta |
int | M |
PLogRegPredict TLogRegFit::CalcLogRegGradient | ( | const TVec< TFltV > & | XPt, |
const TFltV & | yPt, | ||
const TStr & | PlotNm = TStr() , |
||
const double & | ChangeEps = 0.01 , |
||
const int & | MaxStep = 200 , |
||
const bool | InterceptPt = false |
||
) |
Definition at line 901 of file agm.cpp.
References TVec< TVal, TSizeTy >::Gen(), IAssert, TVec< TVal, TSizeTy >::Len(), M, MLEGradient(), Theta, X, and Y.
PLogRegPredict TLogRegFit::CalcLogRegNewton | ( | const TVec< TFltV > & | XPt, |
const TFltV & | yPt, | ||
const TStr & | PlotNm = TStr() , |
||
const double & | ChangeEps = 0.01 , |
||
const int & | MaxStep = 200 , |
||
const bool | InterceptPt = false |
||
) |
Definition at line 882 of file agm.cpp.
References TVec< TVal, TSizeTy >::Gen(), IAssert, TVec< TVal, TSizeTy >::Len(), M, MLENewton(), Theta, X, and Y.
Referenced by TAGMUtil::FindComsByAGM().
Definition at line 718 of file agm.cpp.
References TVVec< TVal, TSizeTy >::GetXDim(), TVec< TVal, TSizeTy >::Len(), TNumericalStuff::SolveSymetricSystem(), and Theta.
Referenced by MLENewton().
double TLogRegFit::GetStepSizeByLineSearch | ( | const TFltV & | DeltaV, |
const TFltV & | GradV, | ||
const double & | Alpha, | ||
const double & | Beta | ||
) |
Definition at line 837 of file agm.cpp.
References TLinAlg::DotProduct(), IAssert, TVec< TVal, TSizeTy >::Len(), Likelihood(), and Theta.
Referenced by MLEGradient(), and MLENewton().
void TLogRegFit::Gradient | ( | TFltV & | GradV | ) |
Definition at line 869 of file agm.cpp.
References TVec< TVal, TSizeTy >::Gen(), TLogRegPredict::GetCfy(), M, Theta, X, and Y.
Referenced by MLEGradient(), and MLENewton().
void TLogRegFit::Hessian | ( | TFltVV & | HVV | ) |
Definition at line 746 of file agm.cpp.
References TVVec< TVal, TSizeTy >::At(), TVVec< TVal, TSizeTy >::Gen(), TLogRegPredict::GetCfy(), TVec< TVal, TSizeTy >::Len(), Theta, and X.
Referenced by MLENewton().
double TLogRegFit::Likelihood | ( | const TFltV & | NewTheta | ) |
Definition at line 858 of file agm.cpp.
References TLogRegPredict::GetCfy(), TVec< TVal, TSizeTy >::Len(), X, and Y.
|
inline |
Definition at line 183 of file agm.h.
References Likelihood(), and Theta.
Referenced by GetStepSizeByLineSearch(), Likelihood(), and MLEGradient().
int TLogRegFit::MLEGradient | ( | const double & | ChangeEps, |
const int & | MaxStep, | ||
const TStr | PlotNm | ||
) |
Definition at line 797 of file agm.cpp.
References TVec< TVal, TSizeTy >::Add(), TStr::Empty(), GetStepSizeByLineSearch(), TExeTm::GetTmStr(), Gradient(), TVec< TVal, TSizeTy >::Len(), Likelihood(), TLinAlg::Norm(), TGnuPlot::PlotValV(), and Theta.
Referenced by CalcLogRegGradient().
int TLogRegFit::MLENewton | ( | const double & | ChangeEps, |
const int & | MaxStep, | ||
const TStr | PlotNm | ||
) |
Definition at line 770 of file agm.cpp.
References TLinAlg::DotProduct(), TStr::Empty(), GetNewtonStep(), GetStepSizeByLineSearch(), TExeTm::GetTmStr(), Gradient(), Hessian(), TVec< TVal, TSizeTy >::Len(), and Theta.
Referenced by CalcLogRegNewton().
|
private |
Definition at line 172 of file agm.h.
Referenced by CalcLogRegGradient(), CalcLogRegNewton(), and Gradient().
|
private |
Definition at line 171 of file agm.h.
Referenced by CalcLogRegGradient(), CalcLogRegNewton(), GetNewtonStep(), GetStepSizeByLineSearch(), Gradient(), Hessian(), Likelihood(), MLEGradient(), and MLENewton().
Definition at line 169 of file agm.h.
Referenced by CalcLogRegGradient(), CalcLogRegNewton(), Gradient(), Hessian(), and Likelihood().
|
private |
Definition at line 170 of file agm.h.
Referenced by CalcLogRegGradient(), CalcLogRegNewton(), Gradient(), and Likelihood().