I/O functions

regrank.io.D_operator(s)[source]
regrank.io.D_operator_b(a)[source]
regrank.io.D_operator_b_sparse(a)[source]
regrank.io.D_operator_reg(a, s)[source]
regrank.io.D_operator_reg_sparse(a, s)[source]
regrank.io.D_operator_reg_t(a, s)[source]
regrank.io.D_operator_reg_t_sparse(a, s)[source]
regrank.io.add_erroneous_edges(g, nid=0, times=1, method='single_point_mutation')[source]
regrank.io.cast2sum_squares_form(data, alpha, regularization=True)[source]

This is how we linearize the objective function: B_ind i j 0 0 1 1 0 2 2 0 3 3 1 0 4 1 2 5 1 3 6 2 0 … 11 3 2 12 0 0 13 1 1 14 2 2 15 3 3

regrank.io.cast2sum_squares_form_t(g, alpha, lambd, from_year=1960, to_year=1961, top_n=70, separate=False)[source]

Operator to linearize the sum of squares loss function.

Args:

g (_type_): _description_ alpha (_type_): _description_ lambd (_type_): _description_ from_year (int, optional): _description_. Defaults to 1960. to_year (int, optional): _description_. Defaults to 1961. top_n (int, optional): _description_. Defaults to 70. separate (bool, optional): _description_. Defaults to False.

Raises:

ValueError: _description_ ValueError: _description_ TypeError: _description_

Returns:

_type_: _description_

regrank.io.compute_Bt_B_inv(B)[source]
regrank.io.compute_cache_from_data(data, alpha, regularization=True, **kwargs)[source]

_summary_

Args:

data (_type_): _description_

alpha (_type_): _description_

regularization (bool, optional): _description_. Defaults to True.

Returns:

dictionary: _description_

regrank.io.compute_cache_from_data_t(data, alpha=1, lambd=1, from_year=1960, to_year=1961, top_n=70)[source]
regrank.io.compute_ell(g, key=None)[source]
regrank.io.compute_spearman_correlation(g, s)[source]
regrank.io.filter_by_time(g, time)[source]
regrank.io.filter_by_year(g, from_year=1946, to_year=2006, top_n=70)[source]
regrank.io.grad_g_star(B, b, v)[source]
regrank.io.implicit2explicit(f, a, m, n)[source]

assumes f(x) is a linear operator (x has size n) so it can be represented f(x) = A*x for some matrix x (for now, assume A is square for simplicity) A = A * identity