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

Python, R: export_json bugfix, passing scale parameter to C++ #145

Merged
merged 5 commits into from
Aug 21, 2023

Conversation

Ilia-Shutov
Copy link
Collaborator

Python, R: col_sd = 1.0 by default (no scaling) as it is used in multiplying

export_json bugfix, RandomForest scale=False case

R/R/forestry.R Outdated
@@ -787,7 +787,7 @@ forestry <- function(x,

# Create vectors with the column means and SD's for scaling
colMeans <- rep(0, ncol(x)+1)
colSd <- rep(0, ncol(x)+1)
colSd <- rep(1, ncol(x)+1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we leave this change out of this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@edwardwliu Yes, but this is a fix related to R - colSd is 1 by default - same fix for Python is col_sd = np.repeat(1.0, ncol + 1), other code in this PR is about code style update + added test.
Do you want me to fix only Python part for now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed by reverting colSd back to 0 init and passing scale bool parameter to C++ function

@Ilia-Shutov Ilia-Shutov changed the title Python, R: col_sd = 1.0 by default. export_json bugfix Python, R: export_json bugfix, passing scale parameter to C++ Aug 21, 2023
Copy link
Collaborator

@edwardwliu edwardwliu left a comment

Choose a reason for hiding this comment

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

LGTM

@Ilia-Shutov Ilia-Shutov merged commit c798f62 into master Aug 21, 2023
13 checks passed
@Ilia-Shutov Ilia-Shutov deleted the is/json_export.col_sd branch August 21, 2023 13:19
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.

None yet

2 participants