Initial clean commit
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
'''
|
||||
Filename: models.py
|
||||
Path: /home/netoa/Desktop/ISR/scripts
|
||||
Created Date: Monday March 24th 2025
|
||||
Author: Andre Neto
|
||||
-----
|
||||
Last Modified: Tue Mar 25 2025
|
||||
Modified By: Andre Neto
|
||||
-----
|
||||
Copyright (c) 2025 Institute of Systems and Robotics
|
||||
'''
|
||||
|
||||
from sklearn.linear_model import LinearRegression, Ridge
|
||||
from sklearn.ensemble import RandomForestRegressor
|
||||
from sklearn.svm import SVR
|
||||
|
||||
|
||||
def get_models():
|
||||
"""Return dictionary of regression models for fusion pipeline."""
|
||||
|
||||
models = {
|
||||
"LinearRegression": LinearRegression(),
|
||||
"Ridge": Ridge(alpha=1.0),
|
||||
"RandomForest": RandomForestRegressor(n_estimators=200, max_depth=None, random_state=42),
|
||||
"SVR": SVR(kernel="rbf")
|
||||
}
|
||||
|
||||
# Optional: XGBoost
|
||||
try:
|
||||
from xgboost import XGBRegressor
|
||||
models["XGBoost"] = XGBRegressor(
|
||||
n_estimators=200,
|
||||
max_depth=None,
|
||||
learning_rate=0.05,
|
||||
reg_alpha=0.1,
|
||||
reg_lambda=0.1,
|
||||
subsample=0.8,
|
||||
colsample_bytree=0.8,
|
||||
random_state=42
|
||||
)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
# Optional: LightGBM
|
||||
try:
|
||||
from lightgbm import LGBMRegressor
|
||||
models["LightGBM"] = LGBMRegressor(
|
||||
n_estimators=200,
|
||||
max_depth=None,
|
||||
learning_rate=0.05,
|
||||
reg_alpha=0.1,
|
||||
reg_lambda=0.1,
|
||||
subsample=0.8,
|
||||
colsample_bytree=0.8,
|
||||
random_state=42
|
||||
)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
return models
|
||||
Reference in New Issue
Block a user