Skip to content

Commit

Permalink
Removing neuralprophet
Browse files Browse the repository at this point in the history
Summary: Removing neuralprophet in its own diff to isolate downstream impact

Differential Revision: D63468756

fbshipit-source-id: 8480bb727d3a38be762a58ada22f3df15faf18ac
  • Loading branch information
proof-by-accident authored and facebook-github-bot committed Oct 4, 2024
1 parent c255a5e commit 257e029
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 907 deletions.
21 changes: 2 additions & 19 deletions kats/models/metalearner/metalearner_hpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
from sklearn.model_selection import train_test_split

_MODELS = {
"neuralprophet",
"prophet",
"arima",
"sarima",
Expand All @@ -56,8 +55,6 @@ class DefaultModelParams:
theta_numerical_idx: List[str] = field(default_factory=list)
stlf_categorical_idx: List[str] = field(default_factory=list)
stlf_numerical_idx: List[str] = field(default_factory=list)
neuralprophet_categorical_idx: List[str] = field(default_factory=list)
neuralprophet_numerical_idx: List[str] = field(default_factory=list)
prophet_categorical_idx: List[str] = field(default_factory=list)
prophet_numerical_idx: List[str] = field(default_factory=list)
cusum_categorical_idx: List[str] = field(default_factory=list)
Expand All @@ -81,14 +78,6 @@ def __init__(self) -> None:
self.theta_numerical_idx = []
self.stlf_categorical_idx = ["method", "m"]
self.stlf_numerical_idx = []
self.neuralprophet_categorical_idx = [
"yearly_seasonality",
"weekly_seasonality",
"daily_seasonality",
"seasonality_mode",
"changepoints_range",
]
self.neuralprophet_numerical_idx = []
self.prophet_categorical_idx = [
"yearly_seasonality",
"weekly_seasonality",
Expand Down Expand Up @@ -126,9 +115,6 @@ class DefaultModelNetworks:
stlf_n_hidden_shared: List[int] = field(default_factory=list)
stlf_n_hidden_cat_combo: List[List[int]] = field(default_factory=list)
stlf_n_hidden_num: List[int] = field(default_factory=list)
neuralprophet_n_hidden_shared: List[int] = field(default_factory=list)
neuralprophet_n_hidden_cat_combo: List[List[int]] = field(default_factory=list)
neuralprophet_n_hidden_num: List[int] = field(default_factory=list)
prophet_n_hidden_shared: List[int] = field(default_factory=list)
prophet_n_hidden_cat_combo: List[List[int]] = field(default_factory=list)
prophet_n_hidden_num: List[int] = field(default_factory=list)
Expand All @@ -155,9 +141,6 @@ def __init__(self) -> None:
self.stlf_n_hidden_shared = [20]
self.stlf_n_hidden_cat_combo = [[5], [5]]
self.stlf_n_hidden_num = []
self.neuralprophet_n_hidden_shared = [40]
self.neuralprophet_n_hidden_cat_combo = [[5], [5], [2], [3], [5]]
self.neuralprophet_n_hidden_num = []
self.prophet_n_hidden_shared = [40]
self.prophet_n_hidden_cat_combo = [[5], [5], [2], [3], [5], [5], [5]]
self.prophet_n_hidden_num = []
Expand Down Expand Up @@ -187,7 +170,7 @@ class MetaLearnHPT:
categorical_idx: Optional; A list of strings of the names of the categorical hyper-parameters. Default is None.
numerical_idx: Optional; A list of strings of the names of the numerical hyper-parameters. Default is None.
default_model: Optional; A string of the name of the forecast model whose default settings will be used.
Can be 'arima', 'sarima', 'theta', 'neuralprophet', 'prophet', 'holtwinters', 'stlf' or None. Default is None.
Can be 'arima', 'sarima', 'theta', 'prophet', 'holtwinters', 'stlf' or None. Default is None.
scale: Optional; A boolean to specify whether or not to normalize time series features to zero mean and unit variance. Default is True.
load_model: Optional; A boolean to specify whether or not to load a trained model. Default is False.
Expand Down Expand Up @@ -259,7 +242,7 @@ def __init__(
categorical_idx = getattr(default_model_params, categorical_idx_var)
numerical_idx = getattr(default_model_params, numerical_idx_var)
else:
msg = f"default_model={default_model} is not available! Please choose one from 'neuralprophet', 'prophet', 'arima', 'sarima', 'holtwinters', 'stlf', 'theta', 'cusum', 'statsig'"
msg = f"default_model={default_model} is not available! Please choose one from 'prophet', 'arima', 'sarima', 'holtwinters', 'stlf', 'theta', 'cusum', 'statsig'"
raise _log_error(msg)

if (not numerical_idx) and (not categorical_idx):
Expand Down
528 changes: 0 additions & 528 deletions kats/models/neuralprophet.py

This file was deleted.

6 changes: 0 additions & 6 deletions kats/tests/models/test_metalearner.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from kats.models.metalearner.metalearner_hpt import MetaLearnHPT
from kats.models.metalearner.metalearner_modelselect import MetaLearnModelSelect
from kats.models.metalearner.metalearner_predictability import MetaLearnPredictability
from kats.models.neuralprophet import NeuralProphetModel, NeuralProphetParams
from kats.models.prophet import ProphetModel, ProphetParams
from kats.models.sarima import SARIMAModel, SARIMAParams
from kats.models.stlf import STLFModel, STLFParams
Expand Down Expand Up @@ -77,7 +76,6 @@
"arima": ARIMAModel,
"holtwinters": HoltWintersModel,
"sarima": SARIMAModel,
"neuralprophet": NeuralProphetModel,
"prophet": ProphetModel,
"stlf": STLFModel,
"theta": ThetaModel,
Expand Down Expand Up @@ -160,14 +158,12 @@ def generate_meta_data_by_model(model, n, d=num_features):
"sarima",
"theta",
"stlf",
"neuralprophet",
"prophet",
]
}

candidate_models = {
"holtwinters": HoltWintersModel,
"neuralprophet": NeuralProphetModel,
"prophet": ProphetModel,
"theta": ThetaModel,
"stlf": STLFModel,
Expand All @@ -176,7 +172,6 @@ def generate_meta_data_by_model(model, n, d=num_features):

candidate_params = {
"holtwinters": HoltWintersParams,
"neuralprophet": NeuralProphetParams,
"prophet": ProphetParams,
"theta": ThetaParams,
"stlf": STLFParams,
Expand Down Expand Up @@ -455,7 +450,6 @@ def test_default_models(self) -> None:
feature3.copy(),
)
for model in [
"neuralprophet",
"prophet",
"arima",
"sarima",
Expand Down
Loading

0 comments on commit 257e029

Please sign in to comment.