Skip to content

Commit f81f9b0

Browse files
Updating MLeap example
1 parent fefccf6 commit f81f9b0

6 files changed

Lines changed: 50 additions & 61 deletions

File tree

samples/features/sql-big-data-cluster/app-deploy/mleap/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ To run this sample, you need the following prerequisites.
4343
```bash
4444
mssqlctl login -e https://<ip-address-of-endpoint-service-proxy>:30777 -u <user-name> -p <password>
4545
```
46-
3. This example uses a Machine Learning Model that predicts the price per square foot of an Airbnb property based on various parameters such as the location and type of dwelling. [More details and information on the example are here](http://mleap-docs.combust.ml/mleap-serving/#load-model). The application you will be deploying as part of this sample is a Random Forest Model that was built in Spark and has been serialized as an MLeap bundle.
46+
3. This example uses a TensorFlow Machine Learning Model that uses public US Census data predict income. [More details and information on the example are here](https://docs.microsoft.com/en-us/sql/big-data-cluster/train-and-create-machinelearning-models-with-spark?view=sqlallproducts-allversions). The application you will be deploying as part of this sample is a Random Forest Model that was built in Spark and has been [serialized as an MLeap bundle](https://docs.microsoft.com/en-us/sql/big-data-cluster/export-model-with-spark-mleap?view=sqlallproducts-allversions).
4747

4848
Deploy the app using the `create` command and pass the location of the spec file. In the example below, the spec file is expected to be in the `mleap` folder:
4949
```bash
50-
mssqlctl app create --spec ./mleap
50+
mssqlctl app create --spec ./mleap/
5151
```
52-
4. Check the deployment by running the following command:
52+
1. Check the deployment by running the following command:
5353
```bash
54-
mssqlctl app list -n mleap -v [version]
54+
mssqlctl app list -n mleap-census -v [version]
5555
```
5656
Once the app is listed as `Ready` you can continue to the next step.
57-
5. Now that the app has been deployed you can test if the app works correctly by passing in a sample input that is available in the mleap folder. The deployed app is a RESTful webservice that is [Swagger](swagger.io) compliant. For this sample we will show you how you can test this using the CLI.
57+
2. Now that the app has been deployed you can test if the app works correctly by passing in a sample input that is available in the `mleap` folder. The deployed app is a RESTful webservice that is [Swagger](swagger.io) compliant. For this sample we will show you how you can test this using the CLI.
5858

59-
To test the app, run the command below. The input parameter is a `LeapFrame`, a `json` file that describes the parameters and the values provided to the model for predicting the cost per square feet. Note that the input parameter has a special character '@' to indicate that a `json` file is being passed. This command needs to be run within the `mleap` folder.
59+
To test the app, run the command below. The input parameter is a `MLeapFrame`, a `json` file that describes the parameters and the values provided to the model for predicting the cost per square feet. Note that the input parameter has a special character '@' to indicate that a `json` file is being passed. This command needs to be run within the `mleap` folder.
6060

6161
```bash
62-
mssqlctl app run --name mleap --version [version] --input mleap-frame=@frame.json
62+
mssqlctl app run --name mleap-census --version [version] --input schema=@census_frame.json
6363
```
6464

6565
The result will be a json output that includes the prediction along with additional data, including the predicted price per square feet.
@@ -69,7 +69,7 @@ To run this sample, you need the following prerequisites.
6969
6. You can clean up the sample by running the following commands:
7070
```bash
7171
# delete app
72-
mssqlctl app delete --name mleap --version [version]
72+
mssqlctl app delete --name mleap-census --version [version]
7373
```
7474

7575
<a name=sample-details></a>
@@ -82,10 +82,10 @@ The spec file serves as the data required for deploying the app and it contains
8282
Here is the spec file for this application:
8383

8484
```yaml
85-
name: mleap
85+
name: mleap-census
8686
version: v1
8787
runtime: Mleap
88-
bundleFileName: model.lr.zip
88+
bundleFileName: census_bundle.zip
8989
replicas: 2
9090
poolsize: 2
9191
```
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"rows": [
3+
[
4+
17,
5+
4,
6+
"<=50K"
7+
],
8+
[
9+
17,
10+
5,
11+
"<=50K"
12+
],
13+
[
14+
17,
15+
5,
16+
"<=50K"
17+
]
18+
],
19+
"schema": {
20+
"fields": [
21+
{
22+
"name": "age",
23+
"type": "integer"
24+
},
25+
{
26+
"name": "hours_per_week",
27+
"type": "integer"
28+
},
29+
{
30+
"name": "income",
31+
"type": "string"
32+
}
33+
]
34+
}
35+
}

samples/features/sql-big-data-cluster/app-deploy/mleap/frame.json

Lines changed: 0 additions & 45 deletions
This file was deleted.
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
name: mleap
1+
name: mleap-census
22
version: v1
3-
inputs: ./frame.json
3+
inputs: ./census_frame.json
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
name: mleap
1+
name: mleap-census
22
version: v1
33
runtime: Mleap
4-
bundleFileName: model.lr.zip
5-
replicas: 2
6-
poolsize: 2
4+
bundleFileName: census_bundle.zip
5+
replicas: 1

0 commit comments

Comments
 (0)