diff --git a/notebooks/samples/108 - Model Deployment with Spark Serving.ipynb b/notebooks/samples/108 - Model Deployment with Spark Serving.ipynb index 4890bc45b4..53a012f728 100644 --- a/notebooks/samples/108 - Model Deployment with Spark Serving.ipynb +++ b/notebooks/samples/108 - Model Deployment with Spark Serving.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "collapsed": true }, @@ -32,130 +32,9 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
educationmarital-statushours-per-weekincome
010thDivorced10.0<=50K
110thDivorced25.0<=50K
210thDivorced28.0<=50K
310thDivorced30.0<=50K
410thDivorced32.0<=50K
510thDivorced35.0<=50K
610thDivorced37.0<=50K
710thDivorced38.0<=50K
810thDivorced38.0<=50K
910thDivorced40.0<=50K
\n", - "
" - ], - "text/plain": [ - " education marital-status hours-per-week income\n", - "0 10th Divorced 10.0 <=50K\n", - "1 10th Divorced 25.0 <=50K\n", - "2 10th Divorced 28.0 <=50K\n", - "3 10th Divorced 30.0 <=50K\n", - "4 10th Divorced 32.0 <=50K\n", - "5 10th Divorced 35.0 <=50K\n", - "6 10th Divorced 37.0 <=50K\n", - "7 10th Divorced 38.0 <=50K\n", - "8 10th Divorced 38.0 <=50K\n", - "9 10th Divorced 40.0 <=50K" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "dataFilePath = \"AdultCensusIncome.csv\"\n", "import os, urllib\n", @@ -181,7 +60,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "collapsed": true }, @@ -201,25 +80,9 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "root\n", - " |-- education: string (nullable = true)\n", - " |-- marital-status: string (nullable = true)\n", - " |-- hours-per-week: double (nullable = true)\n", - " |-- income: string (nullable = true)\n", - " |-- scores: vector (nullable = true)\n", - " |-- scored_probabilities: vector (nullable = true)\n", - " |-- scored_labels: double (nullable = false)\n", - "\n" - ] - } - ], + "outputs": [], "source": [ "from mmlspark import ComputeModelStatistics, TrainedClassifierModel\n", "prediction = model.transform(test)\n", @@ -228,65 +91,9 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
evaluation_typeconfusion_matrixaccuracyprecisionrecallAUC
0ClassificationDenseMatrix([[ 5797., 408.],\\n [...0.8223890.6887870.4649850.87002
\n", - "
" - ], - "text/plain": [ - " evaluation_type confusion_matrix \\\n", - "0 Classification DenseMatrix([[ 5797., 408.],\\n [... \n", - "\n", - " accuracy precision recall AUC \n", - "0 0.822389 0.688787 0.464985 0.87002 " - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "metrics = ComputeModelStatistics().transform(prediction)\n", "metrics.limit(10).toPandas()" @@ -302,7 +109,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": { "collapsed": true }, @@ -339,17 +146,9 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Response 0.0\n" - ] - } - ], + "outputs": [], "source": [ "import requests\n", "data = u'{\" education\":\" 10th\",\" marital-status\":\" Divorced\",\" hours-per-week\":40.0}'\n", @@ -359,17 +158,9 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Response 1.0\n" - ] - } - ], + "outputs": [], "source": [ "import requests\n", "data = u'{\" education\":\" Masters\",\" marital-status\":\" Married-civ-spouse\",\" hours-per-week\":40.0}'\n", @@ -379,7 +170,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": { "collapsed": true },