fraudar.export package

Submodules

fraudar.export.MinTree module

class fraudar.export.MinTree.MinTree(degrees)[source]

A tree data structure which stores a list of degrees and can quickly retrieve the min degree element, or modify any of the degrees, each in logarithmic time. It works by creating a binary tree with the given elements in the leaves, where each internal node stores the min of its two children.

changeVal(idx, delta)[source]
dump(output=<open file '<stdout>', mode 'w'>)[source]
getMin()[source]

fraudar.export.greedy module

contains functions that run the greedy detector for dense regions in a sparse matrix. use aveDegree or sqrtWeightedAveDegree or logWeightedAveDegree on a sparse matrix, which returns ((rowSet, colSet), score) for the most suspicious block.

fraudar.export.greedy.aveDegree(M)[source]
fraudar.export.greedy.c2Score(M, rowSet, colSet)[source]
fraudar.export.greedy.detectMultiple(M, detectFunc, numToDetect)[source]
fraudar.export.greedy.fastGreedyDecreasing(M, colWeights)[source]
fraudar.export.greedy.getFMeasure(pred, actual)[source]
fraudar.export.greedy.getPrecision(pred, actual)[source]
fraudar.export.greedy.getRecall(pred, actual)[source]
fraudar.export.greedy.getRowFMeasure(pred, actual, idx)[source]
fraudar.export.greedy.getRowPrecision(pred, actual, idx)[source]
fraudar.export.greedy.getRowRecall(pred, actual, idx)[source]
fraudar.export.greedy.injectCliqueCamo(M, m0, n0, p, testIdx)[source]
fraudar.export.greedy.jaccard(pred, actual)[source]
fraudar.export.greedy.listToSparseMatrix(edgesSource, edgesDest)[source]

given a list of lists where each row is an edge, this returns the sparse matrix representation of the data.

fraudar.export.greedy.logWeightedAveDegree(M)[source]
fraudar.export.greedy.readData(filename)[source]

reads matrix from file and returns sparse matrix.

first 2 columns should be row and column indices of ones.

fraudar.export.greedy.shuffleMatrix(M)[source]

randomly shuffle the rows and columns.

fraudar.export.greedy.sqrtWeightedAveDegree(M)[source]
fraudar.export.greedy.subsetAboveDegree(M, col_thres, row_thres)[source]

fraudar.export.run_greedy module

fraudar.export.testMinTree module