35 const TIntFtrH& NewFeatures,
const int SimilarityThreshold);
38 const int ColIdx = -1);
41 const float BinFraction);
44 const int SimilarityThreshold);
55 const int SimilarityThreshold);
TIntFtrH GenerateRecursiveFeatures(const PUNGraph Graph, const TIntFtrH &CurrFeatures)
Generates recursive features out of current features.
int GetNumFeatures(const TIntFtrH &Features)
Gets number of features from the node-feature mapping.
TIntFtrH ExtractFeatures(const PUNGraph Graph)
Performs feature extraction, the first step of RolX.
void PlotRoles(const PUNGraph Graph, const TIntIntH &Roles)
Plots found roles on a picture (.png).
void AssignBinValue(const TVec< TInt > &SortedNId, const float BinFraction, TIntFtrH &LogBinFeatures)
Assigns logarithmic binning value to features.
void AddRecursiveFeatures(const PUNGraph Graph, TIntFtrH &Features)
Adds recursive features to the node-feature mapping.
bool IsSimilarFeature(const TFtr &F1, const TFtr &F2, const int SimilarityThreshold)
Whether the two features are similar, given similarity threshold.
void PrintMatrix(const TFltVV &Matrix)
Prints feature matrix to stdout.
void AppendFeatures(TIntFtrH &DstFeatures, const TIntFtrH &SrcFeatures, const int ColIdx=-1)
Appends all src features to dst features.
TIntFtrH SummarizeConnectedComponents(const PUNGraph FeatureGraph, const TIntFtrH &Features, const TIntFtrH &NewFeatures)
Summarizes s-friend graph and return retained features.
TIntIntH FindRoles(const TFltVV &G, const TIntIntH &NodeIdMtxIdxH)
Gets matrix index of the node ID.
THash< TInt, TFtr > TIntFtrH
The node-feature mapping: .
TIntFtrH PruneRecursiveFeatures(const PUNGraph Graph, const TIntFtrH &Features, const TIntFtrH &NewFeatures, const int SimilarityThreshold)
Prunes recursive features.
PUNGraph BuildFeatureGraph(const TIntFtrH &LogFeatures, const int SimilarityThreshold)
Builds s-friend graph given similarity threshold.
TIntFtrH CalcVerticalLogBinning(const TIntFtrH &Features, const float BinFraction)
Calculates vertical logarithmic binning features from the given features.
void FPrintRoles(const TIntIntH &Roles, const TStr &Path)
Prints found roles to file.
TFltVV ConvertFeatureToMatrix(const TIntFtrH &Features, const TIntIntH &NodeIdMtxIdxH)
Converts node-feature mapping to matrix. (i, j): i-th node, j-th feature.
void PrintFeatures(const TIntFtrH &Features)
Prints all nodes' feature.
TIntFtrH CreateEmptyFeatures(const PUNGraph Graph)
Creates an empty node-feature mapping of all nodes in the given graph.
int GetMtxIdx(const TInt NodeId, const TIntIntH &NodeIdMtxIdxH)
Gets matrix index of the node ID.
void FPrintNodeMappings(const TIntIntH &NodeIdMtxIdxH, const TStr &Path)
Prints node mappings to file, feature line -> node ID.
bool FltIsZero(const TFlt Number)
Whether the float is zero.
void AddEgonetFeatures(const PUNGraph Graph, TIntFtrH &Features)
Adds egonet features to the node-feature mapping.
TFltVV CreateRandMatrix(const int XDim, const int YDim)
Creates a random matrix with specified dimension.
void AddLocalFeatures(const PUNGraph Graph, TIntFtrH &Features)
Adds local features to the node-feature mapping.
void CalcNonNegativeFactorization(const TFltVV &V, const int NumRoles, TFltVV &W, TFltVV &H, const double Threshold)
Performs non-negative factorization V = WH. 2nd dim of W == number of roles.
TFlt CalcDescriptionLength(const TFltVV &V, const TFltVV &G, const TFltVV &F)
Calculates the description length L = M + E.
TIntIntH CreateNodeIdMtxIdxHash(const TIntFtrH &Features)
Creates the mapping of .
TVec< TInt > GetNIdSorted(const TIntFtrH &Feature, const int Idx)
Sorts the Idx-th feature, return the list of corresponding node ID.
void FPrintMatrix(const TFltVV &Matrix, const TStr &Path)
Prints feature matrix to file.
TVec< TFlt > TFtr
Feature of a node.
TFtr GetNthFeature(const TIntFtrH &Features, const int N)
Gets the n-th feature of all nodes.
void AddNeighborhoodFeatures(const PUNGraph Graph, TIntFtrH &Features)
Adds neighborhood features (local + egonet) to the node-feature mapping.
void PrintRoles(const TIntIntH &Roles)
Prints found roles on stdout.