Skip to content

support xgboost regression model#797

Merged
Yancey0623 merged 1 commit intosql-machine-learning:developfrom
Yancey0623:xgboost_regression
Sep 10, 2019
Merged

support xgboost regression model#797
Yancey0623 merged 1 commit intosql-machine-learning:developfrom
Yancey0623:xgboost_regression

Conversation

@Yancey0623
Copy link
Copy Markdown
Collaborator

@Yancey0623 Yancey0623 commented Sep 9, 2019

fixed #795

WITH
objective="reg:squarederror",
train.num_boost_round = 30
COLUMN f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will fix it in the next PR.

@weiguoz weiguoz self-requested a review September 9, 2019 14:16
Copy link
Copy Markdown
Collaborator

@tonyyang-svail tonyyang-svail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment thread sql/template_xgboost.go
# TODO(typhoonzero): regression models may have different behavior
pred_classes = np.argmax(np.array(preds), axis=1)

# TODO(Yancey1989): using the train parameters to decide regressoin model or classifier model
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to get the train parameters? Should we add TrainIR to PredictIR?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can save the TrainClause in the model struct:

sqlflow/sql/model.go

Lines 27 to 30 in 5ae82c0

type model struct {
workDir string // We don't expose and gob workDir; instead we tar it.
TrainSelect string
}

And the prediction job can resolve the TrainClause to the parameters. And I think PredictIR is a good idea, do you want to resolve the Predict SQL and saved model into PredictIR?

@Yancey0623 Yancey0623 merged commit 5a9d9d2 into sql-machine-learning:develop Sep 10, 2019
@Yancey0623 Yancey0623 deleted the xgboost_regression branch September 10, 2019 02:55
Comment thread sql/template_xgboost.go
pred_classes = np.argmax(np.array(preds), axis=1)

# TODO(Yancey1989): using the train parameters to decide regressoin model or classifier model
if len(preds.shape) == 2:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should find a more accurate way to determine whether the model is a regression model.

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.

Using XGBoost to make regression prediction but using 'argmax' in classifier instead.

4 participants