Skip to content

Instantly share code, notes, and snippets.

View cisdeli's full-sized avatar
🤠
Howdy partner

Pedro Henrique Cisdeli cisdeli

🤠
Howdy partner
View GitHub Profile
@cisdeli
cisdeli / train_test_reg_models.py
Created October 24, 2025 14:45
Train Test Reg Models
def train_evaluate_regression_models(df, numeric_features, categorical_features, target_column, test_size=0.2, random_state=42, metric='r_squared'):
"""
Train and evaluate multiple regression models on the given dataset.
Parameters:
-----------
df : pandas.DataFrame
The input dataframe containing the features and target variable
numeric_features : list
List of column names that are numeric features