{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "8d071ac3", "metadata": {}, "outputs": [], "source": [ "import sagemaker\n", "from sagemaker.xgboost import XGBoost" ] }, { "cell_type": "code", "execution_count": null, "id": "2ef7c719", "metadata": {}, "outputs": [], "source": [ "role = sagemaker.get_execution_role()\n", "subnets=None\n", "security_group_ids=None" ] }, { "cell_type": "code", "execution_count": null, "id": "d802ab00", "metadata": {}, "outputs": [], "source": [ "! cat src/requirements.txt" ] }, { "cell_type": "code", "execution_count": null, "id": "35884134", "metadata": {}, "outputs": [], "source": [ "xgb_estimator = XGBoost(\n", " source_dir = \"src\",\n", " entry_point=\"hello_ray.py\",\n", " subnets=subnets,\n", " security_group_ids=security_group_ids,\n", " role=role,\n", " instance_count=5,\n", " instance_type=\"ml.m5.large\",\n", " framework_version=\"1.3-1\"\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "0a5efd25", "metadata": {}, "outputs": [], "source": [ "xgb_estimator.fit()" ] }, { "cell_type": "code", "execution_count": null, "id": "5370b74d", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "conda_python3", "language": "python", "name": "conda_python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.12" } }, "nbformat": 4, "nbformat_minor": 5 }