-
Notifications
You must be signed in to change notification settings - Fork 17
Add databricks_automl to the conda env for arima and deepar #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6bb8b46
hardcode extra pip dependency
sabhya-db 4274b69
fix typo
sabhya-db 3a2cf30
add dep to arima and deepar
sabhya-db 9b4dac0
style fix
sabhya-db 79e2e60
reqs test
sabhya-db f4f3cad
test fix attemp 1
sabhya-db f3aebaa
deepar add dep test
sabhya-db 0f82e84
prophet test updated
sabhya-db 0060de6
small rename
sabhya-db ac27c97
address nits
sabhya-db 0930423
nit
sabhya-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,13 @@ | |
from mlflow.protos.databricks_pb2 import ErrorCode, INVALID_PARAMETER_VALUE | ||
from pmdarima.arima import ARIMA | ||
|
||
from databricks.automl_runtime.forecast.pmdarima.model import ArimaModel, MultiSeriesArimaModel, AbstractArimaModel, \ | ||
mlflow_arima_log_model | ||
from databricks.automl_runtime.forecast.pmdarima.model import ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please break imports into multiple lines: |
||
ArimaModel, | ||
MultiSeriesArimaModel, | ||
AbstractArimaModel, | ||
mlflow_arima_log_model, | ||
ARIMA_ADDITIONAL_PIP_DEPS, | ||
) | ||
|
||
|
||
class TestArimaModel(unittest.TestCase): | ||
|
@@ -438,6 +443,11 @@ def test_mlflow_arima_log_model(self): | |
|
||
# Load the saved model from mlflow | ||
run_id = run.info.run_id | ||
|
||
# Check additonal requirements logged correctly | ||
self._check_requirements(run_id) | ||
|
||
# Load the model | ||
loaded_model = mlflow.pyfunc.load_model(f"runs:/{run_id}/model") | ||
|
||
# Make sure can make forecasts with the saved model | ||
|
@@ -460,6 +470,11 @@ def test_mlflow_arima_log_model_multiseries(self): | |
|
||
# Load the saved model from mlflow | ||
run_id = run.info.run_id | ||
|
||
# Check additonal requirements logged correctly | ||
self._check_requirements(run_id) | ||
|
||
# Load the model | ||
loaded_model = mlflow.pyfunc.load_model(f"runs:/{run_id}/model") | ||
|
||
# Make sure can make forecasts with the saved model | ||
|
@@ -473,3 +488,12 @@ def test_mlflow_arima_log_model_multiseries(self): | |
|
||
# Make sure can make forecasts for one-row dataframe | ||
loaded_model.predict(test_df[0:1]) | ||
|
||
def _check_requirements(self, run_id: str): | ||
# read requirements.txt from the run | ||
requirements_path = mlflow.artifacts.download_artifacts(f"runs:/{run_id}/model/requirements.txt") | ||
with open(requirements_path, "r") as f: | ||
requirements = f.read() | ||
# check if all additional dependencies are logged | ||
for dependency in ARIMA_ADDITIONAL_PIP_DEPS: | ||
self.assertIn(dependency, requirements, f"requirements.txt should contain {dependency} but got {requirements}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if a method is being tested in a TestClass, make it a public method (i.e. without prefix _)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a unit test itself, it's a helper method called only within other unit test cases, should I still remove prefix?