SNAP Library 4.0, User Reference
2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <agmattr.h>
Public Member Functions | |
TCesna () | |
TCesna (const PUNGraph &GraphPt, const THash< TInt, TIntV > &NIDAttrH, const int &InitComs, const int RndSeed=0) | |
void | Save (TSOut &SOut) |
void | Load (TSIn &SIn, const int &RndSeed=0) |
void | SetGraph (const PUNGraph &GraphPt, const THash< TInt, TIntV > &NIDAttrH) |
void | SetRegCoef (const double _RegCoef) |
double | GetRegCoef () |
void | SetWeightAttr (const double _WeightAttr) |
double | GetWeightAttr () |
void | SetLassoCoef (const double _LassoCoef) |
int | GetAttrs () |
double | GetComFromNID (const int &NID, const int &CID) |
double | GetLassoCoef () |
void | InitW () |
void | SetAttrHoldOut (const int NID, const int KID) |
void | SetAttrHoldOutForOneNode (const int NID) |
void | GetW (TVec< TFltV > &_W) |
void | SetW (TVec< TFltV > &_W) |
void | RandomInit (const int InitComs) |
void | NeighborComInit (const int InitComs) |
void | NeighborComInit (TFltIntPrV &NIdPhiV, const int InitComs) |
int | GetNumComs () |
void | SetCmtyVV (const TVec< TIntV > &CmtyVV) |
double | Likelihood (const bool DoParallel=false) |
double | LikelihoodForRow (const int UID) |
double | LikelihoodForRow (const int UID, const TIntFltH &FU) |
double | LikelihoodAttrKForRow (const int UID, const int K) |
double | LikelihoodAttrKForRow (const int UID, const int K, const TIntFltH &FU) |
double | LikelihoodAttrKForRow (const int UID, const int K, const TIntFltH &FU, const TFltV &WK) |
double | LikelihoodForWK (const int K, const TFltV &WK) |
double | LikelihoodForWK (const int K) |
double | LikelihoodAttr () |
double | LikelihoodGraph () |
void | GenHoldOutAttr (const double HOFrac, TVec< TIntSet > &HOSetV) |
void | SetHoldOut (const double HOFrac) |
void | GradientForRow (const int UID, TIntFltH &GradU, const TIntSet &CIDSet) |
void | GradientForWK (TFltV &GradV, const int K) |
void | GetCmtyVV (TVec< TIntV > &CmtyVV) |
void | GetCmtyVV (TVec< TIntV > &CmtyVV, TVec< TFltV > &Wck, const double Thres, const int MinSz=3) |
extract community affiliation from F_uc Wck[c][k] = W_c for k-th attribute More... | |
void | GetCmtyVV (TVec< TIntV > &CmtyVV, const double Thres, const int MinSz=3) |
void | GetCmtyVV (TVec< TIntV > &CmtyVV, TVec< TFltV > &Wck) |
void | GetCmtyVVUnSorted (TVec< TIntV > &CmtyVV) |
void | GetCmtyVVUnSorted (TVec< TIntV > &CmtyVV, const double Thres, const int MinSz=3) |
int | FindComs (TIntV &ComsV, const bool UseBIC=false, const double HOFrac=0.2, const int NumThreads=20, const TStr PlotLFNm=TStr(), const double StepAlpha=0.3, const double StepBeta=0.1) |
int | FindComs (const int NumThreads, const int MaxComs, const int MinComs, const int DivComs, const TStr OutFNm, const bool UseBIC=false, const double HOFrac=0.1, const double StepAlpha=0.3, const double StepBeta=0.3) |
estimate number of communities using cross validation More... | |
void | DisplayAttrs (const int TopK, const TStrHash< TInt > &NodeNameH) |
double | LikelihoodHoldOut () |
double | GetStepSizeByLineSearch (const int UID, const TIntFltH &DeltaV, const TIntFltH &GradV, const double &Alpha, const double &Beta, const int MaxIter=10) |
double | GetStepSizeByLineSearchForWK (const int K, const TFltV &DeltaV, const TFltV &GradV, const double &Alpha, const double &Beta, const int MaxIter=10) |
int | GetPositiveW () |
int | MLEGradAscent (const double &Thres, const int &MaxIter, const TStr PlotNm, const double StepAlpha=0.3, const double StepBeta=0.1) |
int | MLEGradAscentParallel (const double &Thres, const int &MaxIter, const int ChunkNum, const int ChunkSize, const TStr PlotNm, const double StepAlpha=0.3, const double StepBeta=0.1) |
int | MLEGradAscentParallel (const double &Thres, const int &MaxIter, const int ChunkNum, const TStr PlotNm=TStr(), const double StepAlpha=0.3, const double StepBeta=0.1) |
double | GetCom (const int &NID, const int &CID) |
double | GetAttr (const int &NID, const int &K) |
void | AddCom (const int &NID, const int &CID, const double &Val) |
void | DelCom (const int &NID, const int &CID) |
double | DotProduct (const TIntFltH &UV, const TIntFltH &VV) |
double | DotProduct (const int &UID, const int &VID) |
double | Prediction (const TIntFltH &FU, const TIntFltH &FV) |
double | PredictAttrK (const TIntFltH &FU, const TFltV &WK) |
double | PredictAttrK (const TIntFltH &FU, const int K) |
double | PredictAttrK (const int UID, const int K) |
double | GetW (const int CID, const int K) |
double | Prediction (const int &UID, const int &VID) |
double | Sum (const TIntFltH &UV) |
double | Norm2 (const TIntFltH &UV) |
double | Sigmoid (const double X) |
Public Attributes | |
TFlt | MinVal |
TFlt | MaxVal |
TFlt | MinValW |
TFlt | MaxValW |
TFlt | NegWgt |
TFlt | LassoCoef |
TFlt | WeightAttr |
TFlt | PNoCom |
TBool | DoParallel |
Private Attributes | |
PUNGraph | G |
TVec< TIntSet > | X |
TVec< TIntFltH > | F |
TVec< TFltV > | W |
TInt | Attrs |
TRnd | Rnd |
TIntSet | NIDToIdx |
TFlt | RegCoef |
TFltV | SumFV |
TInt | NumComs |
TVec< TIntSet > | HOVIDSV |
TVec< TIntSet > | HOKIDSV |
|
inline |
Definition at line 271 of file agmattr.h.
|
inline |
Definition at line 272 of file agmattr.h.
|
inline |
|
inline |
|
inline |
Definition at line 581 of file agmattr.h.
int TCesna::FindComs | ( | TIntV & | ComsV, |
const bool | UseBIC = false , |
||
const double | HOFrac = 0.2 , |
||
const int | NumThreads = 20 , |
||
const TStr | PlotLFNm = TStr() , |
||
const double | StepAlpha = 0.3 , |
||
const double | StepBeta = 0.1 |
||
) |
Definition at line 361 of file agmattr.cpp.
int TCesna::FindComs | ( | const int | NumThreads, |
const int | MaxComs, | ||
const int | MinComs, | ||
const int | DivComs, | ||
const TStr | OutFNm, | ||
const bool | UseBIC = false , |
||
const double | HOFrac = 0.1 , |
||
const double | StepAlpha = 0.3 , |
||
const double | StepBeta = 0.3 |
||
) |
estimate number of communities using cross validation
Definition at line 348 of file agmattr.cpp.
Definition at line 397 of file agmattr.h.
|
inline |
Definition at line 289 of file agmattr.cpp.
void TCesna::GetCmtyVV | ( | TVec< TIntV > & | CmtyVV, |
TVec< TFltV > & | Wck, | ||
const double | Thres, | ||
const int | MinSz = 3 |
||
) |
extract community affiliation from F_uc Wck[c][k] = W_c for k-th attribute
Definition at line 296 of file agmattr.cpp.
Definition at line 442 of file agmattr.h.
Definition at line 329 of file agmattr.cpp.
Definition at line 333 of file agmattr.cpp.
|
inline |
|
inline |
double TCesna::GetStepSizeByLineSearch | ( | const int | UID, |
const TIntFltH & | DeltaV, | ||
const TIntFltH & | GradV, | ||
const double & | Alpha, | ||
const double & | Beta, | ||
const int | MaxIter = 10 |
||
) |
Definition at line 480 of file agmattr.cpp.
|
inline |
Definition at line 486 of file agmattr.h.
|
inline |
Definition at line 213 of file agmattr.cpp.
|
inline |
Definition at line 421 of file agmattr.h.
double TCesna::Likelihood | ( | const bool | DoParallel = false | ) |
Definition at line 137 of file agmattr.cpp.
|
inline |
Definition at line 371 of file agmattr.h.
|
inline |
Definition at line 356 of file agmattr.h.
|
inline |
Definition at line 357 of file agmattr.h.
double TCesna::LikelihoodAttrKForRow | ( | const int | UID, |
const int | K, | ||
const TIntFltH & | FU, | ||
const TFltV & | WK | ||
) |
Definition at line 202 of file agmattr.cpp.
double TCesna::LikelihoodForRow | ( | const int | UID | ) |
Definition at line 157 of file agmattr.cpp.
double TCesna::LikelihoodForRow | ( | const int | UID, |
const TIntFltH & | FU | ||
) |
Definition at line 161 of file agmattr.cpp.
|
inline |
Definition at line 359 of file agmattr.h.
|
inline |
Definition at line 370 of file agmattr.h.
double TCesna::LikelihoodHoldOut | ( | ) |
Definition at line 452 of file agmattr.cpp.
|
inline |
Definition at line 294 of file agmattr.h.
int TCesna::MLEGradAscent | ( | const double & | Thres, |
const int & | MaxIter, | ||
const TStr | PlotNm, | ||
const double | StepAlpha = 0.3 , |
||
const double | StepBeta = 0.1 |
||
) |
Definition at line 505 of file agmattr.cpp.
int TCesna::MLEGradAscentParallel | ( | const double & | Thres, |
const int & | MaxIter, | ||
const int | ChunkNum, | ||
const int | ChunkSize, | ||
const TStr | PlotNm, | ||
const double | StepAlpha = 0.3 , |
||
const double | StepBeta = 0.1 |
||
) |
Definition at line 594 of file agmattr.cpp.
|
inline |
Definition at line 521 of file agmattr.h.
void TCesna::NeighborComInit | ( | const int | InitComs | ) |
Definition at line 32 of file agmattr.cpp.
void TCesna::NeighborComInit | ( | TFltIntPrV & | NIdPhiV, |
const int | InitComs | ||
) |
Definition at line 39 of file agmattr.cpp.
|
inline |
|
inline |
Definition at line 597 of file agmattr.h.
|
inline |
Definition at line 600 of file agmattr.h.
Definition at line 584 of file agmattr.h.
|
inline |
Definition at line 606 of file agmattr.h.
void TCesna::RandomInit | ( | const int | InitComs | ) |
Definition at line 9 of file agmattr.cpp.
|
inline |
Definition at line 274 of file agmattr.h.
|
inline |
|
inline |
Definition at line 85 of file agmattr.cpp.
Definition at line 99 of file agmattr.cpp.
|
inline |
Definition at line 414 of file agmattr.h.
|
inline |
|
inline |
|
inline |
|
inline |