{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Diabete Prediction \n", "_**Predict house price using SageMaker's Linear-Learner with features derived from sklearn.datasets.load_boston\n", "\n", "---\n", "\n", "## Background\n", "This notebook illustrates how one can use SageMaker's algorithms for solving applications which require `linear models` for prediction. For this illustration, we have taken an example for predicting the house price from the dataset that provided by sklearn.datasets.load_boston The data set will be used to illustrate\n", "\n", "* Basic setup for using SageMaker.\n", "* converting datasets to protobuf format used by the Amazon SageMaker algorithms and uploading to S3. \n", "* Training SageMaker's linear learner on the data set.\n", "* Deploying the trained model.\n", "* Scoring using the trained model.\n", "\n", "---" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import os\n", "\n", "# load boston housing dataset\n", "from sklearn.datasets import load_boston\n", "boston_dataset = load_boston()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | CRIM | \n", "ZN | \n", "INDUS | \n", "CHAS | \n", "NOX | \n", "RM | \n", "AGE | \n", "DIS | \n", "RAD | \n", "TAX | \n", "PTRATIO | \n", "B | \n", "LSTAT | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "0.00632 | \n", "18.0 | \n", "2.31 | \n", "0.0 | \n", "0.538 | \n", "6.575 | \n", "65.2 | \n", "4.0900 | \n", "1.0 | \n", "296.0 | \n", "15.3 | \n", "396.90 | \n", "4.98 | \n", "
1 | \n", "0.02731 | \n", "0.0 | \n", "7.07 | \n", "0.0 | \n", "0.469 | \n", "6.421 | \n", "78.9 | \n", "4.9671 | \n", "2.0 | \n", "242.0 | \n", "17.8 | \n", "396.90 | \n", "9.14 | \n", "
2 | \n", "0.02729 | \n", "0.0 | \n", "7.07 | \n", "0.0 | \n", "0.469 | \n", "7.185 | \n", "61.1 | \n", "4.9671 | \n", "2.0 | \n", "242.0 | \n", "17.8 | \n", "392.83 | \n", "4.03 | \n", "
3 | \n", "0.03237 | \n", "0.0 | \n", "2.18 | \n", "0.0 | \n", "0.458 | \n", "6.998 | \n", "45.8 | \n", "6.0622 | \n", "3.0 | \n", "222.0 | \n", "18.7 | \n", "394.63 | \n", "2.94 | \n", "
4 | \n", "0.06905 | \n", "0.0 | \n", "2.18 | \n", "0.0 | \n", "0.458 | \n", "7.147 | \n", "54.2 | \n", "6.0622 | \n", "3.0 | \n", "222.0 | \n", "18.7 | \n", "396.90 | \n", "5.33 | \n", "