Skip to content

Commit c2829e3

Browse files
authored
docs: correct the params rendering for ml.remote and ml.ensemble modules (#248)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) - `ensemble.RandomForestClassifier`: https://screenshot.googleplex.com/4Q88xgdm5hkaYXu - `ensemble.RandomForestRegressor`: https://screenshot.googleplex.com/3CU6pJBjYHQvnDo - `remote.VertexAIModel`: https://screenshot.googleplex.com/8SL2max6GfPMwFe Fixes internal issue 314150462 🦕
1 parent 8d81e24 commit c2829e3

File tree

3 files changed

+46
-46
lines changed

3 files changed

+46
-46
lines changed

bigframes/ml/remote.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ class VertexAIModel(base.BaseEstimator):
4747
Args:
4848
endpoint (str):
4949
Vertex AI https endpoint.
50-
input ({column_name: column_type}):
51-
Input schema. Supported types are "bool", "string", "int64", "float64", "array<bool>", "array<string>", "array<int64>", "array<float64>".
52-
output ({column_name: column_type}):
53-
Output label schema. Supported the same types as the input.
50+
input (Mapping):
51+
Input schema: `{column_name: column_type}`. Supported types are "bool", "string", "int64", "float64", "array<bool>", "array<string>", "array<int64>", "array<float64>".
52+
output (Mapping):
53+
Output label schema: `{column_name: column_type}`. Supported the same types as the input.
5454
session (bigframes.Session or None):
5555
BQ session to create the model. If None, use the global default session.
5656
connection_name (str or None):

docs/templates/toc.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@
108108
- name: PaLM2TextEmbeddingGenerator
109109
uid: bigframes.ml.llm.PaLM2TextEmbeddingGenerator
110110
name: llm
111-
- items:
112-
- name: Overview
113-
uid: bigframes.ml.remote
114-
- name: VertexAIModel
115-
uid: bigframes.ml.remote.VertexAIModel
116-
name: remote
117111
- items:
118112
- name: metrics
119113
uid: bigframes.ml.metrics
@@ -144,6 +138,12 @@
144138
- name: OneHotEncoder
145139
uid: bigframes.ml.preprocessing.OneHotEncoder
146140
name: preprocessing
141+
- items:
142+
- name: Overview
143+
uid: bigframes.ml.remote
144+
- name: VertexAIModel
145+
uid: bigframes.ml.remote.VertexAIModel
146+
name: remote
147147
name: bigframes.ml
148148
name: BigQuery DataFrames
149149
status: beta

third_party/bigframes_vendored/sklearn/ensemble/_forest.py

+36-36
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ def fit(self, X, y):
4747
"""Build a forest of trees from the training set (X, y).
4848
4949
Args:
50-
X:
50+
X (bigframes.dataframe.DataFrame or bigframes.series.Series):
5151
Series or DataFrame of shape (n_samples, n_features). Training data.
5252
53-
y:
53+
y (bigframes.dataframe.DataFrame or bigframes.series.Series):
5454
Series or DataFrame of shape (n_samples,) or (n_samples, n_targets).
5555
Target values. Will be cast to X's dtype if necessary.
5656
5757
5858
Returns:
59-
Fitted Estimator.
59+
ForestModel: Fitted Estimator.
6060
"""
6161
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
6262

@@ -73,12 +73,12 @@ def predict(self, X):
7373
mean predicted regression targets of the trees in the forest.
7474
7575
Args:
76-
X:
76+
X (bigframes.dataframe.DataFrame or bigframes.series.Series):
7777
Series or DataFrame of shape (n_samples, n_features). The data matrix for
7878
which we want to get the predictions.
7979
8080
Returns:
81-
The predicted values.
81+
bigframes.dataframe.DataFrame: The predicted values.
8282
"""
8383
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
8484

@@ -91,38 +91,38 @@ class RandomForestRegressor(ForestRegressor):
9191
to improve the predictive accuracy and control over-fitting.
9292
9393
Args:
94-
num_parallel_tree: Optional[int]
94+
num_parallel_tree (Optional[int]):
9595
Number of parallel trees constructed during each iteration. Default to 100. Minimum value is 2.
96-
tree_method: Optional[str]
96+
tree_method (Optional[str]):
9797
Specify which tree method to use. Default to "auto". If this parameter is set to
9898
default, XGBoost will choose the most conservative option available. Possible values: ""exact", "approx",
9999
"hist".
100-
min_child_weight : Optional[float]
100+
min_child_weight (Optional[float]):
101101
Minimum sum of instance weight(hessian) needed in a child. Default to 1.
102-
colsample_bytree : Optional[float]
102+
colsample_bytree (Optional[float]):
103103
Subsample ratio of columns when constructing each tree. Default to 1.0. The value should be between 0 and 1.
104-
colsample_bylevel : Optional[float]
104+
colsample_bylevel (Optional[float]):
105105
Subsample ratio of columns for each level. Default to 1.0. The value should be between 0 and 1.
106-
colsample_bynode : Optional[float]
106+
colsample_bynode (Optional[float]):
107107
Subsample ratio of columns for each split. Default to 0.8. The value should be between 0 and 1.
108-
gamma : Optional[float]
108+
gamma (Optional[float]):
109109
(min_split_loss) Minimum loss reduction required to make a further partition on a
110110
leaf node of the tree. Default to 0.0.
111-
max_depth : Optional[int]
111+
max_depth (Optional[int]):
112112
Maximum tree depth for base learners. Default to 15. The value should be greater than 0 and less than 1.
113-
subsample : Optional[float]
113+
subsample (Optional[float]:
114114
Subsample ratio of the training instance. Default to 0.8. The value should be greater than 0 and less than 1.
115-
reg_alpha : Optional[float]
115+
reg_alpha (Optional[float]):
116116
L1 regularization term on weights (xgb's alpha). Default to 0.0.
117-
reg_lambda : Optional[float]
117+
reg_lambda (Optional[float]):
118118
L2 regularization term on weights (xgb's lambda). Default to 1.0.
119-
early_stop: Optional[bool]
119+
early_stop (Optional[bool]):
120120
Whether training should stop after the first iteration. Default to True.
121-
min_rel_progress: Optional[float]
121+
min_rel_progress (Optional[float]):
122122
Minimum relative loss improvement necessary to continue training when early_stop is set to True. Default to 0.01.
123-
enable_global_explain: Optional[bool]
123+
enable_global_explain (Optional[bool]):
124124
Whether to compute global explanations using explainable AI to evaluate global feature importance to the model. Default to False.
125-
xgboost_version: Optional[str]
125+
xgboost_version (Optional[str]):
126126
Specifies the Xgboost version for model training. Default to "0.9". Possible values: "0.9", "1.1".
127127
"""
128128

@@ -144,7 +144,7 @@ def predict(self, X):
144144
which we want to get the predictions.
145145
146146
Returns:
147-
The predicted values.
147+
bigframes.dataframe.DataFrame: The predicted values.
148148
"""
149149
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
150150

@@ -158,37 +158,37 @@ class RandomForestClassifier(ForestClassifier):
158158
improve the predictive accuracy and control over-fitting.
159159
160160
Args:
161-
num_parallel_tree: Optional[int]
161+
num_parallel_tree (Optional[int]):
162162
Number of parallel trees constructed during each iteration. Default to 100. Minimum value is 2.
163-
tree_method: Optional[str]
163+
tree_method (Optional[str]):
164164
Specify which tree method to use. Default to "auto". If this parameter is set to
165165
default, XGBoost will choose the most conservative option available. Possible values: ""exact", "approx",
166166
"hist".
167-
min_child_weight : Optional[float]
167+
min_child_weight (Optional[float]):
168168
Minimum sum of instance weight(hessian) needed in a child. Default to 1.
169-
colsample_bytree : Optional[float]
169+
colsample_bytree (Optional[float]):
170170
Subsample ratio of columns when constructing each tree. Default to 1.0. The value should be between 0 and 1.
171-
colsample_bylevel : Optional[float]
171+
colsample_bylevel (Optional[float]):
172172
Subsample ratio of columns for each level. Default to 1.0. The value should be between 0 and 1.
173-
colsample_bynode : Optional[float]
173+
colsample_bynode (Optional[float]):
174174
Subsample ratio of columns for each split. Default to 0.8. The value should be between 0 and 1.
175-
gamma : Optional[float]
175+
gamma (Optional[float]):
176176
(min_split_loss) Minimum loss reduction required to make a further partition on a
177177
leaf node of the tree. Default to 0.0.
178-
max_depth : Optional[int]
178+
max_depth (Optional[int]):
179179
Maximum tree depth for base learners. Default to 15. The value should be greater than 0 and less than 1.
180-
subsample : Optional[float]
180+
subsample (Optional[float]):
181181
Subsample ratio of the training instance. Default to 0.8. The value should be greater than 0 and less than 1.
182-
reg_alpha : Optional[float]
182+
reg_alpha (Optional[float]):
183183
L1 regularization term on weights (xgb's alpha). Default to 0.0.
184-
reg_lambda : Optional[float]
184+
reg_lambda (Optional[float]):
185185
L2 regularization term on weights (xgb's lambda). Default to 1.0.
186-
early_stop: Optional[bool]
186+
early_stop (Optional[bool]):
187187
Whether training should stop after the first iteration. Default to True.
188-
min_rel_progress: Optional[float]
188+
min_rel_progress (Optional[float]):
189189
Minimum relative loss improvement necessary to continue training when early_stop is set to True. Default to 0.01.
190-
enable_global_explain: Optional[bool]
190+
enable_global_explain (Optional[bool]):
191191
Whether to compute global explanations using explainable AI to evaluate global feature importance to the model. Default to False.
192-
xgboost_version: Optional[str]
192+
xgboost_version (Optional[str]):
193193
Specifies the Xgboost version for model training. Default to "0.9". Possible values: "0.9", "1.1".ß
194194
"""

0 commit comments

Comments
 (0)