Skip to content

Commit 1e7793c

Browse files
authored
docs: address more technical writers' feedback (#640)
1 parent 9005c6e commit 1e7793c

File tree

16 files changed

+46
-47
lines changed

16 files changed

+46
-47
lines changed

bigframes/ml/cluster.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ def to_gbq(self, model_name: str, replace: bool = False) -> KMeans:
175175
176176
Args:
177177
model_name (str):
178-
the name of the model.
178+
The name of the model.
179179
replace (bool, default False):
180180
Determine whether to replace if the model already exists. Default to False.
181181
182182
Returns:
183-
KMeans: saved model."""
183+
KMeans: Saved model."""
184184
if not self._bqml_model:
185185
raise RuntimeError("A model must be fitted before it can be saved")
186186

bigframes/ml/decomposition.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,12 @@ def to_gbq(self, model_name: str, replace: bool = False) -> PCA:
169169
170170
Args:
171171
model_name (str):
172-
the name of the model.
172+
The name of the model.
173173
replace (bool, default False):
174174
Determine whether to replace if the model already exists. Default to False.
175175
176176
Returns:
177-
PCA: saved model."""
177+
PCA: Saved model."""
178178
if not self._bqml_model:
179179
raise RuntimeError("A model must be fitted before it can be saved")
180180

bigframes/ml/forecasting.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def to_gbq(self, model_name: str, replace: bool = False) -> ARIMAPlus:
361361
362362
Args:
363363
model_name (str):
364-
the name of the model.
364+
The name of the model.
365365
replace (bool, default False):
366366
Determine whether to replace if the model already exists. Default to False.
367367

bigframes/ml/imported.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def to_gbq(self, model_name: str, replace: bool = False) -> TensorFlowModel:
8989
9090
Args:
9191
model_name (str):
92-
the name of the model.
92+
The name of the model.
9393
replace (bool, default False):
9494
Default to False.
9595
@@ -166,7 +166,7 @@ def to_gbq(self, model_name: str, replace: bool = False) -> ONNXModel:
166166
167167
Args:
168168
model_name (str):
169-
the name of the model.
169+
The name of the model.
170170
replace (bool, default False):
171171
Determine whether to replace if the model already exists. Default to False.
172172
@@ -282,7 +282,7 @@ def to_gbq(self, model_name: str, replace: bool = False) -> XGBoostModel:
282282
283283
Args:
284284
model_name (str):
285-
the name of the model.
285+
The name of the model.
286286
replace (bool, default False):
287287
Determine whether to replace if the model already exists. Default to False.
288288

bigframes/ml/linear_model.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ def to_gbq(self, model_name: str, replace: bool = False) -> LinearRegression:
182182
183183
Args:
184184
model_name (str):
185-
the name of the model.
185+
The name of the model.
186186
replace (bool, default False):
187187
Determine whether to replace if the model already exists. Default to False.
188188
189189
Returns:
190-
LinearRegression: saved model."""
190+
LinearRegression: Saved model."""
191191
if not self._bqml_model:
192192
raise RuntimeError("A model must be fitted before it can be saved")
193193

@@ -347,12 +347,12 @@ def to_gbq(self, model_name: str, replace: bool = False) -> LogisticRegression:
347347
348348
Args:
349349
model_name (str):
350-
the name of the model.
350+
The name of the model.
351351
replace (bool, default False):
352352
Determine whether to replace if the model already exists. Default to False.
353353
354354
Returns:
355-
LogisticRegression: saved model."""
355+
LogisticRegression: Saved model."""
356356
if not self._bqml_model:
357357
raise RuntimeError("A model must be fitted before it can be saved")
358358

bigframes/ml/llm.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class PaLM2TextGenerator(base.BaseEstimator):
6464
BQ session to create the model. If None, use the global default session.
6565
connection_name (str or None):
6666
Connection to connect with remote service. str of the format <PROJECT_NUMBER/PROJECT_ID>.<LOCATION>.<CONNECTION_ID>.
67-
if None, use default connection in session context. BigQuery DataFrame will try to create the connection and attach
68-
permission if the connection isn't fully setup.
67+
If None, use default connection in session context. BigQuery DataFrame will try to create the connection and attach
68+
permission if the connection isn't fully set up.
6969
max_iterations (Optional[int], Default to 300):
7070
The number of steps to run when performing supervised tuning.
7171
"""
@@ -191,7 +191,7 @@ def fit(
191191
Training labels.
192192
193193
Returns:
194-
PaLM2TextGenerator: Fitted Estimator.
194+
PaLM2TextGenerator: Fitted estimator.
195195
"""
196196
X, y = utils.convert_to_dataframe(X, y)
197197

@@ -372,12 +372,12 @@ def to_gbq(self, model_name: str, replace: bool = False) -> PaLM2TextGenerator:
372372
373373
Args:
374374
model_name (str):
375-
the name of the model.
375+
The name of the model.
376376
replace (bool, default False):
377377
Determine whether to replace if the model already exists. Default to False.
378378
379379
Returns:
380-
PaLM2TextGenerator: saved model."""
380+
PaLM2TextGenerator: Saved model."""
381381

