Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make WITH clause in TRAIN statement optional #1637

Merged
merged 2 commits into from
Jan 7, 2020

Conversation

shendiaomo
Copy link
Collaborator

@shendiaomo shendiaomo commented Jan 7, 2020

The default setting of LinearClassifier works well in many cases. Omitting the WITH clause is more friendly for novice users.
For example

SELECT * FROM iris.train WHERE class != 2
TO TRAIN LinearClassifier LABEL class INTO sqlflow_models.temp;

will get a decent result as

{'accuracy': 1.0, 'accuracy_baseline': 0.54285717, 'auc': 1.0, 'auc_precision_recall': 1.0, 'average_loss': 0.23411807, 'label/mean': 0.45714286, 'loss': 0.23411807, 'precision': 1.0, 'prediction/mean': 0.56584316, 'recall': 1.0, 'global_step': 70}

while

SELECT * FROM iris.train WHERE class != 2
TO TRAIN DNNClassifier WITH model.hidden_units=[100, 100] LABEL class INTO sqlflow_models.temp;

can only achieve

{'accuracy': 0.7, 'accuracy_baseline': 0.54285717, 'auc': 1.0, 'auc_precision_recall': 1.0, 'average_loss': 0.56149596, 'label/mean': 0.45714286, 'loss': 0.56149596, 'precision': 1.0, 'prediction/mean': 0.4176486, 'recall': 0.34375, 'global_step': 70}

The loss of LinearClassifier with default learning rate and optimizer is less than half of the DNNClassifier with a similar setting.

@wangkuiyi wangkuiyi merged commit 239a876 into sql-machine-learning:develop Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants