Skip to content

What is the difference between 2 types of xgboost usage? #1946

Closed

Description

@bilative

Hi,

I have a question like this:
What is the difference between

from sagemaker.amazon.amazon_estimator import get_image_uri
container = get_image_uri(region, 'xgboost', '1.0-1')

and this

from sagemaker.xgboost.estimator import XGBoost
estimator = XGBoost(entry_point = "your_xgboost_abalone_script.py", 
                    framework_version='1.0-1',
                    hyperparameters=hyperparameters,
                    role=sagemaker.get_execution_role(),
                    train_instance_count=1,
                    train_instance_type='ml.m5.2xlarge',
                    output_path=output_path)

What is the 2 type of usage difference?
Actually i mostly used sklearn until nowadays. And Sagemaker's logic little push me hard.
Thanks in advance.

Activity

  1. ajaykarpur commented on Oct 8, 2020

    @ajaykarpur
    Contributor

    Hi @bilative, which version of the SageMaker Python SDK are you using? You can check the version with sagemaker.__version__


    The get_image_uri functionality (as well as image_uris.retrieve in v2) is a utility that's used to create the container URI. This functionality is called by the XGBoost class to construct the container URI.

    Instead of calling get_image_uri, you can simply specify the framework_version as you did in the second code snippet. There is no need to create the URI yourself, as in the first snippet.

  2. bilative commented on Oct 9, 2020

    @bilative
    Author

    @ajaykarpur Thanks for the suggestion.
    I'll think about this.

    I checked my version and i saw that "1.72.1" After you said this to me, i realised on the built in xgboost websize SDK1 and SDK2 options of the usage.

    Do you know anything about, are there any speed difference between uri version, SDK1 version or SDK2 version. Or there is no difference except usage?

  3. ajaykarpur commented on Oct 9, 2020

    @ajaykarpur
    Contributor

    Sure thing. You may also want to take a look at these two documentation pages:

    Do you know anything about, are there any speed difference between uri version, SDK1 version or SDK2 version. Or there is no difference except usage?

    The only differences are related to usage, and these differences are highlighted in the above documentation page. We recommend upgrading to SDK v2. You can do so in the following manner:

    1. Upgrade the installed SDK version with pip install --upgrade sagemaker
    2. Use the automatic upgrade tool to automatically modify your existing code to work with SDK v2.
  4. locked and limited conversation to collaborators on May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions