Skip to content

fix: address more technical writers feedback #581

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

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bigframes/_config/compute_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@dataclasses.dataclass
class ComputeOptions:
"""
Encapsulates configuration for compute options.
Encapsulates the configuration for compute options.

**Examples:**

Expand All @@ -39,7 +39,7 @@ class ComputeOptions:
Limits the bytes billed for query jobs. Queries that will have
bytes billed beyond this limit will fail (without incurring a
charge). If unspecified, this will be set to your project default.
See `maximum_bytes_billed <https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.job.QueryJobConfig#google_cloud_bigquery_job_QueryJobConfig_maximum_bytes_billed>`_.
See `maximum_bytes_billed`: https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.job.QueryJobConfig#google_cloud_bigquery_job_QueryJobConfig_maximum_bytes_billed.
enable_multi_query_execution (bool, Options):
If enabled, large queries may be factored into multiple smaller queries
in order to avoid generating queries that are too complex for the query
Expand Down
2 changes: 1 addition & 1 deletion bigframes/ml/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def to_gbq(self: _T, model_name: str, replace: bool = False) -> _T:
model_name (str):
The name of the model.
replace (bool, default False):
Whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
Saved transformer."""
Expand Down
2 changes: 1 addition & 1 deletion bigframes/ml/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def to_gbq(self, model_name: str, replace: bool = False) -> KMeans:
model_name (str):
the name of the model.
replace (bool, default False):
whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
KMeans: saved model."""
Expand Down
2 changes: 1 addition & 1 deletion bigframes/ml/decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def to_gbq(self, model_name: str, replace: bool = False) -> PCA:
model_name (str):
the name of the model.
replace (bool, default False):
whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
PCA: saved model."""
Expand Down
16 changes: 8 additions & 8 deletions bigframes/ml/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ def to_gbq(self, model_name: str, replace: bool = False) -> XGBRegressor:
model_name (str):
The name of the model.
replace (bool, default False):
Whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns: saved model."""
Returns: Saved model."""
if not self._bqml_model:
raise RuntimeError("A model must be fitted before it can be saved")

Expand Down Expand Up @@ -345,10 +345,10 @@ def to_gbq(self, model_name: str, replace: bool = False) -> XGBClassifier:
model_name (str):
The name of the model.
replace (bool, default False):
Whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
XGBClassifier: saved model."""
XGBClassifier: Saved model."""
if not self._bqml_model:
raise RuntimeError("A model must be fitted before it can be saved")

Expand Down Expand Up @@ -508,10 +508,10 @@ def to_gbq(self, model_name: str, replace: bool = False) -> RandomForestRegresso
model_name (str):
The name of the model.
replace (bool, default False):
Whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
RandomForestRegressor: saved model."""
RandomForestRegressor: Saved model."""
if not self._bqml_model:
raise RuntimeError("A model must be fitted before it can be saved")

Expand Down Expand Up @@ -671,10 +671,10 @@ def to_gbq(self, model_name: str, replace: bool = False) -> RandomForestClassifi
model_name (str):
The name of the model.
replace (bool, default False):
Whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
RandomForestClassifier: saved model."""
RandomForestClassifier: Saved model."""
if not self._bqml_model:
raise RuntimeError("A model must be fitted before it can be saved")

Expand Down
4 changes: 2 additions & 2 deletions bigframes/ml/forecasting.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@ def to_gbq(self, model_name: str, replace: bool = False) -> ARIMAPlus:
model_name (str):
the name of the model.
replace (bool, default False):
whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
ARIMAPlus: saved model."""
ARIMAPlus: Saved model."""
if not self._bqml_model:
raise RuntimeError("A model must be fitted before it can be saved")

Expand Down
24 changes: 12 additions & 12 deletions bigframes/ml/imported.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TensorFlowModel(base.Predictor):

