File tree 1 file changed +2
-3
lines changed
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -2185,21 +2185,20 @@ def has_key(rv, key):
2185
2185
2186
2186
table = pd .DataFrame .from_dict (table_dict , orient = "index" )
2187
2187
table .sort_values (by = "cost" , inplace = True )
2188
+ table ["rank" ] = np .arange (1 , len (table .index ) + 1 )
2188
2189
2189
2190
# Check which resampling strategy is chosen and selecting the appropriate models
2190
2191
is_cv = self ._resampling_strategy == "cv"
2191
2192
models = self .cv_models_ if is_cv else self .models_
2192
2193
2193
- rank = 1 # Initializing rank for the first model
2194
2194
for (_ , model_id , _ ), model in models .items ():
2195
2195
model_dict = {} # Declaring model dictionary
2196
2196
2197
2197
# Inserting model_id, rank, cost and ensemble weight
2198
2198
model_dict ["model_id" ] = table .loc [model_id ]["model_id" ].astype (int )
2199
- model_dict ["rank" ] = rank
2199
+ model_dict ["rank" ] = table . loc [ model_id ][ " rank" ]. astype ( int )
2200
2200
model_dict ["cost" ] = table .loc [model_id ]["cost" ]
2201
2201
model_dict ["ensemble_weight" ] = table .loc [model_id ]["ensemble_weight" ]
2202
- rank += 1 # Incrementing rank by 1 for the next model
2203
2202
2204
2203
# The steps in the models pipeline are as follows:
2205
2204
# 'data_preprocessor': DataPreprocessor,
You can’t perform that action at this time.
0 commit comments