<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vikram Rajasekaran on Medium]]></title>
        <description><![CDATA[Stories by Vikram Rajasekaran on Medium]]></description>
        <link>https://medium.com/@VikramRajasekaran?source=rss-54a09609708------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*PZeITND1cmAHfhQRua7TsA.png</url>
            <title>Stories by Vikram Rajasekaran on Medium</title>
            <link>https://medium.com/@VikramRajasekaran?source=rss-54a09609708------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 04:33:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@VikramRajasekaran/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Intro to SageMaker’s Autopilot]]></title>
            <link>https://medium.com/@VikramRajasekaran/intro-to-sagemakers-autopilot-1678dbdddba3?source=rss-54a09609708------2</link>
            <guid isPermaLink="false">https://medium.com/p/1678dbdddba3</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[autopilot]]></category>
            <category><![CDATA[sagemaker]]></category>
            <category><![CDATA[aws-sagemaker]]></category>
            <category><![CDATA[amazon]]></category>
            <dc:creator><![CDATA[Vikram Rajasekaran]]></dc:creator>
            <pubDate>Fri, 29 May 2020 08:26:30 GMT</pubDate>
            <atom:updated>2020-06-03T14:43:35.419Z</atom:updated>
            <content:encoded><![CDATA[<h3>Create &amp; Deploy ML Models with SageMaker’s Autopilot</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*DumtrUKBwogpfCvZURyn4g@2x.jpeg" /></figure><p>This is a brief background and walkthrough of SageMaker’s Autopilot service for people with varying backgrounds, including marketing teams and data scientists.</p><h3>What does Autopilot do?</h3><p>Autopilot automates the process of creating an ML model used to predict values for classification and linear regression problems. For example, predicting whether an e-mail is ‘spam’ or ‘not-spam’ is a classification problem. If there are only two categories to classify into, this problem type is called binary classification. If there are more than two categories, it is called multi-class classification. An example of a linear regression problem is predicting house values. The prediction is a numerical value on a continuous line.</p><h3>An Example</h3><p>To demonstrate how to create an ML model using Autopilot, I’ve decided to use the popular bank marketing case. A Portuguese banking institution has made direct marketing campaigns (phone calls) and wants to predict if a customer will<strong> subscribe a long term deposit based on the campaign.</strong> This is a binary classification problem since we are trying to predict if ‘yes’ they make a long term deposit or ‘no’ they don’t. The banking institution has gathered data on their marketing campaigns and results: <a href="https://sagemaker-sample-data-us-west-2.s3-us-west-2.amazonaws.com/autopilot/direct_marketing/bank-additional.zip">https://sagemaker-sample-data-us-west-2.s3-us-west-2.amazonaws.com/autopilot/direct_marketing/bank-additional.zip</a>. [Moro et al., 2014] S. Moro, P. Cortez and P. Rita. A Data-Driven Approach to Predict the Success of Bank Telemarketing. Decision Support Systems, Elsevier, 62:22–31, June 2014</p><p>The dataset has 21 columns: ‘age’, ‘job’, ‘marital’, ‘education’, ‘default’, ‘housing’, ‘loan’,<br> ‘contact’, ‘month’, ‘day_of_week’, ‘duration’, ‘campaign’, ‘pdays’,<br> ‘previous’, ‘poutcome’, ‘emp.var.rate’, ‘cons.price.idx’,<br> ‘cons.conf.idx’, ‘euribor3m’, ‘nr.employed’, ‘y’.</p><p>The column we are trying to predict is ‘y.’ You can find out what each attribute means here: <a href="http://archive.ics.uci.edu/ml/datasets/bank+marketing">http://archive.ics.uci.edu/ml/datasets/bank+marketing</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*bHd0UrKX0bBgv8V8QHU0vQ.png" /><figcaption>First rows of the bank marketing dataset (bank-additional-full.csv)</figcaption></figure><h3>How can we use Autopilot?</h3><p>There are multiple ways to use the Autopilot service. We can use it via the SageMaker studio, the AWS CLI or the SageMaker python SDK. The Studio experience is great for someone who has an AWS account, and wants a fully UI based experience. The CLI is great for cloud developers whom already have it installed and want to do everything in the command prompt (<a href="https://aws.amazon.com/cli/">https://aws.amazon.com/cli)/</a>. The python SDK provides a great wrapper to use inside JupyterLab for data scientists.</p><p>I’m going to focus on the Studio and CLI experience for each step, since the SDK experience is covered by SageMaker’s own sample notebook: <a href="https://github.com/awslabs/amazon-sagemaker-examples/blob/master/autopilot/sagemaker_autopilot_direct_marketing.ipynb">https://github.com/awslabs/amazon-sagemaker-examples/blob/master/autopilot/sagemaker_autopilot_direct_marketing.ipynb</a>.</p><p>The only prerequisites for the GUI steps are an AWS account. If you are following the CLI steps, please install it from <a href="https://aws.amazon.com/cli/">https://aws.amazon.com/cli/</a>.</p><h3>1. Upload the Dataset to S3</h3><p>SageMaker only accepts input from S3, so the first step is to upload a copy of the dataset to S3 in .csv format. <a href="https://sagemaker-sample-data-us-west-2.s3-us-west-2.amazonaws.com/autopilot/direct_marketing/bank-additional.zip">Download and expand your copy of the dataset from here.</a> If you get it directly from the ics.uci.edu website, please make sure to update the delimiter to commas instead of semicolons since Autopilot currently only supports true comma separated values.</p><h4>GUI Method using AWS Console</h4><p>Go to the S3 console, click create bucket: <a href="https://s3.console.aws.amazon.com/s3/home?region=us-east-2#">https://s3.console.aws.amazon.com/s3/home?region=us-east-2#</a>. The region of the S3 bucket and the region of the autopilot experiment must be the same. I’m going to be using us-east-2 everywhere. It is also shown in the console as ‘US East (Ohio).’</p><p>I’m going to name the S3 bucket ‘sagemaker-ohio-vikram.’ The S3 bucket name has to be unique across all customers for this region. It’s also important to have ‘sagemaker’ in the bucket path if you decide to use the default SageMakerFullAccess policy for the IAM role permissions. SageMaker’s default policy only gives access to S3 paths which include ‘sagemaker.’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*2BQJTeL4JF0EHBDG_62a3Q.png" /><figcaption>S3 console create bucket page</figcaption></figure><p>Click ‘Create bucket.’ Next, go to the newly created bucket’s details and upload the bank-additional-full.csv from the dataset .zip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SJuqhQ1EncSx0qsH6DX8Qg.png" /><figcaption>S3 console upload dialog</figcaption></figure><h4>Terminal Method w/ AWS CLI</h4><p>The CLI commands are run/formatted for a Mac terminal.</p><p>Download the dataset and unzip it.</p><pre>curl -O <a href="https://sagemaker-sample-data-us-west-2.s3-us-west-2.amazonaws.com/autopilot/direct_marketing/bank-additional.zip">https://sagemaker-sample-data-us-west-2.s3-us-west-2.amazonaws.com/autopilot/direct_marketing/bank-additional.zip</a></pre><pre>unzip bank-additional.zip</pre><p>Create the S3 bucket in the us-east-2 region and upload the file into the bucket:</p><pre>aws configure set region us-east-2</pre><pre>aws s3 mb s3://sagemaker-ohio-vikram</pre><pre>aws s3 cp bank-additional/bank-additional-full.csv s3://sagemaker-ohio-vikram/bank-additional-full.csv</pre><h3>2. Launch SageMaker Studio</h3><p>This step can be skipped altogether if we are just using the CLI. Otherwise, go to the SageMaker console to launch Studio: <a href="https://us-east-2.console.aws.amazon.com/sagemaker/home?region=us-east-2#/studio">https://us-east-2.console.aws.amazon.com/sagemaker/home?region=us-east-2#/studio</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bej2l8U7ioPY-936WO2EmA.png" /><figcaption>Quick start SageMaker Studio</figcaption></figure><p>I selected ‘Quick start’ and created the default Execution Role on the studio page. It took about 4 minutes for the studio to be ready and the ‘Open studio’ button became available for the user name I just created. It took another couple minutes for the studio to open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KXJs5JIe3fUbIyxTkRSS3A.png" /><figcaption>SageMaker Studio welcome page</figcaption></figure><p>You can either 1) select the tab on the left and click ‘Create experiment’ or 2) select the ‘Create Autopilot experiment’ button on the welcome page.</p><h3>3. Create an Autopilot Experiment</h3><p>Again, you can use the Studio UI to create the experiment or create one straight from the CLI.</p><h4>GUI Method with SageMaker Studio</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YqAMSveFtEgU1gGxIJc5GQ.png" /><figcaption>Create Autopilot Experiment</figcaption></figure><p><strong>Experiment Name:</strong> You can give the experiment any name. I named it ‘bank-marketing.’</p><p><strong>S3 location of input data:</strong> Provide the S3 path to the .csv we uploaded in step 1 (s3://sagemaker-ohio-vikram/bank-additional-full.csv). This field can also take in just a prefix and read in multiple .csv data files that match that prefix.</p><p><strong>Target attribute name: </strong>Set this to ‘y’ because that is the header for the column we are trying to predict in our data.</p><p><strong>S3 location for output data: S</strong>ame S3 bucket where we originally uploaded the dataset. Autopilot will automatically create a key under that bucket for the output.</p><p>I used the default settings and started the experiment. When using the ‘Auto’ machine learning problem type, Autopilot can infer the right problem type (binary classification) based on the data in the target attribute column only having 2 possible values: yes or no.</p><h4>Terminal Method w/ AWS CLI</h4><p>One of the required inputs to launch the experiment is an IAM role ARN which gives Autopilot permissions to the S3 bucket. You can create the role with the default SageMaker policy.</p><pre>aws iam create-role --role-name sagemaker-execution-role --assume-role-policy-document &#39;{&quot;Version&quot;: &quot;2012-10-17&quot;, &quot;Statement&quot;: [{&quot;Effect&quot;: &quot;Allow&quot;, &quot;Principal&quot;: { &quot;Service&quot;: &quot;sagemaker.amazonaws.com&quot; }, &quot;Action&quot;: &quot;sts:AssumeRole&quot;}]}&#39;</pre><p>Attach the SageMakerFullAccess policy to the new role that was just created.</p><pre>aws iam attach-role-policy --role-name sagemaker-execution-role --policy-arn arn:aws:iam::aws:policy/AmazonSageMakerFullAccess</pre><p>Next we pass in the same fields as we would in the SageMaker Studio UX via the CLI to create the experiment.</p><pre>aws sagemaker create-auto-ml-job \<br>--auto-ml-job-name bank-marketing \<br>--input-data-config &#39;[{&quot;DataSource&quot;:{&quot;S3DataSource&quot;: {&quot;S3DataType&quot;: &quot;S3Prefix&quot;, &quot;S3Uri&quot;: &quot;s3://sagemaker-ohio-vikram/bank-additional-full.csv&quot;}}, &quot;TargetAttributeName&quot;: &quot;y&quot;}]&#39; \<br>--output-data-config &quot;S3OutputPath=s3://sagemaker-ohio-vikram/&quot; \<br>--role-arn arn:aws:iam::005074767543:role/sagemaker-execution-role</pre><p>This command will return the ARN (Amazon Resource Name) of the newly created Autopilot job.</p><h3>4. Monitor the Experiment</h3><p>We need to monitor the experiment to see how good of a model each trial is producing. We won’t know whether this experiment will take a few hours or a month since the default max runtime is 1 month for the entire Auto ML job, and 1 day for each component job. These settings can be modified when using the Python SDK or CLI. Since our dataset is relatively small, this experiment will go on for nearly 2 hours with the default settings we used. You can stop the job after 20 trials instead of the default 250 max trials and still get reasonable results. This Autopilot experiment costs about $5 if you let it run to the end.</p><h4>GUI Method with SageMaker Studio</h4><p>Once the experiment has been created you will be taken to a tab which will eventually show the progress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5_3hZESzwe_5koVWdCYOg.png" /></figure><p>The 4 states of the job are shown at the top: Analyzing Data, Feature Engineering, Model Tuning, Completed. Before going into the analyzing data step, Autopilot is busy creating training/validation datasets in your S3 output bucket. This process depends on the size of your dataset, but it took about 4 minutes for this example. You’ll notice a processing job that is doing this work will appear in the ‘Unassigned trial components’ tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*U973M3yLTldwJXZy4C9HKQ.png" /><figcaption>If you accidentally close the tab for the Autopilot job, right click on the experiment name and click ‘Describe AutoML Job.’</figcaption></figure><p>After creating the right dataset for training, Autopilot will run another processing job which will analyze the dataset and provide recommendations for feature engineering and algorithms for training. This step took approximately 5 minutes.</p><p>During the feature engineering step, Autopilot is launching training and transform jobs based on the recommendations in the previous step. This will prepare your original data for the ML training algorithm. This step took 12 minutes before it moved into the model tuning step.</p><p>In the model tuning step, Autopilot will launch an automatic model tuning job with all the different options for the features and hyperparameter ranges. A tuning job will try different ways to train your ML model and as each training job finishes, you will start seeing trials. The first trials appeared 4–5 minutes into the tuning step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iu46GuW2CBDyof92xSADLA.png" /></figure><p>Autopilot will continue exploring up to 250 trials with default settings. Autopilot started consistently creating trials with an objective metric value greater than 0.90 after the first 10 to 15 trials. We can click ‘Stop the experiment’ at this point for the purposes of this experiment. I let the job run to completion and the best trial had an objective metric value of 0.921. The objective metric for this experiment was ‘Accuracy.’ We can see the Objective by scrolling down to the ‘Resolved Attributes’ section of the ‘Job profile’ tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mOVa-AfkECzwPQACLzL2Jg.png" /></figure><p>We can also see here that Autopilot correctly determined the problem type as binary classification.</p><h4>Terminal Method w/ AWS CLI</h4><p>We have two APIs to help monitor the progress of the job.</p><p>The first is the describe-auto-ml-job API which will output almost all the information we need.</p><pre>aws sagemaker describe-auto-ml-job --auto-ml-job-name bank-marketing</pre><p>We can monitor the status by looking at the AutoMLJobSecondaryStatus and AutoMLJobStatus fields. The objective in this experiment is ‘Accuracy.’</p><p>The second API to help monitor the progress is list-candidates-for-auto-ml-job. Once candidate trials are created, this will start showing the objective metric values for each trial.</p><pre>aws sagemaker list-candidates-for-auto-ml-job —-auto-ml-job-name bank-marketing</pre><p>I prefer just looking at the BestCandidate field in the describe result and stopping the job once the BestCandidate has an acceptable objective metric value. In this case, let’s stop it after we get an objective metric greater than 0.90.</p><pre>aws sagemaker stop-auto-ml-job --auto-ml-job-name bank-marketing</pre><h3><strong>5. Use the Best Model to Make Predictions</strong></h3><p>We have successfully created model artifacts to solve our binary classification problem! All of the model artifacts and datasets that were generated from this experiment are stored in the specified S3 output path.</p><p>There are two different ways to use the artifacts of the best model. We can run something called a batch transform job which can make predictions for a large number of requests in one go. The other option is to host the model behind an https endpoint and make a request to the endpoint for a single prediction. Make sure to delete the endpoint when you are done since it can get quite expensive.</p><h4>GUI Method using AWS Console</h4><p>Studio has a one-click deploy to an endpoint feature which will create a SageMaker model and setup an https endpoint to make inference requests to the model. However, to call invoke-endpoint we would need to use the CLI or use some other client. For a strictly UI experience, the batch transform job is the only way to get results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LKzBt4JOWGr4nH0KzojE1w.png" /><figcaption>Right-click the trial and click Deploy model</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uQ4hIDI7ddJDX5_ITY99eA.png" /><figcaption>Default settings for the endpoint</figcaption></figure><p>Deploying a model using Studio creates a SageMaker Model, EndpointConfiguration, and Endpoint. We will only need the SageMaker model name to launch the batch transform job.</p><p>The batch job needs input as a file in S3. I uploaded a csv file with one request to the Autopilot input folder just to try it out:</p><pre>28,unknown,single,unknown,unknown,yes,yes,telephone,may,tue,1201,1,999,0,nonexistent,1.1,93.994,-36.4,4.857,5191.0</pre><p>Go to the batch create page: <a href="https://us-east-2.console.aws.amazon.com/sagemaker/home?region=us-east-2#/transform-jobs/create">https://us-east-2.console.aws.amazon.com/sagemaker/home?region=us-east-2#/transform-jobs/create</a> and launch a job with the following inputs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e3yGpsgWEp41y_qz9AlnQQ.png" /><figcaption>Find your own model’s name, and set instance count to 1 and batch strategy to Single Record.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXskKimS0DXcyqwGkyZnFw.png" /><figcaption>Set the Split type to ‘Line’, Content type to ‘text/csv’ and add the s3 paths to input and output.</figcaption></figure><p>Then launch the job; it should take just 4 minutes to complete and the job will create a inference.csv.out file with the prediction in the S3 output path!</p><h4>Terminal Method w/ AWS CLI</h4><p>From the terminal, I’m going to show how to create the model, host it behind an endpoint, and invoke it using the CLI. Deploying the model is easier in Studio since it’s one click. I recommend launching the studio application and deploying the model from there and skipping to the last command to invoke-endpoint.</p><p>To create the SageMaker model resource, we need to get all the “InferenceContainers” for the model we want to create.</p><pre>aws sagemaker describe-auto-ml-job --auto-ml-job-name bank-marketing</pre><p>This command returned all the information about the Autopilot job, including the InferenceContainers for the best trial:</p><pre>&quot;InferenceContainers&quot;: [<br>            {<br>                &quot;Image&quot;: &quot;257758044811.dkr.ecr.us-east-2.amazonaws.com/sagemaker-sklearn-automl:0.1.0-cpu-py3&quot;,<br>                &quot;ModelDataUrl&quot;: &quot;s3://sagemaker-vikram-ohio/bank-marketing/data-processor-models/bank-marke-dpp3-1-94f0a3b344e24b4<br>3b2d77cf754fb158ee7969e829ba64/output/model.tar.gz&quot;,<br>                &quot;Environment&quot;: {<br>                    &quot;AUTOML_TRANSFORM_MODE&quot;: &quot;feature-transform&quot;,<br>                    &quot;SAGEMAKER_DEFAULT_INVOCATIONS_ACCEPT&quot;: &quot;application/x-recordio-protobuf&quot;,<br>                    &quot;SAGEMAKER_PROGRAM&quot;: &quot;sagemaker_serve&quot;,<br>                    &quot;SAGEMAKER_SUBMIT_DIRECTORY&quot;: &quot;/opt/ml/model/sagemaker_serve.py&quot;<br>                }<br>            },<br>            {<br>                &quot;Image&quot;: &quot;257758044811.dkr.ecr.us-east-2.amazonaws.com/sagemaker-xgboost:0.90-1-cpu-py3&quot;,<br>                &quot;ModelDataUrl&quot;: &quot;s3://sagemaker-vikram-ohio/bank-marketing/tuning/bank-marke-dpp3-xgb/tuning-job-1-3c813540b3db43f<br>dbf-206-895a579f/output/model.tar.gz&quot;,<br>                &quot;Environment&quot;: {<br>                    &quot;MAX_CONTENT_LENGTH&quot;: &quot;20971520&quot;,<br>                    &quot;SAGEMAKER_DEFAULT_INVOCATIONS_ACCEPT&quot;: &quot;text/csv&quot;<br>                }<br>            },<br>                &quot;Image&quot;: &quot;257758044811.dkr.ecr.us-east-2.amazonaws.com/sagemaker-sklearn-automl:0.1.0-cpu-py3&quot;,<br>                &quot;ModelDataUrl&quot;: &quot;s3://sagemaker-vikram-ohio/bank-marketing/data-processor-models/bank-marke-dpp3-1-94f0a3b344e24b4<br>3b2d77cf754fb158ee7969e829ba64/output/model.tar.gz&quot;,<br>                &quot;Environment&quot;: {<br>                    &quot;AUTOML_TRANSFORM_MODE&quot;: &quot;inverse-label-transform&quot;,<br>                    &quot;SAGEMAKER_DEFAULT_INVOCATIONS_ACCEPT&quot;: &quot;text/csv&quot;,<br>                    &quot;SAGEMAKER_PROGRAM&quot;: &quot;sagemaker_serve&quot;,<br>                    &quot;SAGEMAKER_SUBMIT_DIRECTORY&quot;: &quot;/opt/ml/model/sagemaker_serve.py&quot;<br>                }<br>        ],</pre><p>Create a model using the inference container list:</p><pre>aws sagemaker create-model --model-name &quot;bank-marketing&quot; --execution-role-arn &quot;arn:aws:iam::005074767543:role/sagemaker-execution-role&quot; --containers &quot;[{\&quot;Image\&quot;: \&quot;257758044811.dkr.ecr.us-east-2.amazonaws.com/sagemaker-sklearn-automl:0.1.0-cpu-py3\&quot;, \&quot;ModelDataUrl\&quot;: \&quot;s3://sagemaker-vikram-ohio/bank-marketing/data-processor-models/bank-marke-dpp3-1-94f0a3b344e24b43b2d77cf754fb158ee7969e829ba64/output/model.tar.gz\&quot;, \&quot;Environment\&quot;: {\&quot;AUTOML_TRANSFORM_MODE\&quot;: \&quot;feature-transform\&quot;, \&quot;SAGEMAKER_DEFAULT_INVOCATIONS_ACCEPT\&quot;: \&quot;application/x-recordio-protobuf\&quot;, \&quot;SAGEMAKER_PROGRAM\&quot;: \&quot;sagemaker_serve\&quot;,\&quot;SAGEMAKER_SUBMIT_DIRECTORY\&quot;: \&quot;/opt/ml/model/sagemaker_serve.py\&quot; }},{\&quot;Image\&quot;: \&quot;257758044811.dkr.ecr.us-east-2.amazonaws.com/sagemaker-xgboost:0.90-1-cpu-py3\&quot;, \&quot;ModelDataUrl\&quot;: \&quot;s3://sagemaker-vikram-ohio/bank-marketing/tuning/bank-marke-dpp3-xgb/tuning-job-1-3c813540b3db43fdbf-206-895a579f/output/model.tar.gz\&quot;, \&quot;Environment\&quot;: { \&quot;MAX_CONTENT_LENGTH\&quot;: \&quot;20971520\&quot;, \&quot;SAGEMAKER_DEFAULT_INVOCATIONS_ACCEPT\&quot;: \&quot;text/csv\&quot;}},{\&quot;Image\&quot;: \&quot;257758044811.dkr.ecr.us-east-2.amazonaws.com/sagemaker-sklearn-automl:0.1.0-cpu-py3\&quot;, \&quot;ModelDataUrl\&quot;: \&quot;s3://sagemaker-vikram-ohio/bank-marketing/data-processor-models/bank-marke-dpp3-1-94f0a3b344e24b43b2d77cf754fb158ee7969e829ba64/output/model.tar.gz\&quot;,\&quot;Environment\&quot;: {\&quot;AUTOML_TRANSFORM_MODE\&quot;: \&quot;inverse-label-transform\&quot;,\&quot;SAGEMAKER_DEFAULT_INVOCATIONS_ACCEPT\&quot;: \&quot;text/csv\&quot;,\&quot;SAGEMAKER_PROGRAM\&quot;: \&quot;sagemaker_serve\&quot;,\&quot;SAGEMAKER_SUBMIT_DIRECTORY\&quot;: \&quot;/opt/ml/model/sagemaker_serve.py\&quot;}}]&quot;</pre><p>Create an endpoint configuration using the model name:</p><pre>aws sagemaker create-endpoint-config —-endpoint-config-name bank-marketing —-production-variants &quot;{\&quot;InitialInstanceCount\&quot;: 1, \&quot;InstanceType\&quot;: \&quot;ml.t2.medium\&quot;, \&quot;ModelName\&quot;: \&quot;bank-marketing\&quot;, \&quot;VariantName\&quot;: \”variant\&quot;}&quot;</pre><p>Create an endpoint using the configuration:</p><pre>aws sagemaker create-endpoint --endpoint-name bank-marketing --endpoint-config-name bank-marketing</pre><p>You can call ‘describe-endpoint’ to check the EndpointStatus:</p><pre>aws sagemaker describe-endpoint --endpoint-name bank-marketing</pre><p>You’ll have to wait for the endpoint to be created and verify that its status is ‘InService’ before proceeding. This could take about 10 minutes.</p><p>Finally, invoke the endpoint with your own inference request with all 20 features:</p><pre>aws sagemaker-runtime invoke-endpoint --endpoint-name &quot;bank-marketing&quot; --content-type=&quot;text/csv&quot; --body &quot;28,unknown,single,unknown,unknown,yes,yes,telephone,may,tue,1201,1,999,0,nonexistent,1.1,93.994,-36.4,4.857,5191.0&quot; prediction.txt</pre><p>The prediction.txt file had the model output ‘yes’ for the given request.</p><p>Please clean up the endpoint when you are done by deleting it. The costs of a dedicated instance/endpoint can be large if left running.</p><h3>How did Autopilot create the model?</h3><p>Now that we’ve created a model and made some predictions using the model, we can go deeper into how the model was generated. All of the steps that autopilot service took are described and coded in a Jupyter notebook. Someone new to training models can use this notebook as a starting point and try their own modifications and re-run the steps of the experiment.</p><p>There are two notebooks available: a data exploration notebook detailing the data set and suggestions to improve it, and a candidate generation notebook explaining the feature transformers and algorithms used to generate the trials.</p><p>You can launch those notebooks in Studio from the experiment’s detail page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khIIIrvf-YWA1FOknJExMw.png" /><figcaption>Open candidate generation notebook, Open data exploration notebook.</figcaption></figure><p>Try Autopilot on your own datasets and leave comments below! Keep in mind some of the constraints:</p><ul><li>Dataset must have at least 1000 rows.</li><li>Dataset must be less than 5 GB.</li><li>Dataset must be in comma separated format.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1678dbdddba3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>