gammagl.models.GEstimationN

class GEstimationN(data)[source]

Provide adjacency matrix estimation implementation based on the Expectation-Maximization(EM) algorithm.

Parameters:
  • E (numpy.array)

  • nodes. (The actual observed number of edges between every pair of)

reset_obs()[source]
update_obs(output)[source]
revise_pred()[source]
E_step(Q)[source]

Run the Expectation(E) step of the EM algorithm.

Parameters:

Q (numpy.array) – The current estimation that each edge is actually present

Returns:

  • alpha (float) – The estimation of true-positive rate

  • beta (float) – The estimation of false-positive rate

  • O (numpy.array) – The estimation of network model parameters

M_step(alpha, beta, O)[source]

Run the Maximization(M) step of the EM algorithm.

EM(output, tolerance=1e-06)[source]

Run the complete EM algorithm.

Parameters:
  • tolerance (float) – Determine the tolerance in the variantions of alpha, beta and O, which is acceptable to stop iterating

  • seed (int) – seed for np.random.seed

Returns:

iterations – The number of iterations to achieve the tolerance on the parameters

Return type:

int