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
[#297] Complete Python SDK #299
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
mlflow.entities | ||
=============== | ||
|
||
.. automodule:: mlflow.entities | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
This file contains 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 |
---|---|---|
@@ -1,22 +1,48 @@ | ||
""" | ||
Provides the MLflow fluent API, allowing management of an active MLflow run. | ||
For example: | ||
|
||
.. code:: python | ||
|
||
import mlflow | ||
mlflow.start_run() | ||
mlflow.log_param("my", "param") | ||
mlflow.log_metric("score", 100) | ||
mlflow.end_run() | ||
|
||
You can also use syntax like this: | ||
|
||
.. code:: python | ||
|
||
with mlflow.start_run() as run: | ||
... | ||
|
||
which will automatically terminate the run at the end of the block. | ||
""" | ||
|
||
import os | ||
|
||
# pylint: disable=wrong-import-position | ||
import mlflow.projects as projects # noqa | ||
import mlflow.tracking as tracking # noqa | ||
import mlflow.tracking.fluent | ||
|
||
log_param = tracking.log_param | ||
log_metric = tracking.log_metric | ||
log_artifacts = tracking.log_artifacts | ||
log_artifact = tracking.log_artifact | ||
active_run = tracking.active_run | ||
start_run = tracking.start_run | ||
end_run = tracking.end_run | ||
get_artifact_uri = tracking.get_artifact_uri | ||
ActiveRun = mlflow.tracking.fluent.ActiveRun | ||
log_param = mlflow.tracking.fluent.log_param | ||
log_metric = mlflow.tracking.fluent.log_metric | ||
log_artifacts = mlflow.tracking.fluent.log_artifacts | ||
log_artifact = mlflow.tracking.fluent.log_artifact | ||
active_run = mlflow.tracking.fluent.active_run | ||
start_run = mlflow.tracking.fluent.start_run | ||
end_run = mlflow.tracking.fluent.end_run | ||
get_artifact_uri = mlflow.tracking.fluent.get_artifact_uri | ||
set_tracking_uri = tracking.set_tracking_uri | ||
get_tracking_uri = tracking.get_tracking_uri | ||
create_experiment = tracking.create_experiment | ||
create_experiment = mlflow.tracking.fluent.create_experiment | ||
|
||
|
||
run = projects.run | ||
|
||
__all__ = ["log_param", "log_metric", "log_artifacts", "log_artifact", "active_run", | ||
|
||
__all__ = ["ActiveRun", "log_param", "log_metric", "log_artifacts", "log_artifact", "active_run", | ||
"start_run", "end_run", "get_artifact_uri", "set_tracking_uri", "create_experiment"] |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""All entities returned by the MLflow REST API.""" | ||
|
||
from mlflow.entities.experiment import Experiment | ||
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. Could add a doc comment here too 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. Done |
||
from mlflow.entities.file_info import FileInfo | ||
from mlflow.entities.metric import Metric | ||
from mlflow.entities.param import Param | ||
from mlflow.entities.run import Run | ||
from mlflow.entities.run_data import RunData | ||
from mlflow.entities.run_info import RunInfo | ||
from mlflow.entities.run_status import RunStatus | ||
from mlflow.entities.run_tag import RunTag | ||
from mlflow.entities.source_type import SourceType | ||
|
||
__all__ = [ | ||
"Experiment", | ||
"FileInfo", | ||
"Metric", | ||
"Param", | ||
"Run", | ||
"RunData", | ||
"RunInfo", | ||
"RunStatus", | ||
"RunTag", | ||
"SourceType", | ||
] |
This file contains 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 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 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 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 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 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 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 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 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 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 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 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.
We should probably also update docs/source/tracking.rst to describe the two APIs, right?
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.
Documentation is important, and I would like to get that closely reviewed. Let me do that in a follow-up PR which I'll go ahead and draft.