mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-20 22:38:10 +00:00
Feature(Speed): Python launches faster by conditionally importing models. (#169)
* feat: Added optional import of models. * fix: Models weren't wrapped into abstract class, fixed it. * chore: Deleted leftover comments. * fix: Same merge commit as on remote. * fix: System wasn't putting in RF because there was no differentiation between RF as regressor and RF as classificator. * fix(Models): use the XGBoostModel wrapper Co-authored-by: Daniel Szemerey <szemereydaniel@gmail.com> Co-authored-by: Mark Aron Szulyovszky <mark.szulyovszky@gmail.com>
This commit is contained in:
co-authored by
Daniel Szemerey
Mark Aron Szulyovszky
parent
797d45d036
commit
31dc847be1
@@ -3,7 +3,7 @@ from utils.helpers import random_string, equal_except_nan, drop_until_first_vali
|
||||
from training.primary_model import train_primary_model
|
||||
from feature_selection.feature_selection import select_features
|
||||
import pandas as pd
|
||||
from models.model_map import default_feature_selector_regression, default_feature_selector_classification
|
||||
from models.model_map import get_model_map
|
||||
from models.base import Model
|
||||
from reporting.types import Reporting
|
||||
from typing import Union
|
||||
@@ -23,7 +23,7 @@ def train_meta_labeling_model(
|
||||
preloaded_models: Union[list[Reporting.Single_Model], None] = None
|
||||
) -> tuple[pd.Series, pd.Series, pd.DataFrame, list[Reporting.Single_Model]]:
|
||||
|
||||
|
||||
_, _, _, default_feature_selector_regression, default_feature_selector_classification = get_model_map(model_config)
|
||||
discretize = discretize_threeway_threshold(0.33)
|
||||
discretized_predictions = input_predictions.apply(discretize)
|
||||
meta_y: pd.Series = pd.concat([discretized_predictions, y], axis=1).apply(equal_except_nan, axis = 1)
|
||||
|
||||
Reference in New Issue
Block a user