-
Notifications
You must be signed in to change notification settings - Fork 8
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
Implement basic feature sampling in tree model #212
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with some tiny comments.
I have some questions about feature-fraction behavior/sampling, we can hash out offline (and as soon as that it is clear, this is good.).
feature_fraction : | ||
If float, the subsampled fraction of features considered in building this model. | ||
Users may implement an arbitrary function returning a cupynumeric array of | ||
booleans of shape `(n_features,)` to specify the feature subset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
booleans of shape `(n_features,)` to specify the feature subset. | |
booleans of shape ``(n_features,)`` to specify the feature subset. |
Should we say how this is rounded?
@@ -33,6 +33,10 @@ class Tree(BaseModel): | |||
split_samples : int | |||
The number of data points to sample for each split decision. | |||
Max value is 2048 due to constraints on shared memory in GPU kernels. | |||
feature_fraction : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you wanted to put this. (I'll note that since we do have type hints in think it is also completely fine to just put nothing/remove the :
even.)
@@ -57,6 +61,7 @@ def __init__( | |||
*, | |||
max_depth: int = 8, | |||
split_samples: int = 256, | |||
feature_fraction: Union[float, Callable[..., cn.array]] = 1.0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature_fraction: Union[float, Callable[..., cn.array]] = 1.0, | |
feature_fraction: Union[float, Callable[[], cn.array]] = 1.0, |
Implements #202