diff --git a/bigframes/_config/compute_options.py b/bigframes/_config/compute_options.py index 2b849c558a..81ef044f4d 100644 --- a/bigframes/_config/compute_options.py +++ b/bigframes/_config/compute_options.py @@ -21,7 +21,7 @@ @dataclasses.dataclass class ComputeOptions: """ - Encapsulates configuration for compute options. + Encapsulates the configuration for compute options. **Examples:** @@ -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 `_. + 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 diff --git a/bigframes/ml/base.py b/bigframes/ml/base.py index c57cb78791..6c81b66e55 100644 --- a/bigframes/ml/base.py +++ b/bigframes/ml/base.py @@ -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.""" diff --git a/bigframes/ml/cluster.py b/bigframes/ml/cluster.py index 1035def54d..e63764e7bb 100644 --- a/bigframes/ml/cluster.py +++ b/bigframes/ml/cluster.py @@ -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.""" diff --git a/bigframes/ml/decomposition.py b/bigframes/ml/decomposition.py index 475b4a046f..0dfb46efaa 100644 --- a/bigframes/ml/decomposition.py +++ b/bigframes/ml/decomposition.py @@ -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.""" diff --git a/bigframes/ml/ensemble.py b/bigframes/ml/ensemble.py index a8f0329145..b248c295f4 100644 --- a/bigframes/ml/ensemble.py +++ b/bigframes/ml/ensemble.py @@ -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") @@ -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") @@ -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") @@ -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") diff --git a/bigframes/ml/forecasting.py b/bigframes/ml/forecasting.py index e50a8ed35b..a7e0c3c0d9 100644 --- a/bigframes/ml/forecasting.py +++ b/bigframes/ml/forecasting.py @@ -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") diff --git a/bigframes/ml/imported.py b/bigframes/ml/imported.py index b551150050..9198b4eafb 100644 --- a/bigframes/ml/imported.py +++ b/bigframes/ml/imported.py @@ -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. """ @@ -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: @@ -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.") @@ -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.""" @@ -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.") @@ -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: @@ -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.") diff --git a/bigframes/ml/linear_model.py b/bigframes/ml/linear_model.py index c0abe77b9f..63462be09f 100644 --- a/bigframes/ml/linear_model.py +++ b/bigframes/ml/linear_model.py @@ -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.""" @@ -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.""" diff --git a/bigframes/ml/llm.py b/bigframes/ml/llm.py index ffaeb399bb..31c691fd51 100644 --- a/bigframes/ml/llm.py +++ b/bigframes/ml/llm.py @@ -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.""" @@ -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.""" @@ -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.""" diff --git a/third_party/bigframes_vendored/pandas/core/config_init.py b/third_party/bigframes_vendored/pandas/core/config_init.py index a3178e2761..84ab90a322 100644 --- a/third_party/bigframes_vendored/pandas/core/config_init.py +++ b/third_party/bigframes_vendored/pandas/core/config_init.py @@ -13,7 +13,7 @@ from __future__ import annotations display_options_doc = """ -Encapsulates configuration for displaying objects. +Encapsulates the configuration for displaying objects. **Examples:** @@ -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): diff --git a/third_party/bigframes_vendored/pandas/core/groupby/__init__.py b/third_party/bigframes_vendored/pandas/core/groupby/__init__.py index e1cc8c5a53..ed4ca66f38 100644 --- a/third_party/bigframes_vendored/pandas/core/groupby/__init__.py +++ b/third_party/bigframes_vendored/pandas/core/groupby/__init__.py @@ -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) @@ -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) @@ -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) diff --git a/third_party/bigframes_vendored/pandas/core/indexes/base.py b/third_party/bigframes_vendored/pandas/core/indexes/base.py index 7f5761e45b..eb6b9161fc 100644 --- a/third_party/bigframes_vendored/pandas/core/indexes/base.py +++ b/third_party/bigframes_vendored/pandas/core/indexes/base.py @@ -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) @@ -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. @@ -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. @@ -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. @@ -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) diff --git a/third_party/bigframes_vendored/pandas/core/series.py b/third_party/bigframes_vendored/pandas/core/series.py index 785755a562..5426e434b3 100644 --- a/third_party/bigframes_vendored/pandas/core/series.py +++ b/third_party/bigframes_vendored/pandas/core/series.py @@ -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. diff --git a/third_party/bigframes_vendored/sklearn/base.py b/third_party/bigframes_vendored/sklearn/base.py index 768328e552..fd8db7a227 100644 --- a/third_party/bigframes_vendored/sklearn/base.py +++ b/third_party/bigframes_vendored/sklearn/base.py @@ -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:: diff --git a/third_party/bigframes_vendored/sklearn/decomposition/_pca.py b/third_party/bigframes_vendored/sklearn/decomposition/_pca.py index f126e0439d..71e53bf4a9 100644 --- a/third_party/bigframes_vendored/sklearn/decomposition/_pca.py +++ b/third_party/bigframes_vendored/sklearn/decomposition/_pca.py @@ -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"): @@ -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 @@ -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.