Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions custom_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=====================