SNAP Library 6.0, User Reference
2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <agmdirected.h>
Public Member Functions | |
TCoda (const PNGraph &GraphPt, const int &InitComs, const int RndSeed=0) | |
TCoda () | |
void | SetGraph (const PNGraph &GraphPt) |
PNGraph | GetGraph () |
PNGraph | GetGraphRawNID () |
void | SetRegCoef (const double _RegCoef) |
double | GetRegCoef () |
void | RandomInit (const int InitComs) |
int | GetNumComs () |
void | NeighborComInit (const int InitComs) |
void | NeighborComInit (TFltIntPrV &NIdPhiV, const int InitComs) |
void | SetCmtyVV (const TVec< TIntV > &CmtyVVOut, const TVec< TIntV > &CmtyVVIn) |
double | Likelihood (const bool DoParallel=false) |
double | LikelihoodForNode (const bool IsRow, const int UID) |
double | LikelihoodForNode (const bool IsRow, const int UID, const TIntFltH &FU) |
void | GetNonEdgePairScores (TFltIntIntTrV &ScoreV) |
void | GetNIDValH (TIntFltH &NIdValInOutH, TIntFltH &NIdValOutH, TIntFltH &NIdValInH, const int CID, const double Thres) |
void | DumpMemberships (const TStr &OutFNm, const TStrHash< TInt > &NodeNameH) |
void | DumpMemberships (const TStr &OutFNm, const TStrHash< TInt > &NodeNameH, const double Thres) |
void | GetCmtyS (TIntSet &CmtySOut, TIntSet &CmtySIn, const int CID, const double Thres) |
void | DumpMemberships (const TStr &OutFNm, const double Thres) |
void | DumpMemberships (const TStr &OutFNm) |
void | GetCommunity (TIntV &CmtyVIn, TIntV &CmtyVOut, const int CID) |
void | GetCommunity (TIntV &CmtyVIn, TIntV &CmtyVOut, const int CID, const double Thres) |
extract community affiliation for given community ID More... | |
void | GetTopCIDs (TIntV &CIdV, const int TopK, const int IsAverage=1, const int MinSz=1) |
void | GradientForNode (const bool IsRow, const int UID, TIntFltH &GradU, const TIntSet &CIDSet) |
void | SetHoldOut (const double HOFrac) |
void | GetCmtyVV (TVec< TIntV > &CmtyVVOut, TVec< TIntV > &CmtyVVIn, const int MinSz=3) |
void | GetCmtyVV (TVec< TIntV > &CmtyVVOut, TVec< TIntV > &CmtyVVIn, const double ThresOut, const double ThresIn, const int MinSz=3) |
void | GetCmtyVV (const bool IsOut, TVec< TIntV > &CmtyVV) |
void | GetCmtyVV (const bool IsOut, TVec< TIntV > &CmtyVV, const double Thres, const int MinSz=3) |
extract community affiliation for outgoing edges from F_uc More... | |
void | GetCmtyVVUnSorted (const bool IsOut, TVec< TIntV > &CmtyVV, const double Thres, const int MinSz=3) |
void | GetCmtyVVUnSorted (TVec< TIntV > &CmtyVVOut, TVec< TIntV > &CmtyVVIn) |
int | FindComsByCV (TIntV &ComsV, const double HOFrac=0.2, const int NumThreads=20, const TStr PlotLFNm=TStr(), const int EdgesForCV=100, const double StepAlpha=0.3, const double StepBeta=0.1) |
int | FindComsByCV (const int NumThreads, const int MaxComs, const int MinComs, const int DivComs, const TStr OutFNm, const int EdgesForCV=100, const double StepAlpha=0.3, const double StepBeta=0.3) |
estimate number of communities using cross validation More... | |
double | LikelihoodHoldOut (const bool DoParallel=false) |
double | GetStepSizeByLineSearch (const bool IsRow, const int UID, const TIntFltH &DeltaV, const TIntFltH &GradV, const double &Alpha, const double &Beta, const int MaxIter=10) |
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) |
void | Save (TSOut &SOut) |
void | Load (TSIn &SIn, const int &RndSeed=0) |
TFlt & | GetSumVal (const bool IsOut, const int CID) |
double | GetCom (const bool IsOut, const int &NID, const int &CID) |
double | GetComOut (const int &NID, const int &CID) |
double | GetComIn (const int &NID, const int &CID) |
void | AddCom (const bool IsOut, const int &NID, const int &CID, const double &Val) |
void | AddComOut (const int &NID, const int &CID, const double &Val) |
void | AddComIn (const int &NID, const int &CID, const double &Val) |
void | DelCom (const bool IsOut, const int &NID, const int &CID) |
void | DelComOut (const int &NID, const int &CID) |
void | DelComIn (const int &NID, const int &CID) |
double | DotProduct (const TIntFltH &UV, const TIntFltH &VV) |
double | DotProductUtoV (const int &UID, const int &VID) |
double | Prediction (const TIntFltH &FU, const TIntFltH &HV) |
double | Prediction (const int &UID, const int &VID) |
double | Sum (const TIntFltH &UV) |
double | Norm2 (const TIntFltH &UV) |
Public Attributes | |
TFlt | MinVal |
TFlt | MaxVal |
TFlt | NegWgt |
TFlt | PNoCom |
TBool | DoParallel |
Private Attributes | |
PNGraph | G |
TVec< TIntFltH > | F |
TVec< TIntFltH > | H |
TRnd | Rnd |
TIntV | NIDV |
TFlt | RegCoef |
TFltV | SumFV |
TFltV | SumHV |
TBool | NodesOk |
TInt | NumComs |
TVec< TIntSet > | HOVIDSV |
Definition at line 7 of file agmdirected.h.
|
inline |
Definition at line 27 of file agmdirected.h.
|
inline |
Definition at line 29 of file agmdirected.h.
|
inline |
Definition at line 114 of file agmdirected.h.
|
inline |
Definition at line 128 of file agmdirected.h.
|
inline |
Definition at line 121 of file agmdirected.h.
|
inline |
Definition at line 135 of file agmdirected.h.
|
inline |
Definition at line 148 of file agmdirected.h.
|
inline |
Definition at line 142 of file agmdirected.h.
Definition at line 154 of file agmdirected.h.
|
inline |
Definition at line 171 of file agmdirected.h.
Definition at line 45 of file agmdirected.h.
void TCoda::DumpMemberships | ( | const TStr & | OutFNm, |
const TStrHash< TInt > & | NodeNameH, | ||
const double | Thres | ||
) |
Definition at line 617 of file agmdirected.cpp.
void TCoda::DumpMemberships | ( | const TStr & | OutFNm, |
const double | Thres | ||
) |
Definition at line 668 of file agmdirected.cpp.
|
inline |
Definition at line 49 of file agmdirected.h.
int TCoda::FindComsByCV | ( | TIntV & | ComsV, |
const double | HOFrac = 0.2 , |
||
const int | NumThreads = 20 , |
||
const TStr | PlotLFNm = TStr() , |
||
const int | EdgesForCV = 100 , |
||
const double | StepAlpha = 0.3 , |
||
const double | StepBeta = 0.1 |
||
) |
Definition at line 746 of file agmdirected.cpp.
int TCoda::FindComsByCV | ( | const int | NumThreads, |
const int | MaxComs, | ||
const int | MinComs, | ||
const int | DivComs, | ||
const TStr | OutFNm, | ||
const int | EdgesForCV = 100 , |
||
const double | StepAlpha = 0.3 , |
||
const double | StepBeta = 0.3 |
||
) |
estimate number of communities using cross validation
Definition at line 733 of file agmdirected.cpp.
Definition at line 674 of file agmdirected.cpp.
Definition at line 717 of file agmdirected.cpp.
void TCoda::GetCmtyVV | ( | TVec< TIntV > & | CmtyVVOut, |
TVec< TIntV > & | CmtyVVIn, | ||
const double | ThresOut, | ||
const double | ThresIn, | ||
const int | MinSz = 3 |
||
) |
Definition at line 727 of file agmdirected.cpp.
Definition at line 501 of file agmdirected.cpp.
void TCoda::GetCmtyVV | ( | const bool | IsOut, |
TVec< TIntV > & | CmtyVV, | ||
const double | Thres, | ||
const int | MinSz = 3 |
||
) |
extract community affiliation for outgoing edges from F_uc
Definition at line 539 of file agmdirected.cpp.
void TCoda::GetCmtyVVUnSorted | ( | const bool | IsOut, |
TVec< TIntV > & | CmtyVV, | ||
const double | Thres, | ||
const int | MinSz = 3 |
||
) |
Definition at line 563 of file agmdirected.cpp.
Definition at line 722 of file agmdirected.cpp.
|
inline |
Definition at line 93 of file agmdirected.h.
|
inline |
Definition at line 107 of file agmdirected.h.
Definition at line 50 of file agmdirected.h.
extract community affiliation for given community ID
Definition at line 506 of file agmdirected.cpp.
|
inline |
Definition at line 100 of file agmdirected.h.
|
inline |
Definition at line 31 of file agmdirected.h.
PNGraph TCoda::GetGraphRawNID | ( | ) |
Definition at line 577 of file agmdirected.cpp.
void TCoda::GetNIDValH | ( | TIntFltH & | NIdValInOutH, |
TIntFltH & | NIdValOutH, | ||
TIntFltH & | NIdValInH, | ||
const int | CID, | ||
const double | Thres | ||
) |
Definition at line 596 of file agmdirected.cpp.
void TCoda::GetNonEdgePairScores | ( | TFltIntIntTrV & | ScoreV | ) |
Definition at line 153 of file agmdirected.cpp.
|
inline |
Definition at line 36 of file agmdirected.h.
|
inline |
Definition at line 34 of file agmdirected.h.
double TCoda::GetStepSizeByLineSearch | ( | const bool | IsRow, |
const int | UID, | ||
const TIntFltH & | DeltaV, | ||
const TIntFltH & | GradV, | ||
const double & | Alpha, | ||
const double & | Beta, | ||
const int | MaxIter = 10 |
||
) |
Definition at line 859 of file agmdirected.cpp.
|
inline |
Definition at line 86 of file agmdirected.h.
void TCoda::GetTopCIDs | ( | TIntV & | CIdV, |
const int | TopK, | ||
const int | IsAverage = 1 , |
||
const int | MinSz = 1 |
||
) |
Definition at line 520 of file agmdirected.cpp.
void TCoda::GradientForNode | ( | const bool | IsRow, |
const int | UID, | ||
TIntFltH & | GradU, | ||
const TIntSet & | CIDSet | ||
) |
Definition at line 377 of file agmdirected.cpp.
double TCoda::Likelihood | ( | const bool | DoParallel = false | ) |
Definition at line 231 of file agmdirected.cpp.
double TCoda::LikelihoodForNode | ( | const bool | IsRow, |
const int | UID | ||
) |
Definition at line 251 of file agmdirected.cpp.
double TCoda::LikelihoodForNode | ( | const bool | IsRow, |
const int | UID, | ||
const TIntFltH & | FU | ||
) |
Definition at line 259 of file agmdirected.cpp.
double TCoda::LikelihoodHoldOut | ( | const bool | DoParallel = false | ) |
Definition at line 841 of file agmdirected.cpp.
void TCoda::Load | ( | TSIn & | SIn, |
const int & | RndSeed = 0 |
||
) |
Definition at line 25 of file agmdirected.cpp.
int TCoda::MLEGradAscent | ( | const double & | Thres, |
const int & | MaxIter, | ||
const TStr | PlotNm, | ||
const double | StepAlpha = 0.3 , |
||
const double | StepBeta = 0.1 |
||
) |
Definition at line 885 of file agmdirected.cpp.
int TCoda::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 962 of file agmdirected.cpp.
|
inline |
Definition at line 74 of file agmdirected.h.
void TCoda::NeighborComInit | ( | const int | InitComs | ) |
Definition at line 83 of file agmdirected.cpp.
void TCoda::NeighborComInit | ( | TFltIntPrV & | NIdPhiV, |
const int | InitComs | ||
) |
Definition at line 91 of file agmdirected.cpp.
|
inline |
Definition at line 189 of file agmdirected.h.
Definition at line 174 of file agmdirected.h.
|
inline |
Definition at line 179 of file agmdirected.h.
void TCoda::RandomInit | ( | const int | InitComs | ) |
Definition at line 43 of file agmdirected.cpp.
void TCoda::Save | ( | TSOut & | SOut | ) |
Definition at line 8 of file agmdirected.cpp.
Definition at line 171 of file agmdirected.cpp.
void TCoda::SetGraph | ( | const PNGraph & | GraphPt | ) |
Definition at line 204 of file agmdirected.cpp.
|
inline |
Definition at line 54 of file agmdirected.h.
|
inline |
Definition at line 33 of file agmdirected.h.
|
inline |
Definition at line 182 of file agmdirected.h.
TBool TCoda::DoParallel |
Definition at line 25 of file agmdirected.h.
Definition at line 10 of file agmdirected.h.
|
private |
Definition at line 9 of file agmdirected.h.
Definition at line 11 of file agmdirected.h.
Definition at line 19 of file agmdirected.h.
TFlt TCoda::MaxVal |
Definition at line 22 of file agmdirected.h.
TFlt TCoda::MinVal |
Definition at line 21 of file agmdirected.h.
TFlt TCoda::NegWgt |
Definition at line 23 of file agmdirected.h.
|
private |
Definition at line 13 of file agmdirected.h.
|
private |
Definition at line 17 of file agmdirected.h.
|
private |
Definition at line 18 of file agmdirected.h.
TFlt TCoda::PNoCom |
Definition at line 24 of file agmdirected.h.
|
private |
Definition at line 14 of file agmdirected.h.
|
private |
Definition at line 12 of file agmdirected.h.
|
private |
Definition at line 15 of file agmdirected.h.
|
private |
Definition at line 16 of file agmdirected.h.