6d6a32dd677aa6097c4e77b359f81989c3e949af,src/pyscenic/rnkdb.py,,build_rankings,#,439
Before Change
result = np.full(shape=(n_features, n_identifiers), fill_value=rank_unknown, dtype=INVERTED_DB_DTYPE)
for row_idx in prange(n_features):
ranked_identifiers4feature = ranked_identifiers[row_idx, :] // The values of a row are the identifiers
ranks = np.array([np .where(ranked_identifiers4feature == elem)[0] for elem in reference_identifiers], dtype=INVERTED_DB_DTYPE)
col_idxs = np.nonzero(reference_identifiers.isin(ranked_identifiers4feature))
result[row_idx, col_idxs] = ranks
return result
After Change
n_features = ranked_identifiers.shape[0]; n_identifiers = len(reference_identifiers)
result = np.empty(shape=(n_features, n_identifiers), dtype=INVERTED_DB_DTYPE)
for row_idx in prange(n_features):
for col_idx in range(n_identifiers):
// TODO: Currently doing brute-force linear search at near C-speed. Time complexity could be greatly reduced
// TODO: if resorting to binary search or something similar [from O(N) to O(log2(N)) where N is 50k, i.e. top N features]
result[row_idx, col_idx] = find(ranked_identifiers[row_idx, :], reference_identifiers[col_idx], rank_unknown)
return result
def convert2feather(fname: str, out_folder: str, name: str, extension: str="feather") -> str:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: aertslab/pySCENIC
Commit Name: 6d6a32dd677aa6097c4e77b359f81989c3e949af
Time: 2018-04-05
Author: vandesande.bram@gmail.com
File Name: src/pyscenic/rnkdb.py
Class Name:
Method Name: build_rankings
Project Name: rasbt/mlxtend
Commit Name: cec517350d259a4f49a58a769db784c248cfffa8
Time: 2021-01-08
Author: mail@sebastianraschka.com
File Name: mlxtend/evaluate/accuracy.py
Class Name:
Method Name: accuracy_score
Project Name: deepmind/ai-safety-gridworlds
Commit Name: c43cb31143431421b5d2b661a2458efb301da9a3
Time: 2020-10-13
Author: miljanm@google.com
File Name: ai_safety_gridworlds/environments/side_effects_sokoban.py
Class Name: BoxSprite
Method Name: _calculate_wall_penalty