Skip to content

Commit

Permalink
Add Xgboost regressor
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasMeissnerDS committed Nov 27, 2023
1 parent 76c8365 commit 4e4ba73
Show file tree
Hide file tree
Showing 2 changed files with 831 additions and 0 deletions.
27 changes: 27 additions & 0 deletions bluecast/ml_modelling/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,30 @@ def predict(self, df: pd.DataFrame) -> Tuple[PredictedProbas, PredictedClasses]:
:return tuple of predicted probabilities and predicted classes
"""
pass


class BaseClassMlRegressionModel(ABC):
"""Base class for all ML models.
Enforces the implementation of the fit and predict methods.
If hyperparameter tuning is required, then the fit method should implement the tuning.
"""

@abstractmethod
def fit(
self,
x_train: pd.DataFrame,
x_test: pd.DataFrame,
y_train: pd.Series,
y_test: pd.Series,
) -> Optional[Any]:
pass

@abstractmethod
def predict(self, df: pd.DataFrame) -> np.ndarray:
"""
Predict on unseen data.
:return tuple of predicted probabilities and predicted classes
"""
pass
Loading

0 comments on commit 4e4ba73

Please sign in to comment.