maxfuse.spatial_utils.bind_spatial

maxfuse.spatial_utils.bind_spatial(features, nbhd, wt_on_features=0.7)[source]

Return a new array of form [wt_on_features * features / feature_norm, (1-wt_on_features) * nbhd / nbhd_norm]

Parameters:
  • features (np.ndarray of shape (n_samples, n_features)) – Feature matrix

  • nbhd (np.ndarray of shape (n_samples, n_clusters)) – Cell neighborhood composition matrix

  • wt_on_features (float, default=0.7) – Weight to put on the feature matrix.

Returns:

res (np.ndarray of shape (n_samples, n_features+n_clusters))