Skip to content

Commit 9084df3

Browse files
authored
docs: address more comments from technical writers to meet legal purposes (#571)
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) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent 39fe474 commit 9084df3

File tree

11 files changed

+30
-30
lines changed

11 files changed

+30
-30
lines changed

bigframes/ml/base.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def fit_transform(self, x_train: Union[DataFrame, Series], y_train: Union[DataFr
7777
"""
7878

7979
def __repr__(self):
80-
"""Print the estimator's constructor with all non-default parameter values"""
80+
"""Print the estimator's constructor with all non-default parameter values."""
8181

8282
# Estimator pretty printer adapted from Sklearn's, which is in turn an adaption of
8383
# the inbuilt pretty-printer in CPython
@@ -106,13 +106,13 @@ def predict(self, X):
106106
def register(self: _T, vertex_ai_model_id: Optional[str] = None) -> _T:
107107
"""Register the model to Vertex AI.
108108
109-
After register, go to Google Cloud Console (https://console.cloud.google.com/vertex-ai/models)
109+
After register, go to the Google Cloud console (https://console.cloud.google.com/vertex-ai/models)
110110
to manage the model registries.
111111
Refer to https://cloud.google.com/vertex-ai/docs/model-registry/introduction for more options.
112112
113113
Args:
114114
vertex_ai_model_id (Optional[str], default None):
115-
optional string id as model id in Vertex. If not set, will by default to 'bigframes_{bq_model_id}'.
115+
Optional string id as model id in Vertex. If not set, will default to 'bigframes_{bq_model_id}'.
116116
Vertex Ai model id will be truncated to 63 characters due to its limitation.
117117
118118
Returns:
@@ -191,9 +191,9 @@ def to_gbq(self: _T, model_name: str, replace: bool = False) -> _T:
191191
192192
Args:
193193
model_name (str):
194-
the name of the model.
194+
The name of the model.
195195
replace (bool, default False):
196-
whether to replace if the model already exists. Default to False.
196+
Whether to replace if the model already exists. Default to False.
197197
198198
Returns:
199199
Saved transformer."""

bigframes/ml/ensemble.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Ensemble models. This module is styled after Scikit-Learn's ensemble module:
15+
"""Ensemble models. This module is styled after scikit-learn's ensemble module:
1616
https://scikit-learn.org/stable/modules/ensemble.html"""
1717

1818
from __future__ import annotations
@@ -190,9 +190,9 @@ def to_gbq(self, model_name: str, replace: bool = False) -> XGBRegressor:
190190
191191
Args:
192192
model_name (str):
193-
the name of the model.
193+
The name of the model.
194194
replace (bool, default False):
195-
whether to replace if the model already exists. Default to False.
195+
Whether to replace if the model already exists. Default to False.
196196
197197
Returns: saved model."""
198198
if not self._bqml_model:
@@ -343,9 +343,9 @@ def to_gbq(self, model_name: str, replace: bool = False) -> XGBClassifier:
343343
344344
Args:
345345
model_name (str):
346-
the name of the model.
346+
The name of the model.
347347
replace (bool, default False):
348-
whether to replace if the model already exists. Default to False.
348+
Whether to replace if the model already exists. Default to False.
349349
350350
Returns:
351351
XGBClassifier: saved model."""
@@ -506,9 +506,9 @@ def to_gbq(self, model_name: str, replace: bool = False) -> RandomForestRegresso
506506
507507
Args:
508508
model_name (str):
509-
the name of the model.
509+
The name of the model.
510510
replace (bool, default False):
511-
whether to replace if the model already exists. Default to False.
511+
Whether to replace if the model already exists. Default to False.
512512
513513
Returns:
514514
RandomForestRegressor: saved model."""
@@ -669,9 +669,9 @@ def to_gbq(self, model_name: str, replace: bool = False) -> RandomForestClassifi
669669
670670
Args:
671671
model_name (str):
672-
the name of the model.
672+
The name of the model.
673673
replace (bool, default False):
674-
whether to replace if the model already exists. Default to False.
674+
Whether to replace if the model already exists. Default to False.
675675
676676
Returns:
677677
RandomForestClassifier: saved model."""

bigframes/ml/forecasting.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,12 @@ def predict(
248248
an int value that specifies the number of time points to forecast.
249249
The default value is 3, and the maximum value is 1000.
250250
confidence_level (float, default 0.95):
251-
a float value that specifies percentage of the future values that fall in the prediction interval.
251+
A float value that specifies percentage of the future values that fall in the prediction interval.
252252
The valid input range is [0.0, 1.0).
253253
254254
Returns:
255255
bigframes.dataframe.DataFrame: The predicted DataFrames. Which
256-
contains 2 columns "forecast_timestamp" and "forecast_value".
256+
contains 2 columns: "forecast_timestamp" and "forecast_value".
257257
"""
258258
if horizon < 1 or horizon > 1000:
259259
raise ValueError(f"horizon must be [1, 1000], but is {horizon}.")
@@ -284,7 +284,7 @@ def detect_anomalies(
284284
Identifies the custom threshold to use for anomaly detection. The value must be in the range [0, 1), with a default value of 0.95.
285285
286286
Returns:
287-
bigframes.dataframe.DataFrame: detected DataFrame."""
287+
bigframes.dataframe.DataFrame: Detected DataFrame."""
288288
if anomaly_prob_threshold < 0.0 or anomaly_prob_threshold >= 1.0:
289289
raise ValueError(
290290
f"anomaly_prob_threshold must be [0.0, 1.0), but is {anomaly_prob_threshold}."

bigframes/ml/metrics/_metrics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
"""Metrics functions for evaluating models. This module is styled after
16-
Scikit-Learn's metrics module: https://scikit-learn.org/stable/modules/metrics.html."""
16+
scikit-learn's metrics module: https://scikit-learn.org/stable/modules/metrics.html."""
1717

1818
import inspect
1919
import typing

bigframes/ml/model_selection.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
"""Functions for test/train split and model tuning. This module is styled after
16-
Scikit-Learn's model_selection module:
16+
scikit-learn's model_selection module:
1717
https://scikit-learn.org/stable/modules/classes.html#module-sklearn.model_selection."""
1818

1919

@@ -51,7 +51,7 @@ def train_test_split(
5151
List[Union[bigframes.dataframe.DataFrame, bigframes.series.Series]]: A list of BigQuery DataFrames or Series.
5252
"""
5353

54-
# TODO(garrettwu): Scikit-Learn throws an error when the dataframes don't have the same
54+
# TODO(garrettwu): scikit-learn throws an error when the dataframes don't have the same
5555
# number of rows. We probably want to do something similar. Now the implementation is based
5656
# on index. We'll move to based on ordering first.
5757

bigframes/ml/pipeline.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""For composing estimators together. This module is styled after Scikit-Learn's
15+
"""For composing estimators together. This module is styled after scikit-learn's
1616
pipeline module: https://scikit-learn.org/stable/modules/pipeline.html."""
1717

1818

bigframes/ml/preprocessing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
"""Transformers that prepare data for other estimators. This module is styled after
16-
Scikit-Learn's preprocessing module: https://scikit-learn.org/stable/modules/preprocessing.html."""
16+
scikit-learn's preprocessing module: https://scikit-learn.org/stable/modules/preprocessing.html."""
1717

1818
from __future__ import annotations
1919

notebooks/getting_started/ml_fundamentals_bq_dataframes.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@
10511051
"source": [
10521052
"## Estimators\n",
10531053
"\n",
1054-
"Following Scikit-Learn, all learning components are \"estimators\"; objects that can learn from training data and then apply themselves to new data. Estimators share the following patterns:\n",
1054+
"Following scikit-learn, all learning components are \"estimators\"; objects that can learn from training data and then apply themselves to new data. Estimators share the following patterns:\n",
10551055
"\n",
10561056
"- a constructor that takes a list of parameters\n",
10571057
"- a standard string representation that shows the class name and all non-default parameters, e.g. `LinearRegression(fit_intercept=False)`\n",

notebooks/regression/sklearn_linear_regression.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"source": [
88
"# Using ML - SKLearn linear regression\n",
99
"\n",
10-
"This demo shows how we can implement a linear regression in BigQuery DataFrames ML, with API that is exactly compatible with Scikit-Learn."
10+
"This demo shows how we can implement a linear regression in BigQuery DataFrames ML, with API that is exactly compatible with scikit-learn."
1111
]
1212
},
1313
{

third_party/bigframes_vendored/pandas/core/config_init.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@
5959
repr_mode (Literal[`head`, `deferred`]):
6060
`head`:
6161
Execute, download, and display results (limited to head) from
62-
dataframe and series objects during repr.
62+
Dataframe and Series objects during repr.
6363
`deferred`:
64-
Prevent executions from repr statements in dataframe and series objects.
65-
Instead estimated bytes processed will be shown. Dataframe and Series
64+
Prevent executions from repr statements in DataFrame and Series objects.
65+
Instead, estimated bytes processed will be shown. DataFrame and Series
6666
objects can still be computed with methods that explicitly execute and
6767
download results.
6868
max_info_columns (int):
6969
max_info_columns is used in DataFrame.info method to decide if
70-
per column information will be printed.
70+
information in each column will be printed.
7171
max_info_rows (int or None):
7272
df.info() will usually show null-counts for each column.
73-
For large frames this can be quite slow. max_info_rows and max_info_cols
73+
For large frames, this can be quite slow. max_info_rows and max_info_cols
7474
limit this null check only to frames with smaller dimensions than
7575
specified.
7676
memory_usage (bool):

third_party/bigframes_vendored/xgboost/sklearn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Scikit-Learn Wrapper interface for XGBoost."""
1+
"""scikit-learn Wrapper interface for XGBoost."""
22

33
from typing import Any
44

0 commit comments

Comments
 (0)