mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-13 02:48:07 +00:00
refactor(Naming): use new convention, added Ensemble model parameter back, support multiple Meta-Labeling models (#132)
* refactor(Naming): use `primary_models` & `meta_labeling_models` * refactor(Naming): using primary * meta_labeling across config and in pipeline * feat(Pipeline): added back Ensemble models * fix(Pipeline): compiler error * fix(Config): typo * chore(Pipeline): removed unused averaging step * revert the changes in discretizing * chore(Pipeline): remove sharpe improvement logging * fix(Pipeline): ensemble predictions should be a pd.Series instead of a DataFrame * fix(Pipeline): discard unnecessary ensemble_probabilities * fix(Pipeline): fixes regarding various meta-labeling ensemble bugs * fix(Reporting): use the new naming convention * fix(Reporting): use the right variable * feat(Sweep): new sweep for ensemble models * fix(Sweep): config reference * fix(Config): simplified dev config * fix(Models): use the faster LR model * fix(Models): use LGBM in the meta-labeling model for speed * fix(Selection): always use the first model for feature selection, commented out caching from select_features() as it's close to redundant in terms of speed
This commit is contained in:
+4
-2
@@ -37,6 +37,7 @@ def evaluate_predictions(
|
||||
y_true: pd.Series,
|
||||
method: Literal['classification', 'regression'],
|
||||
no_of_classes: Literal['two', 'three-balanced', 'three-imbalanced'],
|
||||
print_results: bool,
|
||||
discretize: bool = False,
|
||||
) -> pd.Series:
|
||||
# ignore the predictions until we see a non-zero returns (and definitely skip the first sliding_window_size)
|
||||
@@ -100,8 +101,9 @@ def evaluate_predictions(
|
||||
# scorecard.loc['edge_to_mae'] = 0.
|
||||
|
||||
scorecard = scorecard.round(3)
|
||||
print("Model name: ", model_name)
|
||||
print(scorecard)
|
||||
if print_results:
|
||||
print("Model name: ", model_name)
|
||||
print(scorecard)
|
||||
return scorecard
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ def flatten(list_of_lists: list) -> list:
|
||||
return [item for sublist in list_of_lists for item in sublist]
|
||||
|
||||
def weighted_average(df: pd.DataFrame, weights_source: str) -> pd.Series:
|
||||
if df.shape[0] == 0:
|
||||
if df.shape[1] == 0:
|
||||
return df
|
||||
mean_df = df.iloc[:,0]
|
||||
weights = df.loc[weights_source]
|
||||
|
||||
Reference in New Issue
Block a user