@@ -151,7 +151,9 @@ def evaluate(
151151 model : Union [bigframes .ml .base .BaseEstimator , str ],
152152 input_ : Optional [Union [dataframe .DataFrame , str ]] = None ,
153153 * ,
154- options : Optional [Mapping [str , Union [str , int , float , bool , list ]]] = None ,
154+ perform_aggregation : Optional [bool ] = None ,
155+ horizon : Optional [int ] = None ,
156+ confidence_level : Optional [float ] = None ,
155157) -> dataframe .DataFrame :
156158 """
157159 Evaluates a BigQuery ML model.
@@ -166,8 +168,22 @@ def evaluate(
166168 input_ (Union[bigframes.pandas.DataFrame, str], optional):
167169 The DataFrame or query to use for evaluation. If not provided, the
168170 evaluation data from training is used.
169- options (Mapping[str, Union[str, int, float, bool, list]], optional):
170- The OPTIONS clause, which specifies the model options.
171+ perform_aggregation (bool, optional):
172+ A BOOL value that indicates the level of evaluation for forecasting
173+ accuracy. If you specify TRUE, then the forecasting accuracy is on
174+ the time series level. If you specify FALSE, the forecasting
175+ accuracy is on the timestamp level. The default value is TRUE.
176+ horizon (int, optional):
177+ An INT64 value that specifies the number of forecasted time points
178+ against which the evaluation metrics are computed. The default value
179+ is the horizon value specified in the CREATE MODEL statement for the
180+ time series model, or 1000 if unspecified. When evaluating multiple
181+ time series at the same time, this parameter applies to each time
182+ series.
183+ confidence_level (float, optional):
184+ A FLOAT64 value that specifies the percentage of the future values
185+ that fall in the prediction interval. The default value is 0.95. The
186+ valid input range is ``[0, 1)``.
171187
172188 Returns:
173189 bigframes.pandas.DataFrame:
@@ -179,7 +195,9 @@ def evaluate(
179195 sql = bigframes .core .sql .ml .evaluate (
180196 model_name = model_name ,
181197 table = table_sql ,
182- options = options ,
198+ perform_aggregation = perform_aggregation ,
199+ horizon = horizon ,
200+ confidence_level = confidence_level ,
183201 )
184202
185203 return session .read_gbq (sql )
@@ -190,7 +208,9 @@ def predict(
190208 model : Union [bigframes .ml .base .BaseEstimator , str ],
191209 input_ : Union [dataframe .DataFrame , str ],
192210 * ,
193- options : Optional [Mapping [str , Union [str , int , float , bool , list ]]] = None ,
211+ threshold : Optional [float ] = None ,
212+ keep_original_columns : Optional [bool ] = None ,
213+ trial_id : Optional [int ] = None ,
194214) -> dataframe .DataFrame :
195215 """
196216 Runs prediction on a BigQuery ML model.
@@ -204,8 +224,15 @@ def predict(
204224 The model to use for prediction.
205225 input_ (Union[bigframes.pandas.DataFrame, str]):
206226 The DataFrame or query to use for prediction.
207- options (Mapping[str, Union[str, int, float, bool, list]], optional):
208- The OPTIONS clause, which specifies the model options.
227+ threshold (float, optional):
228+ The threshold to use for classification models.
229+ keep_original_columns (bool, optional):
230+ Whether to keep the original columns in the output.
231+ trial_id (int, optional):
232+ An INT64 value that identifies the hyperparameter tuning trial that
233+ you want the function to evaluate. The function uses the optimal
234+ trial by default. Only specify this argument if you ran
235+ hyperparameter tuning when creating the model.
209236
210237 Returns:
211238 bigframes.pandas.DataFrame:
@@ -217,7 +244,9 @@ def predict(
217244 sql = bigframes .core .sql .ml .predict (
218245 model_name = model_name ,
219246 table = table_sql ,
220- options = options ,
247+ threshold = threshold ,
248+ keep_original_columns = keep_original_columns ,
249+ trial_id = trial_id ,
221250 )
222251
223252 return session .read_gbq (sql )
@@ -228,7 +257,10 @@ def explain_predict(
228257 model : Union [bigframes .ml .base .BaseEstimator , str ],
229258 input_ : Union [dataframe .DataFrame , str ],
230259 * ,
231- options : Optional [Mapping [str , Union [str , int , float , bool , list ]]] = None ,
260+ top_k_features : Optional [int ] = None ,
261+ threshold : Optional [float ] = None ,
262+ integrated_gradients_num_steps : Optional [int ] = None ,
263+ approx_feature_contrib : Optional [bool ] = None ,
232264) -> dataframe .DataFrame :
233265 """
234266 Runs explainable prediction on a BigQuery ML model.
@@ -242,8 +274,19 @@ def explain_predict(
242274 The model to use for prediction.
243275 input_ (Union[bigframes.pandas.DataFrame, str]):
244276 The DataFrame or query to use for prediction.
245- options (Mapping[str, Union[str, int, float, bool, list]], optional):
246- The OPTIONS clause, which specifies the model options.
277+ top_k_features (int, optional):
278+ The number of top features to return.
279+ threshold (float, optional):
280+ The threshold for binary classification models.
281+ integrated_gradients_num_steps (int, optional):
282+ an INT64 value that specifies the number of steps to sample between
283+ the example being explained and its baseline. This value is used to
284+ approximate the integral in integrated gradients attribution
285+ methods. Increasing the value improves the precision of feature
286+ attributions, but can be slower and more computationally expensive.
287+ approx_feature_contrib (bool, optional):
288+ A BOOL value that indicates whether to use an approximate feature
289+ contribution method in the XGBoost model explanation.
247290
248291 Returns:
249292 bigframes.pandas.DataFrame:
@@ -255,7 +298,10 @@ def explain_predict(
255298 sql = bigframes .core .sql .ml .explain_predict (
256299 model_name = model_name ,
257300 table = table_sql ,
258- options = options ,
301+ top_k_features = top_k_features ,
302+ threshold = threshold ,
303+ integrated_gradients_num_steps = integrated_gradients_num_steps ,
304+ approx_feature_contrib = approx_feature_contrib ,
259305 )
260306
261307 return session .read_gbq (sql )
@@ -265,7 +311,7 @@ def explain_predict(
265311def global_explain (
266312 model : Union [bigframes .ml .base .BaseEstimator , str ],
267313 * ,
268- options : Optional [Mapping [ str , Union [ str , int , float , bool , list ]] ] = None ,
314+ class_level_explain : Optional [bool ] = None ,
269315) -> dataframe .DataFrame :
270316 """
271317 Gets global explanations for a BigQuery ML model.
@@ -277,8 +323,8 @@ def global_explain(
277323 Args:
278324 model (bigframes.ml.base.BaseEstimator or str):
279325 The model to get explanations from.
280- options (Mapping[str, Union[str, int, float, bool, list]] , optional):
281- The OPTIONS clause, which specifies the model options .
326+ class_level_explain ( bool, optional):
327+ Whether to return class-level explanations .
282328
283329 Returns:
284330 bigframes.pandas.DataFrame:
@@ -287,7 +333,7 @@ def global_explain(
287333 model_name , session = _get_model_name_and_session (model )
288334 sql = bigframes .core .sql .ml .global_explain (
289335 model_name = model_name ,
290- options = options ,
336+ class_level_explain = class_level_explain ,
291337 )
292338
293339 return session .read_gbq (sql )
0 commit comments