From 19134274f35cd55b7a0f154938a99c96a4dd8fd4 Mon Sep 17 00:00:00 2001 From: Arjun-E-Naik Date: Wed, 6 Aug 2025 13:30:47 +0530 Subject: [PATCH] Update custom_definitions.py --- custom_definitions.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/custom_definitions.py b/custom_definitions.py index b331731..a8dcc6e 100644 --- a/custom_definitions.py +++ b/custom_definitions.py @@ -19,3 +19,25 @@ # Your code #==============Your Name===================== #Dont remove the following snippet and follow the same + +#==============Arjun E Naik===================== +class Features(BaseEstimator, TransformerMixin): + def __init__(self): + pass + + def fit(self, X, y=None): + return self + + def transform(self, X, y=None): + X_copy = X.copy() + + + if 'depth_percentage' not in X_copy.columns or 'table_percentage' not in X_copy.columns: + raise ValueError("Both 'depth_percentage' and 'table_percentage' must be in the input data to compute density.") + + + X_copy['depth_table_ratio'] = X_copy['depth_percentage'] / (X_copy['table_percentage'].replace(0, np.nan)) + return X_copy + + +#==============Arjun E Naik=====================