Skip to content

Commit

Permalink
Use upper case for keyword predict and some text edits. (sql-machine-…
Browse files Browse the repository at this point in the history
…learning#303)

* Test Commit

* Update username

* Update SQL Installation and Demo

* Some edits to fix typo and case.

* Move back installation.md to quickstart.md

* minor change in readme.md
  • Loading branch information
hungry1526 authored and wangkuiyi committed Apr 25, 2019
1 parent 978bed2 commit 7632989
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ There are already some work in progress in the industry. We can write simple mac
- [Google BigQuery](https://cloud.google.com/bigquery/docs/bigqueryml-intro): Google BigQuery enables machine learning in SQL by introducing the `CREATE MODEL` statement.

None of the existing solution solves our pain point, instead we want it to be fully extensible.
1. The solution should be compatible to many SQL engines, instead of a specific version or type.
1. It should also support sophisticated machine learning models, including TensorFlow for deep learning and [xgboost](https://github.com/dmlc/xgboost) for trees.
1. We also want to add the flexibilies to configure and run cutting-edge algorithms including specifying [feature crosses](https://www.tensorflow.org/api_docs/python/tf/feature_column/crossed_column), at least, no Python or R code embedded in the SQL statements, and integrate hyperparameter estimation.
1. This solution should be compatible to many SQL engines, instead of a specific version or type.
1. It should support sophisticated machine learning models, including TensorFlow for deep learning and [xgboost](https://github.com/dmlc/xgboost) for trees.
1. We also want the flexibility to configure and run cutting-edge ML algorithms including specifying [feature crosses](https://www.tensorflow.org/api_docs/python/tf/feature_column/crossed_column), at least, no Python or R code embedded in the SQL statements, and fully integrated with hyperparameter estimation.

## How to use SQLFlow

Expand Down
15 changes: 9 additions & 6 deletions doc/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sqlflow>

### Training a DNNClassifier and run prediction

- Step one: Let's see training data from Iris database:
- Step One: Let's see some training data from Iris database
```sql
sqlflow> select * from iris.train limit 2;
-----------------------------
Expand All @@ -27,7 +27,7 @@ sqlflow> select * from iris.train limit 2;
+--------------+-------------+--------------+-------------+-------+
```

- Step Two: Train a Tensorflow [DNNClassifier](https://www.tensorflow.org/api_docs/python/tf/estimator/DNNClassifier) from train table:
- Step Two: Train a Tensorflow [DNNClassifier](https://www.tensorflow.org/api_docs/python/tf/estimator/DNNClassifier)
```sql
sqlflow> SELECT *
FROM iris.train
Expand All @@ -42,16 +42,19 @@ Training set accuracy: 0.96721
Done training
```

- Step Three: Run prediction from a trained model:
- Step Three: Run prediction using the trained model produced from step two. Note my_dnn_model is not a table, therefore it's not visually displayable from Select statement.
```sql
sqlflow> SELECT *
FROM iris.test
predict iris.predict.class
PREDICT iris.predict.class
USING sqlflow_models.my_dnn_model;
```

- Step Four: Checkout the prediction result:
- Step Four: Checkout the prediction result
```sql
sqlflow> select * from iris.predict limit 10;
```
Now you have successfully run a demo in SQLFlow to train the model using DNNClassifier and make a simple prediction. More demos are on the road, please stay tuned.


Congratulations! Now you have successfully completed a demo using SQLFlow syntax to train model using DNNClassifier and make a quick prediction. More demos are on the road, please stay tuned.

0 comments on commit 7632989

Please sign in to comment.