From 5a7aa7025cc3a8056e146e49eac89b0a5f925f65 Mon Sep 17 00:00:00 2001 From: jh-206 Date: Mon, 23 Sep 2024 15:44:15 -0600 Subject: [PATCH] Update other ML models --- fmda/moisture_models.py | 10 ++++++++-- fmda/params.yaml | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/fmda/moisture_models.py b/fmda/moisture_models.py index 32c0a2e..e8a7f32 100644 --- a/fmda/moisture_models.py +++ b/fmda/moisture_models.py @@ -2,6 +2,12 @@ import numpy as np import math import matplotlib.pyplot as plt import copy +from abc import ABC, abstractmethod +import xgboost as xg +from xgboost import XGBRegressor +from sklearn.metrics import mean_squared_error +import pandas as pd +from sklearn.ensemble import RandomForestRegressor # ODE + Augmented Kalman Filter Code #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -214,9 +220,9 @@ class MLModel(ABC): def eval(self, X_test, y_test): preds = self.predict(X_test) rmse = np.sqrt(mean_squared_error(y_test, preds)) - rmse_ros = np.sqrt(mean_squared_error(ros_3wind(y_test), ros_3wind(preds))) + # rmse_ros = np.sqrt(mean_squared_error(ros_3wind(y_test), ros_3wind(preds))) print(f"Test RMSE: {rmse}") - print(f"Test RMSE (ROS): {rmse_ros}") + # print(f"Test RMSE (ROS): {rmse_ros}") return rmse, rmse_ros class XGB(MLModel): diff --git a/fmda/params.yaml b/fmda/params.yaml index 34effd1..2aa308d 100644 --- a/fmda/params.yaml +++ b/fmda/params.yaml @@ -134,7 +134,8 @@ xgb: scale_pos_weight: 1 n_estimators: 100 gamma: .1 - + scaler: 'standard' + features_list: ['Ed', 'Ew', 'solar', 'wind', 'rain'] ### Params sent by Schreck, slow and less accurate for this dataset # objective: "reg:squarederror" @@ -165,7 +166,8 @@ rf: lm: fit_intercept: true - + scaler: null + features_list: ['Ed', 'Ew', 'solar', 'wind', 'rain'] -- 2.11.4.GIT