Args:
model_path (str):
GCS path that holds the model files.
Cloud Storage path that holds the model files.
session (BigQuery Session):
BQ session to create the model.
"""
Expand Down Expand Up @@ -69,10 +69,10 @@ def predict(self, X: Union[bpd.DataFrame, bpd.Series]) -> bpd.DataFrame:

Args:
X (bigframes.dataframe.DataFrame):
Input DataFrame, schema is defined by the model.
Input DataFrame. Schema is defined by the model.

Returns:
bigframes.dataframe.DataFrame: Output DataFrame, schema is defined by the model."""
bigframes.dataframe.DataFrame: Output DataFrame. Schema is defined by the model."""

if not self._bqml_model:
if self.model_path is None:
Expand All @@ -91,10 +91,10 @@ def to_gbq(self, model_name: str, replace: bool = False) -> TensorFlowModel:
model_name (str):
the name of the model.
replace (bool, default False):
whether to replace if the model already exists. Default to False.
Default to False.

Returns:
TensorFlowModel: saved model."""
TensorFlowModel: Saved model."""
if not self._bqml_model:
if self.model_path is None:
raise ValueError("Model GCS path must be provided.")
Expand Down Expand Up @@ -146,7 +146,7 @@ def predict(self, X: Union[bpd.DataFrame, bpd.Series]) -> bpd.DataFrame:

Args:
X (bigframes.dataframe.DataFrame or bigframes.series.Series):
Input DataFrame or Series, schema is defined by the model.
Input DataFrame or Series. Schema is defined by the model.

Returns:
bigframes.dataframe.DataFrame: Output DataFrame, schema is defined by the model."""
Expand All @@ -168,10 +168,10 @@ def to_gbq(self, model_name: str, replace: bool = False) -> ONNXModel:
model_name (str):
the name of the model.
replace (bool, default False):
whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
ONNXModel: saved model."""
ONNXModel: Saved model."""
if not self._bqml_model:
if self.model_path is None:
raise ValueError("Model GCS path must be provided.")
Expand Down Expand Up @@ -262,10 +262,10 @@ def predict(self, X: Union[bpd.DataFrame, bpd.Series]) -> bpd.DataFrame:

Args:
X (bigframes.dataframe.DataFrame or bigframes.series.Series):
Input DataFrame or Series, schema is defined by the model.
Input DataFrame or Series. Schema is defined by the model.

Returns:
bigframes.dataframe.DataFrame: Output DataFrame, schema is defined by the model."""
bigframes.dataframe.DataFrame: Output DataFrame. Schema is defined by the model."""

if not self._bqml_model:
if self.model_path is None:
Expand All @@ -284,10 +284,10 @@ def to_gbq(self, model_name: str, replace: bool = False) -> XGBoostModel:
model_name (str):
the name of the model.
replace (bool, default False):
whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
XGBoostModel: saved model."""
XGBoostModel: Saved model."""
if not self._bqml_model:
if self.model_path is None:
raise ValueError("Model GCS path must be provided.")
Expand Down
4 changes: 2 additions & 2 deletions bigframes/ml/linear_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def to_gbq(self, model_name: str, replace: bool = False) -> LinearRegression:
model_name (str):
the name of the model.
replace (bool, default False):
whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
LinearRegression: saved model."""
Expand Down Expand Up @@ -349,7 +349,7 @@ def to_gbq(self, model_name: str, replace: bool = False) -> LogisticRegression:
model_name (str):
the name of the model.
replace (bool, default False):
whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
LogisticRegression: saved model."""
Expand Down
6 changes: 3 additions & 3 deletions bigframes/ml/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def to_gbq(self, model_name: str, replace: bool = False) -> PaLM2TextGenerator:
model_name (str):
the name of the model.
replace (bool, default False):
whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
PaLM2TextGenerator: saved model."""
Expand Down Expand Up @@ -415,7 +415,7 @@ def to_gbq(
model_name (str):
the name of the model.
replace (bool, default False):
whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
PaLM2TextEmbeddingGenerator: saved model."""
Expand Down Expand Up @@ -595,7 +595,7 @@ def to_gbq(self, model_name: str, replace: bool = False) -> GeminiTextGenerator:
model_name (str):
the name of the model.
replace (bool, default False):
whether to replace if the model already exists. Default to False.
Determine whether to replace if the model already exists. Default to False.

Returns:
GeminiTextGenerator: saved model."""
Expand Down
4 changes: 2 additions & 2 deletions third_party/bigframes_vendored/pandas/core/config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from __future__ import annotations

display_options_doc = """
Encapsulates configuration for displaying objects.
Encapsulates the configuration for displaying objects.

**Examples:**

