Skip to content

Instantly share code, notes, and snippets.

@tonyyang-svail
Created February 28, 2019 04:47
Show Gist options
  • Save tonyyang-svail/641530e081d1164e2a7fa908b06249f2 to your computer and use it in GitHub Desktop.
Save tonyyang-svail/641530e081d1164e2a7fa908b06249f2 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%reload_ext sqlflow.magic"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%sqlflow\n",
"show databases;"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%sqlflow\n",
"select *\n",
"from iris.iris\n",
"limit 1"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%sqlflow\n",
"SELECT *\n",
"FROM iris.iris\n",
"TRAIN DNNClassifier\n",
"WITH\n",
" n_classes = 3,\n",
" hidden_units = [10, 20]\n",
"COLUMN sepal_length, sepal_width, petal_length, petal_width\n",
"LABEL class\n",
"INTO my_dnn_model;"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%sqlflow\n",
"SELECT *\n",
"FROM iris.iris\n",
"predict iris.predict.class\n",
"USING my_dnn_model;"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%sqlflow\n",
"SELECT *\n",
"FROM iris.predict\n",
"LIMIT 5;"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment