File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,7 @@ def __init__(self, data):
40
40
self .num_backtests = data .meta_code_id .nunique ()
41
41
42
42
# Which algos correspond to which authors?
43
- df = (data .sort_values (['meta_user_id' ,
44
- 'meta_algorithm_id' ,
45
- 'meta_code_id' ])
46
- .loc [:, ['meta_user_id' , 'meta_algorithm_id' ]]
43
+ df = (data .loc [:, ['meta_user_id' , 'meta_algorithm_id' ]]
47
44
.drop_duplicates (subset = 'meta_algorithm_id' , keep = 'first' )
48
45
.reset_index ()
49
46
.meta_user_id
@@ -200,7 +197,12 @@ def fit_authors(data,
200
197
if sampler_type not in {'mcmc' , 'vi' }:
201
198
raise ValueError ("sampler_type not in {'mcmc', 'vi'}" )
202
199
200
+ # Check data and sort
203
201
_check_data (data )
202
+ data = (data .sort_values (['meta_user_id' ,
203
+ 'meta_algorithm_id' ,
204
+ 'meta_code_id' ])
205
+ .reset_index (drop = True ))
204
206
205
207
if seed is None :
206
208
seed = int (random .getrandbits (31 ))
You can’t perform that action at this time.
0 commit comments