Expand Down Expand Up @@ -79,7 +79,7 @@
"""

sampling_options_doc = """
Encapsulates configuration for data sampling.
Encapsulates the configuration for data sampling.

Attributes:
max_download_size (int, default 500):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def any(self):
Returns:
Series or DataFrame: DataFrame or Series of boolean values,
where a value is True if any element is True within its
respective group, False otherwise.
respective group; otherwise False.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

Expand All @@ -35,7 +35,7 @@ def all(self):
Returns:
Series or DataFrame: DataFrame or Series of boolean values,
where a value is True if all elements are True within its
respective group, False otherwise.
respective group; otherwise False.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

Expand Down Expand Up @@ -339,7 +339,7 @@ def expanding(self, *args, **kwargs):
Provides expanding functionality.

Returns:
Series or DataFrame: A expanding grouper, providing expanding functionality per group.
Series or DataFrame: An expanding grouper, providing expanding functionality per group.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

Expand Down
10 changes: 5 additions & 5 deletions third_party/bigframes_vendored/pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def copy(
name (Label, optional):
Set name for new object.
Returns:
Index: Index refer to new object which is a copy of this object.
Index: Index reference to new object, which is a copy of this object.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

Expand Down Expand Up @@ -148,7 +148,7 @@ def isin(self, values):
"""
Return a boolean array where the index values are in `values`.

Compute boolean array of whether each index value is found in the
Compute boolean array to check whether each index value is found in the
passed set of values. The length of the returned boolean array matches
the length of the index.

Expand Down Expand Up @@ -195,7 +195,7 @@ def max(self):

def argmin(self) -> int:
"""
Return int position of the smallest value in the Series.
Return int position of the smallest value in the series.

If the minimum is achieved in multiple locations,
the first row position is returned.
Expand Down Expand Up @@ -264,7 +264,7 @@ def value_counts(

Args:
normalize (bool, default False):
If True then the object returned will contain the relative
If True, then the object returned will contain the relative
frequencies of the unique values.
sort (bool, default True):
Sort by frequencies.
Expand Down Expand Up @@ -316,7 +316,7 @@ def drop(self, labels) -> Index:
labels (array-like or scalar):

Returns:
Index: Will be same type as self
Index: Will be same type as self.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

Expand Down
2 changes: 1 addition & 1 deletion third_party/bigframes_vendored/pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2836,7 +2836,7 @@ def unstack(self, level):

def argmax(self):
"""
Return int position of the smallest value in the Series.
Return int position of the smallest value in the series.

If the minimum is achieved in multiple locations, the first row position is returned.

Expand Down
6 changes: 3 additions & 3 deletions third_party/bigframes_vendored/sklearn/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class ClassifierMixin:
def score(self, X, y):
"""Return the mean accuracy on the given test data and labels.

In multi-label classification, this is the subset accuracy
which is a harsh metric since you require for each sample that
each label set be correctly predicted.
In multi-label classification, this is the subset accuracy,
which is a harsh metric since you require that
each label set be correctly predicted for each sample.

.. note::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PCA(BaseEstimator, metaclass=ABCMeta):

Args:
n_components (int, float or None, default None):
Number of components to keep. If n_components is not set all
Number of components to keep. If n_components is not set, all
components are kept, n_components = min(n_samples, n_features).
If 0 < n_components < 1, select the number of components such that the amount of variance that needs to be explained is greater than the percentage specified by n_components.
svd_solver ("full", "randomized" or "auto", default "auto"):
Expand Down Expand Up @@ -75,7 +75,7 @@ def predict(self, X):
Series or a DataFrame to predict.

Returns:
bigframes.dataframe.DataFrame: predicted DataFrames."""
bigframes.dataframe.DataFrame: Predicted DataFrames."""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

@property
Expand All @@ -90,7 +90,7 @@ def components_(self):

numerical_value: If feature is numeric, the value of feature for the principal component that principal_component_id identifies. If feature isn't numeric, the value is NULL.

categorical_value: An list of mappings containing information about categorical features. Each mapping contains the following fields:
categorical_value: A list of mappings containing information about categorical features. Each mapping contains the following fields:
categorical_value.category: The name of each category.

categorical_value.value: The value of categorical_value.category for the centroid that centroid_id identifies.
Expand Down