382382
new_model = self._bqml_model.copy(model_name, replace)
383383
return new_model.session.read_gbq_model(model_name)
@@ -390,16 +390,16 @@ class PaLM2TextEmbeddingGenerator(base.BaseEstimator):
390390
Args:
391391
model_name (str, Default to "textembedding-gecko"):
392392
The model for text embedding. “textembedding-gecko” returns model embeddings for text inputs.
393-
"textembedding-gecko-multilingual" returns model embeddings for text inputs which support over 100 languages
393+
"textembedding-gecko-multilingual" returns model embeddings for text inputs which support over 100 languages.
394394
Default to "textembedding-gecko".
395395
version (str or None):
396396
Model version. Accepted values are "001", "002", "003", "latest" etc. Will use the default version if unset.
397397
See https://cloud.google.com/vertex-ai/docs/generative-ai/learn/model-versioning for details.
398398
session (bigframes.Session or None):
399399
BQ session to create the model. If None, use the global default session.
400400
connection_name (str or None):
401-
connection to connect with remote service. str of the format <PROJECT_NUMBER/PROJECT_ID>.<LOCATION>.<CONNECTION_ID>.
402-
if None, use default connection in session context.
401+
Connection to connect with remote service. str of the format <PROJECT_NUMBER/PROJECT_ID>.<LOCATION>.<CONNECTION_ID>.
402+
If None, use default connection in session context.
403403
"""
404404

405405
def __init__(
@@ -539,12 +539,12 @@ def to_gbq(
539539
540540
Args:
541541
model_name (str):
542-
the name of the model.
542+
The name of the model.
543543
replace (bool, default False):
544544
Determine whether to replace if the model already exists. Default to False.
545545
546546
Returns:
547-
PaLM2TextEmbeddingGenerator: saved model."""
547+
PaLM2TextEmbeddingGenerator: Saved model."""
548548

549549
new_model = self._bqml_model.copy(model_name, replace)
550550
return new_model.session.read_gbq_model(model_name)
@@ -565,8 +565,8 @@ class GeminiTextGenerator(base.BaseEstimator):
565565
BQ session to create the model. If None, use the global default session.
566566
connection_name (str or None):
567567
Connection to connect with remote service. str of the format <PROJECT_NUMBER/PROJECT_ID>.<LOCATION>.<CONNECTION_ID>.
568-
if None, use default connection in session context. BigQuery DataFrame will try to create the connection and attach
569-
permission if the connection isn't fully setup.
568+
If None, use default connection in session context. BigQuery DataFrame will try to create the connection and attach
569+
permission if the connection isn't fully set up.
570570
"""
571571

