Problem
Many functions in src/model/models.py lack proper docstrings or have minimal documentation. This makes it hard for new contributors to understand function parameters, return values, and usage.
Proposed Solution
Add comprehensive Google-style docstrings to all functions including:
- Function description
- Args with types
- Returns with types
- Raises (if applicable)
- Examples
Functions to Document
normalize_features()
plot_feature_importance()
plot_loss_curve()
train_linear_regression()
train_ridge_regression()
- And all other training functions
Example
def normalize_features(X):
"""
Normalize features into different ranges for model training.
Args:
X (pd.DataFrame): Input features containing coordinates, distances,
precipitation, time features, and flags
Returns:
pd.DataFrame: Normalized features with:
- Coordinates scaled to (-1, 1)
- Distances scaled to (0, 10)
- Precipitation scaled to (0, 1)
- Time features scaled to (0, 5)
Examples:
>>> X_normalized = normalize_features(train_df.drop('duration', axis=1))
"""
Problem
Many functions in
src/model/models.pylack proper docstrings or have minimal documentation. This makes it hard for new contributors to understand function parameters, return values, and usage.Proposed Solution
Add comprehensive Google-style docstrings to all functions including:
Functions to Document
normalize_features()plot_feature_importance()plot_loss_curve()train_linear_regression()train_ridge_regression()Example