Skip to content

Commit

Permalink
Update type hint and consolidate init
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherbunn committed Aug 7, 2023
1 parent c683c2f commit 76cf807
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _set_forecast_horizon(self, X: pd.DataFrame):
)
return fh_

Check warning on line 116 in evalml/pipelines/components/estimators/regressors/varmax_regressor.py

View check run for this annotation

Codecov / codecov/patch

evalml/pipelines/components/estimators/regressors/varmax_regressor.py#L116

Added line #L116 was not covered by tests

def fit(self, X: pd.DataFrame, y: Optional[pd.Series] = None):
def fit(self, X: pd.DataFrame, y: Optional[pd.DataFrame] = None):
"""Fits VARMAX regressor to data.
Args:
Expand Down Expand Up @@ -171,7 +171,7 @@ def _manage_types_and_forecast(self, X: pd.DataFrame) -> tuple:
)
return X, fh_

Check warning on line 172 in evalml/pipelines/components/estimators/regressors/varmax_regressor.py

View check run for this annotation

Codecov / codecov/patch

evalml/pipelines/components/estimators/regressors/varmax_regressor.py#L172

Added line #L172 was not covered by tests

def predict(self, X: pd.DataFrame, y: Optional[pd.Series] = None) -> pd.Series:
def predict(self, X: pd.DataFrame, y: Optional[pd.DataFrame] = None) -> pd.Series:
"""Make predictions using fitted VARMAX regressor.
Args:
Expand Down
22 changes: 11 additions & 11 deletions evalml/tests/component_tests/test_varmax_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,18 @@ def test_different_time_units_out_of_sample(
def test_varmax_supports_boolean_features():
from sktime.forecasting.varmax import VARMAX

Check warning on line 206 in evalml/tests/component_tests/test_varmax_regressor.py

View check run for this annotation

Codecov / codecov/patch

evalml/tests/component_tests/test_varmax_regressor.py#L205-L206

Added lines #L205 - L206 were not covered by tests

X = pd.DataFrame({"dates": pd.date_range("2021-01-01", periods=10)})
X.ww.init()
X.ww["bool_1"] = (
pd.Series([True, False])
.sample(n=10, replace=True, random_state=0)
.reset_index(drop=True)
)
X.ww["bool_2"] = (
pd.Series([True, False])
.sample(n=10, replace=True, random_state=1)
.reset_index(drop=True)
X = pd.DataFrame(

Check warning on line 208 in evalml/tests/component_tests/test_varmax_regressor.py

View check run for this annotation

Codecov / codecov/patch

evalml/tests/component_tests/test_varmax_regressor.py#L208

Added line #L208 was not covered by tests
{
"dates": pd.date_range("2021-01-01", periods=10),
"bool_1": pd.Series([True, False])
.sample(n=10, replace=True, random_state=0)
.reset_index(drop=True),
"bool_2": pd.Series([True, False])
.sample(n=10, replace=True, random_state=1)
.reset_index(drop=True),
},
)
X.ww.init()
y = pd.DataFrame({"target_1": np.random.rand(10), "target_2": np.random.rand(10)})

Check warning on line 220 in evalml/tests/component_tests/test_varmax_regressor.py

View check run for this annotation

Codecov / codecov/patch

evalml/tests/component_tests/test_varmax_regressor.py#L219-L220

Added lines #L219 - L220 were not covered by tests

vx = VARMAXRegressor(time_index="dates")

Check warning on line 222 in evalml/tests/component_tests/test_varmax_regressor.py

View check run for this annotation

Codecov / codecov/patch

evalml/tests/component_tests/test_varmax_regressor.py#L222

Added line #L222 was not covered by tests
Expand Down

0 comments on commit 76cf807

Please sign in to comment.