Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Fix grammar / wording in 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fa9r committed Feb 2, 2023
1 parent 131bfc1 commit 7276ba9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion 1-1_Pipelines.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
" X_train: np.ndarray,\n",
" y_train: np.ndarray,\n",
") -> ClassifierMixin:\n",
" \"\"\"Train a sklearn SVC classifier.\"\"\"\n",
" \"\"\"Train an sklearn SVC classifier.\"\"\"\n",
" model = SVC(gamma=0.001)\n",
" model.fit(X_train, y_train)\n",
" return model\n",
Expand Down
2 changes: 1 addition & 1 deletion 1-2_Artifact_Lineage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
" X_train: np.ndarray,\n",
" y_train: np.ndarray,\n",
") -> ClassifierMixin:\n",
" \"\"\"Train a sklearn decision tree classifier.\"\"\"\n",
" \"\"\"Train an sklearn decision tree classifier.\"\"\"\n",
" model = DecisionTreeClassifier()\n",
" model.fit(X_train, y_train)\n",
" return model\n",
Expand Down
12 changes: 6 additions & 6 deletions 2-1_Experiment_Tracking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"# Register the MLflow experiment tracker\n",
"!zenml experiment-tracker register mlflow_tracker --flavor=mlflow\n",
"\n",
"# Create a new stack with MLflow experiment tracker in it\n",
"# Create a new stack that includes an MLflow experiment\n",
"!zenml stack register mlflow_exp_tracker_stack -a default -o default -e mlflow_tracker\n",
"\n",
"# Set the new stack as active\n",
Expand Down Expand Up @@ -152,7 +152,7 @@
"\n",
"To integrate the MLFlow experiment tracker into our previously defined ZenML pipeline, we only need to adjust the `svc_trainer` step. Let us define a new `svc_trainer_mlflow` step in which we use MLflow's [`mlflow.sklearn.autolog()`](https://www.mlflow.org/docs/latest/python_api/mlflow.sklearn.html#mlflow.sklearn.autolog) feature to automatically log all relevant attributes and metrics of our model to MLflow. \n",
"\n",
"By adding an `experiment_tracker=mlflow_tracker` parameter in the `@step` decorator, ZenML automatically takes care of correctly initializing MLflow."
"By adding an `experiment_tracker=mlflow_tracker` parameter in the `@step` decorator, ZenML automatically takes care of initializing MLflow."
]
},
{
Expand All @@ -172,7 +172,7 @@
" X_train: np.ndarray,\n",
" y_train: np.ndarray,\n",
") -> ClassifierMixin:\n",
" \"\"\"Train a sklearn SVC classifier and log to MLflow.\"\"\"\n",
" \"\"\"Train an sklearn SVC classifier and log to MLflow.\"\"\"\n",
" mlflow.sklearn.autolog() # log all model hparams and metrics to MLflow\n",
" model = SVC(gamma=1e-3)\n",
" model.fit(X_train, y_train)\n",
Expand Down Expand Up @@ -205,7 +205,7 @@
" X_train: np.ndarray,\n",
" y_train: np.ndarray,\n",
") -> ClassifierMixin:\n",
" \"\"\"Train a sklearn decision tree classifier and log to MLflow.\"\"\"\n",
" \"\"\"Train an sklearn decision tree classifier and log to MLflow.\"\"\"\n",
" mlflow.sklearn.autolog() # log all model hparams and metrics to MLflow\n",
" model = DecisionTreeClassifier()\n",
" model.fit(X_train, y_train)\n",
Expand Down Expand Up @@ -319,7 +319,7 @@
"# Register the W&B experiment tracker\n",
"!zenml experiment-tracker register wandb_tracker --flavor=wandb --api_key={WANDB_API_KEY} --entity={WANDB_ENTITY} --project_name={WANDB_PROJECT}\n",
"\n",
"# Create a new stack with W&B experiment tracker in it\n",
"# Create a new stack that includes a W&B experiment tracker\n",
"!zenml stack register wandb_stack -a default -o default -e wandb_tracker\n",
"\n",
"# Set the new stack as active\n",
Expand Down Expand Up @@ -360,7 +360,7 @@
" X_train: np.ndarray,\n",
" y_train: np.ndarray,\n",
") -> ClassifierMixin:\n",
" \"\"\"Train a sklearn SVC classifier and log to W&B.\"\"\"\n",
" \"\"\"Train an sklearn SVC classifier and log to W&B.\"\"\"\n",
" gamma = 1e-3\n",
" wandb.log({\"gamma\": gamma}) # log gamma hparam to wandb\n",
" model = SVC(gamma=gamma)\n",
Expand Down
4 changes: 2 additions & 2 deletions steps/mlflow_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def svc_trainer_mlflow(
X_train: np.ndarray,
y_train: np.ndarray,
) -> ClassifierMixin:
"""Train a sklearn SVC classifier and log to MLflow."""
"""Train an sklearn SVC classifier and log to MLflow."""
mlflow.sklearn.autolog() # log all model hparams and metrics to MLflow
model = SVC(gamma=0.001)
model.fit(X_train, y_train)
Expand All @@ -23,7 +23,7 @@ def tree_trainer_with_mlflow(
X_train: np.ndarray,
y_train: np.ndarray,
) -> ClassifierMixin:
"""Train a sklearn decision tree classifier and log to MLflow."""
"""Train an sklearn decision tree classifier and log to MLflow."""
mlflow.sklearn.autolog() # log all model hparams and metrics to MLflow
model = DecisionTreeClassifier()
model.fit(X_train, y_train)
Expand Down
4 changes: 2 additions & 2 deletions steps/sklearn_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def svc_trainer(
X_train: np.ndarray,
y_train: np.ndarray,
) -> ClassifierMixin:
"""Train a sklearn SVC classifier."""
"""Train an sklearn SVC classifier."""
model = SVC(gamma=0.001)
model.fit(X_train, y_train)
return model
Expand All @@ -23,7 +23,7 @@ def tree_trainer(
X_train: np.ndarray,
y_train: np.ndarray,
) -> ClassifierMixin:
"""Train a sklearn decision tree classifier."""
"""Train an sklearn decision tree classifier."""
model = DecisionTreeClassifier()
model.fit(X_train, y_train)
return model

0 comments on commit 7276ba9

Please sign in to comment.