3c8f5966e66f2222d2cfa3770d2ac923d254b61a,python/hypertools/_shared/helpers.py,,vals2colors,#Any#Any#Any#,25
Before Change
// rank the values and then normalize
ranks = list(map(lambda x: sum([val <= x for val in vals]),vals))
ranks = list(map(lambda rank: int(res*rank/len(vals)),ranks))
return [palette[rank-1] for rank in ranks]
// this will be moved to utils.py
def is_list(x):
After Change
// get palette from seaborn
palette = np.array(sns.color_palette(cmap, res))
ranks = np.digitize(vals, np.linspace(np.min(vals), np.max(vals)+1, res+1)) - 1
return palette[ranks, :]
// this will be moved to utils.py
def is_list(x):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: ContextLab/hypertools
Commit Name: 3c8f5966e66f2222d2cfa3770d2ac923d254b61a
Time: 2016-12-20
Author: andrew.heusser@gmail.com
File Name: python/hypertools/_shared/helpers.py
Class Name:
Method Name: vals2colors
Project Name: ContextLab/hypertools
Commit Name: 50f590603a1dd562453926edaab69267633b8455
Time: 2016-12-20
Author: andrew.heusser@gmail.com
File Name: python/hypertools/_shared/helpers.py
Class Name:
Method Name: vals2colors
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: eab3c82cabf192154e6f4e9d16615885c7eefc14
Time: 2021-01-28
Author: abigailt@il.ibm.com
File Name: art/metrics/privacy/membership_leakage.py
Class Name:
Method Name: PDTP