Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 3952724

Browse files
authored
Merge pull request #234 from christabella/patch-1
Fix model loading for later versions of XGBoost.
2 parents 7917635 + ca90c1a commit 3952724

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc_source/define-pipeline.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ This section shows how to create a processing step to evaluate the accuracy of
406406
with tarfile.open(model_path) as tar:
407407
tar.extractall(path=".")
408408
409-
model = pickle.load(open("xgboost-model", "rb"))
409+
model = xgboost.Booster()
410+
model.load_model("xgboost-model")
410411
411412
test_path = "/opt/ml/processing/test/test.csv"
412413
df = pd.read_csv(test_path, header=None)
@@ -680,4 +681,4 @@ A step can only appear once in either the pipeline's step list or the if/else st
680681

681682
This pipeline definition is ready to submit to SageMaker\. In the next tutorial, you submit this pipeline to SageMaker and start an execution\.
682683

683-
**Next step:** [Run a pipeline](run-pipeline.md)
684+
**Next step:** [Run a pipeline](run-pipeline.md)

0 commit comments

Comments
 (0)