572572
def __init__(
@@ -719,12 +719,12 @@ def to_gbq(self, model_name: str, replace: bool = False) -> GeminiTextGenerator:
719719
720720
Args:
721721
model_name (str):
722-
the name of the model.
722+
The name of the model.
723723
replace (bool, default False):
724724
Determine whether to replace if the model already exists. Default to False.
725725
726726
Returns:
727-
GeminiTextGenerator: saved model."""
727+
GeminiTextGenerator: Saved model."""
728728

729729
new_model = self._bqml_model.copy(model_name, replace)
730730
return new_model.session.read_gbq_model(model_name)

bigframes/ml/pipeline.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ def to_gbq(self, model_name: str, replace: bool = False) -> Pipeline:
126126
127127
Args:
128128
model_name (str):
129-
the name of the model(pipeline).
129+
The name of the model(pipeline).
130130
replace (bool, default False):
131-
whether to replace if the model(pipeline) already exists. Default to False.
131+
Whether to replace if the model(pipeline) already exists. Default to False.
132132
133133
Returns:
134-
Pipeline: saved model(pipeline)."""
134+
Pipeline: Saved model(pipeline)."""
135135
if not self._estimator._bqml_model:
136136
raise RuntimeError("A model must be fitted before it can be saved")
137137

bigframes/ml/remote.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030

3131
@log_adapter.class_logger
3232
class VertexAIModel(base.BaseEstimator):
33-
"""Remote model from a Vertex AI https endpoint. User must specify https endpoint, input schema and output schema.
34-
How to deploy a model in Vertex AI https://cloud.google.com/bigquery/docs/bigquery-ml-remote-model-tutorial#Deploy-Model-on-Vertex-AI.
33+
"""Remote model from a Vertex AI HTTPS endpoint. User must specify HTTPS endpoint, input schema and output schema.
34+
For more information, see Deploy model on Vertex AI: https://cloud.google.com/bigquery/docs/bigquery-ml-remote-model-tutorial#Deploy-Model-on-Vertex-AI.
3535
3636
Args:
3737
endpoint (str):
38-
Vertex AI https endpoint.
38+
Vertex AI HTTPS endpoint.
3939
input (Mapping):
4040
Input schema: `{column_name: column_type}`. Supported types are "bool", "string", "int64", "float64", "array<bool>", "array<string>", "array<int64>", "array<float64>".
4141
output (Mapping):
@@ -44,8 +44,8 @@ class VertexAIModel(base.BaseEstimator):
4444
BQ session to create the model. If None, use the global default session.
4545
connection_name (str or None):
4646
Connection to connect with remote service. str of the format <PROJECT_NUMBER/PROJECT_ID>.<LOCATION>.<CONNECTION_ID>.
47-
if None, use default connection in session context. BigQuery DataFrame will try to create the connection and attach
48-
permission if the connection isn't fully setup.
47+
If None, use default connection in session context. BigQuery DataFrame will try to create the connection and attach
48+
permission if the connection isn't fully set up.
4949
"""
5050

5151
def __init__(

third_party/bigframes_vendored/sklearn/cluster/_kmeans.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def fit(
7575
Not used, present here for API consistency by convention.
7676
7777
Returns:
78-
KMeans: Fitted Estimator.
78+
KMeans: Fitted estimator.
7979
"""
8080
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
8181

third_party/bigframes_vendored/sklearn/ensemble/_forest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def fit(self, X, y):
5656
5757
5858
Returns:
59-
ForestModel: Fitted Estimator.
59+
ForestModel: Fitted estimator.
6060
"""
6161
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
6262

third_party/bigframes_vendored/sklearn/linear_model/_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@ def fit(
109109
Target values. Will be cast to X's dtype if necessary.
110110
111111
Returns:
112-
LinearRegression: Fitted Estimator.
112+
LinearRegression: Fitted estimator.
113113
"""
114114
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

third_party/bigframes_vendored/sklearn/linear_model/_logistic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ def fit(
7979
8080
8181
Returns:
82-
LogisticRegression: Fitted Estimator.
82+
LogisticRegression: Fitted estimator.
8383
"""
8484
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

third_party/bigframes_vendored/sklearn/metrics/pairwise.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def paired_cosine_distances(X, Y) -> bpd.DataFrame:
2121
Input data. X and Y are mapped by indexes, must have the same index.
2222
2323
Returns:
24-
bigframes.dataframe.DataFrame: DataFrame with columns of X, Y and cosine_distance
24+
bigframes.dataframe.DataFrame: DataFrame with columns of X, Y and cosine_distance.
2525
"""
2626
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
2727

@@ -36,7 +36,7 @@ def paired_manhattan_distance(X, Y) -> bpd.DataFrame:
3636
Input data. X and Y are mapped by indexes, must have the same index.
3737
3838
Returns:
39-
bigframes.dataframe.DataFrame: DataFrame with columns of X, Y and manhattan_distance
39+
bigframes.dataframe.DataFrame: DataFrame with columns of X, Y and manhattan_distance.
4040
"""
4141
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
4242

@@ -51,6 +51,6 @@ def paired_euclidean_distances(X, Y) -> bpd.DataFrame:
5151
Input data. X and Y are mapped by indexes, must have the same index.
5252
5353
Returns:
54-
bigframes.dataframe.DataFrame: DataFrame with columns of X, Y and euclidean_distance
54+
bigframes.dataframe.DataFrame: DataFrame with columns of X, Y and euclidean_distance.
5555
"""
5656
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

third_party/bigframes_vendored/sklearn/pipeline.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ class Pipeline(BaseEstimator, metaclass=ABCMeta):
2525
The final estimator only needs to implement `fit`.
2626
2727
The purpose of the pipeline is to assemble several steps that can be
28-
cross-validated together while setting different parameters. This
29-
simplifies code and allows for deploying an estimator and peprocessing
30-
together, e.g. with `Pipeline.to_gbq(...).`
28+
cross-validated together while setting different parameters. This simplifies code and allows for
29+
deploying an estimator and preprocessing together, e.g. with `Pipeline.to_gbq(...).`
3130
"""
3231

3332
def fit(

third_party/bigframes_vendored/sklearn/preprocessing/_encoder.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,6 @@ def transform(self, X):
8484
The DataFrame or Series to be transformed.
8585
8686
Returns:
87-
bigframes.dataframe.DataFrame: The result is categorized as index: number, value: number.
88-
Where index is the position of the dict that seeing the category, and value is 0 or 1."""
87+
bigframes.dataframe.DataFrame: The result is categorized as index: number, value: number,
88+
where index is the position of the dict seeing the category, and value is 0 or 1."""
8989
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

third_party/bigframes_vendored/xgboost/sklearn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def fit(self, X, y):
3838
Target values. Will be cast to X's dtype if necessary.
3939
4040
Returns:
41-
XGBModel: Fitted Estimator.
41+
XGBModel: Fitted estimator.
4242
"""
4343
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
4444

0 commit comments

Comments
 (0)