past.Utils.spatial_prior_graph

past.Utils.spatial_prior_graph(feature_matrix, k_neighbors, v=1)

Construct spatial prior graph for metric learning

Parameters:
  • feature_matrix – spatial corrdinate matrix

  • k_neighbors – number of neighbors to construct graph

  • v – scale factor in student’s t kernel

Returns:

spatial graph of sparse matrix format

Return type:

scipy.sparse.csr_matrx