Skip to content
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

feat: add support for creating a Matrix Factorization model #1330

Open
wants to merge 152 commits into
base: main
Choose a base branch
from
Open
Changes from 4 commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
6783a0a
docs: update title of pypi notebook example to reflect use of the PyP…
tswast Sep 4, 2024
1d39560
feat: add support for creating a Matrix Factorization model
rey-esp Jan 27, 2025
e19c262
feat: add support for creating a Matrix Factorization model
rey-esp Jan 27, 2025
1bef4a2
feat: add support for creating a Matrix Factorization model
rey-esp Jan 27, 2025
d157cd7
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Jan 28, 2025
e336bde
Update bigframes/ml/decomposition.py
rey-esp Jan 28, 2025
d5f713a
Update bigframes/ml/decomposition.py
rey-esp Jan 28, 2025
5e3e443
Update bigframes/ml/decomposition.py
rey-esp Jan 28, 2025
34a60bc
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Jan 28, 2025
c116e8a
rating_col
rey-esp Jan 28, 2025
dedef39
(nearly) complete class
rey-esp Jan 28, 2025
e5165a9
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Jan 28, 2025
05eb854
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Jan 28, 2025
2787178
removem print()
rey-esp Jan 28, 2025
8c66e07
removem print()
rey-esp Jan 28, 2025
086b4dd
adding recommend
rey-esp Jan 29, 2025
8ed3ccd
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Jan 29, 2025
1b4eef9
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Jan 29, 2025
7c371ac
remove hyper parameter runing references
rey-esp Jan 30, 2025
7498c8c
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Jan 30, 2025
55ef06a
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Jan 30, 2025
29805b5
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 4, 2025
8de384a
swap predict in _mf for recommend
rey-esp Feb 4, 2025
647532b
recommend -> predict
rey-esp Feb 4, 2025
b340c4f
update predict doc string
rey-esp Feb 4, 2025
580de41
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 4, 2025
29ee357
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 5, 2025
bac2ece
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 6, 2025
3f22c23
Merge branch 'b338873783-matrix-factorization' of github.com:googleap…
rey-esp Feb 6, 2025
213f11d
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 6, 2025
aaf0d1f
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 10, 2025
4c90c1d
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 10, 2025
792bd64
Merge branch 'b338873783-matrix-factorization' of github.com:googleap…
rey-esp Feb 10, 2025
ed279be
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 11, 2025
ba5beb3
preparing test files
rey-esp Feb 12, 2025
86fb956
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 12, 2025
a29bbcf
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 13, 2025
8577833
add test data
rey-esp Feb 13, 2025
a92007c
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 19, 2025
a808429
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 20, 2025
4b7b4db
new error: to_gbq column names need to be changed?
rey-esp Feb 21, 2025
8d55eac
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 24, 2025
9195658
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 24, 2025
faa4d6b
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 24, 2025
76a9934
Merge branch 'b338873783-matrix-factorization' of github.com:googleap…
rey-esp Feb 24, 2025
bef7808
Delete demo.ipynb
rey-esp Feb 24, 2025
f18104d
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 25, 2025
9b39a99
Merge branch 'b338873783-matrix-factorization' of github.com:googleap…
rey-esp Feb 25, 2025
0dd033d
passing system test
rey-esp Feb 25, 2025
60faed1
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 26, 2025
1f85b75
preparing to add unit tests
rey-esp Feb 26, 2025
7efc63d
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 27, 2025
a457639
2 out of 3 (so far) passing unit tests
rey-esp Feb 27, 2025
89790ac
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Feb 28, 2025
a057a8f
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 3, 2025
512332e
attempted mocking
rey-esp Mar 3, 2025
741e749
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 4, 2025
f902131
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 4, 2025
310257d
Merge branch 'b338873783-matrix-factorization' of github.com:googleap…
rey-esp Mar 4, 2025
408e807
fix tests
rey-esp Mar 4, 2025
19e423b
new test file for model creation unit tests
rey-esp Mar 4, 2025
2c107df
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 5, 2025
c7c8eea
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 5, 2025
5f1a19a
add unit tests for num_factors, user_col, and item_col
rey-esp Mar 6, 2025
68e308b
Merge branch 'b338873783-matrix-factorization' of github.com:googleap…
rey-esp Mar 6, 2025
33f3069
Update tests/unit/ml/test_matrix_factorization.py
rey-esp Mar 7, 2025
1ff6aaa
Update tests/unit/ml/test_matrix_factorization.py
rey-esp Mar 7, 2025
446712b
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 7, 2025
c84dd7e
uncomment one test
rey-esp Mar 7, 2025
3473037
uncomment test
rey-esp Mar 7, 2025
b3809e5
uncomment test
rey-esp Mar 7, 2025
7e8a5b6
uncomment test
rey-esp Mar 7, 2025
eba88d9
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 10, 2025
8599d88
nearly all tests
rey-esp Mar 10, 2025
8ab8818
tests complete and passing
rey-esp Mar 10, 2025
b4d3578
seeing if test causes kokoro failure
rey-esp Mar 10, 2025
a63cb90
uncomment test-kokoro still failing
rey-esp Mar 10, 2025
3695f80
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 10, 2025
336bffd
Merge branch 'tswast-patch-1' into b338873783-matrix-factorization
rey-esp Mar 10, 2025
bb6130a
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 11, 2025
e69438d
remove comment
rey-esp Mar 11, 2025
05da834
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 11, 2025
087953f
fix test
rey-esp Mar 11, 2025
bfe9140
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 11, 2025
8d3599e
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 11, 2025
248a3b1
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 12, 2025
157daea
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 12, 2025
8912663
test kokoro
rey-esp Mar 12, 2025
35a8c18
test_decomposition.py failing and now feedback_type attr does not exist
rey-esp Mar 12, 2025
ac182be
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 12, 2025
ff58ff5
passing tests
rey-esp Mar 12, 2025
f0a6ba2
Update bigframes/ml/decomposition.py
rey-esp Mar 12, 2025
aaad5f5
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 12, 2025
b586c5c
Update tests/system/large/ml/test_decomposition.py
rey-esp Mar 12, 2025
04ddd5e
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 12, 2025
8e875ae
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 12, 2025
565138a
doc attempt - _mf.py example
rey-esp Mar 12, 2025
b39661f
Merge branch 'b338873783-matrix-factorization' of github.com:googleap…
rey-esp Mar 12, 2025
c0ef08f
feedback_type case ignore
rey-esp Mar 13, 2025
4b53b04
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 17, 2025
342cbd1
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 18, 2025
8812f33
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 18, 2025
24b8e0c
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 18, 2025
664de04
Update _mf.py - remove global_explain()
rey-esp Mar 18, 2025
63e8e9c
fit
rey-esp Mar 18, 2025
3e52cd4
pull?
rey-esp Mar 18, 2025
c2e9a5f
W
rey-esp Mar 18, 2025
28c4602
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 19, 2025
1240eeb
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 24, 2025
46f1ea6
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 24, 2025
193b9c8
fix docs (maybe)
rey-esp Mar 24, 2025
5a547f8
Update test_matrix_factorization.py with updated error messages
rey-esp Mar 24, 2025
23d8fc8
ilnt
rey-esp Mar 24, 2025
ed99ad7
Update test_matrix_factorization.py - add 'f'
rey-esp Mar 24, 2025
e305950
improve errors and update tests
rey-esp Mar 24, 2025
411fe1a
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 25, 2025
4273a99
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 25, 2025
b9f6a52
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 25, 2025
b92ed1f
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 25, 2025
aaf34eb
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 25, 2025
46601c4
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 25, 2025
0823db2
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 27, 2025
32917e5
Update tests/system/large/ml/test_decomposition.py
rey-esp Mar 27, 2025
e485d3b
Update bigframes/ml/decomposition.py - num_factors error messsage
rey-esp Mar 27, 2025
6a27083
Update bigframes/ml/decomposition.py - user_col error message
rey-esp Mar 27, 2025
6e2d902
Update bigframes/ml/decomposition.py - rating_col error message
rey-esp Mar 27, 2025
b65c637
Update bigframes/ml/decomposition.py - l2_reg error msg
rey-esp Mar 27, 2025
93ac0fa
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 27, 2025
74ebe27
fix tests to match updated error messages
rey-esp Mar 27, 2025
b2ebcf7
Merge branch 'b338873783-matrix-factorization' of github.com:googleap…
rey-esp Mar 27, 2025
3f40763
Update third_party/bigframes_vendored/sklearn/decomposition/_mf.py - …
rey-esp Mar 27, 2025
2cbc2e3
Update third_party/bigframes_vendored/sklearn/decomposition/_mf.py - …
rey-esp Mar 27, 2025
0a5aefb
Update third_party/bigframes_vendored/sklearn/decomposition/_mf.py - …
rey-esp Mar 27, 2025
d484f77
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 27, 2025
366e0ab
Update third_party/bigframes_vendored/sklearn/decomposition/_mf.py
tswast Mar 28, 2025
1eaa708
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 31, 2025
56ee623
remove errors and tests
rey-esp Mar 31, 2025
c942418
Update bigframes/ml/decomposition.py
rey-esp Mar 31, 2025
e0ef53e
Update bigframes/ml/decomposition.py
rey-esp Mar 31, 2025
5018182
Update bigframes/ml/decomposition.py
rey-esp Mar 31, 2025
c088a76
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 31, 2025
f9397f1
passing system test
rey-esp Mar 31, 2025
b439120
E AssertionError: expected call not found.
rey-esp Mar 31, 2025
ffe0f33
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 31, 2025
b2698ef
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Mar 31, 2025
69c8fba
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Apr 1, 2025
8a614c5
same # of elements in each
rey-esp Apr 1, 2025
9d71c86
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Apr 1, 2025
c2b4795
attempt
rey-esp Apr 1, 2025
cd20ffc
Merge branch 'main' into b338873783-matrix-factorization
rey-esp Apr 1, 2025
cf6e5be
doc fix
rey-esp Apr 1, 2025
da230b4
doc fix
rey-esp Apr 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 175 additions & 0 deletions bigframes/ml/decomposition.py
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@

from typing import List, Literal, Optional, Union

import bigframes_vendored.sklearn.decomposition._ml
import bigframes_vendored.sklearn.decomposition._pca
from google.cloud import bigquery

@@ -197,3 +198,177 @@ def score(

# TODO(b/291973741): X param is ignored. Update BQML supports input in ML.EVALUATE.
return self._bqml_model.evaluate()


@log_adapter.class_logger
class MF(
base.UnsupervisedTrainablePredictor,
bigframes_vendored.sklearn.decomposition._mf.MF,
):
__doc__ = bigframes_vendored.sklearn.decomposition._mf.MF.__doc__

def __init__(
self,
n_components: Optional[Union[int, float]] = None,
*,
num_factors: int,
user_col: str,
item_col: str,
l2_reg: float,
):
self.n_components = n_components
self.num_factors = num_factors
self.user_col = user_col
self.item_col = item_col
self.l2_reg = l2_reg
self._bqml_model: Optional[core.BqmlModel] = None
self._bqml_model_factory = globals.bqml_model_factory()

@classmethod
def _from_bq(
cls, session: bigframes.session.Session, bq_model: bigquery.Model
) -> MF:
assert bq_model.model_type == "MF"

kwargs = utils.retrieve_params_from_bq_model(
cls, bq_model, _BQML_PARAMS_MAPPING
)

last_fitting = bq_model.training_runs[-1]["trainingOptions"]
if "numPrincipalComponents" in last_fitting:
kwargs["n_components"] = int(last_fitting["numPrincipalComponents"])
# elif "pcaExplainedVarianceRatio" in last_fitting:
# kwargs["n_components"] = float(last_fitting["pcaExplainedVarianceRatio"])

model = cls(**kwargs)
model._bqml_model = core.BqmlModel(session, bq_model)
return model

@property
def _bqml_options(self) -> dict:
"""The model options as they will be set for BQML"""
options: dict = {
"model_type": "ML",
}

assert self.n_components is not None
if 0 < self.n_components < 1:
options["pca_explained_variance_ratio"] = float(self.n_components)
elif self.n_components >= 1:
options["num_principal_components"] = int(self.n_components)

return options

def _fit(
self,
X: utils.ArrayType,
y=None,
transforms: Optional[List[str]] = None,
) -> PCA:
(X,) = utils.batch_convert_to_dataframe(X)

# To mimic sklearn's behavior
if self.n_components is None:
self.n_components = min(X.shape)
self._bqml_model = self._bqml_model_factory.create_model(
X_train=X,
transforms=transforms,
options=self._bqml_options,
)
return self

@property
def components_(self) -> bpd.DataFrame:
if not self._bqml_model:
raise RuntimeError("A model must be fitted before calling components_.")

return self._bqml_model.principal_components()

@property
def explained_variance_(self) -> bpd.DataFrame:
if not self._bqml_model:
raise RuntimeError(
"A model must be fitted before calling explained_variance_."
)

return self._bqml_model.principal_component_info()[
["principal_component_id", "eigenvalue"]
].rename(columns={"eigenvalue": "explained_variance"})

@property
def explained_variance_ratio_(self) -> bpd.DataFrame:
if not self._bqml_model:
raise RuntimeError(
"A model must be fitted before calling explained_variance_ratio_."
)

return self._bqml_model.principal_component_info()[
["principal_component_id", "explained_variance_ratio"]
]

def predict(self, X: utils.ArrayType) -> bpd.DataFrame:
if not self._bqml_model:
raise RuntimeError("A model must be fitted before predict")

(X,) = utils.batch_convert_to_dataframe(X, session=self._bqml_model.session)

return self._bqml_model.predict(X)

def detect_anomalies(
self,
X: utils.ArrayType,
*,
contamination: float = 0.1,
) -> bpd.DataFrame:
"""Detect the anomaly data points of the input.

Args:
X (bigframes.dataframe.DataFrame or bigframes.series.Series):
Series or a DataFrame to detect anomalies.
contamination (float, default 0.1):
Identifies the proportion of anomalies in the training dataset that are used to create the model.
The value must be in the range [0, 0.5].

Returns:
bigframes.dataframe.DataFrame: detected DataFrame."""
if contamination < 0.0 or contamination > 0.5:
raise ValueError(
f"contamination must be [0.0, 0.5], but is {contamination}."
)

if not self._bqml_model:
raise RuntimeError("A model must be fitted before detect_anomalies")

(X,) = utils.batch_convert_to_dataframe(X, session=self._bqml_model.session)

return self._bqml_model.detect_anomalies(
X, options={"contamination": contamination}
)

def to_gbq(self, model_name: str, replace: bool = False) -> PCA:
"""Save the model to BigQuery.

Args:
model_name (str):
The name of the model.
replace (bool, default False):
Determine whether to replace if the model already exists. Default to False.

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

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

def score(
self,
X=None,
y=None,
) -> bpd.DataFrame:
if not self._bqml_model:
raise RuntimeError("A model must be fitted before score")

# TODO(b/291973741): X param is ignored. Update BQML supports input in ML.EVALUATE.
return self._bqml_model.evaluate()
2 changes: 2 additions & 0 deletions bigframes/ml/loader.py
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@
"LINEAR_REGRESSION": linear_model.LinearRegression,
"LOGISTIC_REGRESSION": linear_model.LogisticRegression,
"KMEANS": cluster.KMeans,
"MF": decomposition.MF,
"PCA": decomposition.PCA,
"BOOSTED_TREE_REGRESSOR": ensemble.XGBRegressor,
"BOOSTED_TREE_CLASSIFIER": ensemble.XGBClassifier,
@@ -82,6 +83,7 @@
def from_bq(
session: bigframes.session.Session, bq_model: bigquery.Model
) -> Union[
decomposition.MF,
decomposition.PCA,
cluster.KMeans,
linear_model.LinearRegression,
97 changes: 97 additions & 0 deletions third_party/bigframes_vendored/sklearn/decomposition/_mf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
""" Matrix Factorization.
"""

# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <denis-alexander.engemann@inria.fr>
# Michael Eickenberg <michael.eickenberg@inria.fr>
# Giorgio Patrini <giorgio.patrini@anu.edu.au>
#
# License: BSD 3 clause

from abc import ABCMeta

from bigframes_vendored.sklearn.base import BaseEstimator

from bigframes import constants


class MF(BaseEstimator, metaclass=ABCMeta):
"""Matrix Factorization (MF).

**Examples:**

>>> import bigframes.pandas as bpd
>>> from bigframes.ml.decomposition import MF
>>> X = bpd.DataFrame([[1, 1], [2, 1], [3, 1.2], [4, 1], [5, 0.8], [6, 1]])
>>> model = MF(n_components=2, init='random', random_state=0)
>>> W = model.fit_transform(X)
>>> H = model.components_

Args:
n_components (int, float or None, default None):
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.
num_factors (int or auto, default auto):
Specifies the number of latent factors to use.
If you aren't running hyperparameter tuning, then you can specify an INT64 value between 2 and 200. The default value is log2(n), where n is the number of training examples.
user_col (str):
The user column name.
item_col (str):
The item column name.
l2_reg (float, default 1.0):
If you aren't running hyperparameter tuning, then you can specify a FLOAT64 value. The default value is 1.0.
If you are running hyperparameter tuning, then you can use one of the following options:
The HPARAM_RANGE keyword and two FLOAT64 values that define the range to use for the hyperparameter. For example, L2_REG = HPARAM_RANGE(1.5, 5.0).
The HPARAM_CANDIDATES keyword and an array of FLOAT64 values that provide discrete values to use for the hyperparameter. For example, L2_REG = HPARAM_CANDIDATES([0, 1.0, 3.0, 5.0]).
"""

def fit(self, X, y=None):
"""Fit the model according to the given training data.

Args:
X (bigframes.dataframe.DataFrame or bigframes.series.Series or pandas.core.frame.DataFrame or pandas.core.series.Series):
Series or DataFrame of shape (n_samples, n_features). Training vector,
where `n_samples` is the number of samples and `n_features` is
the number of features.

y (default None):
Ignored.

Returns:
PCA: Fitted estimator.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

def score(self, X=None, y=None):
"""Calculate evaluation metrics of the model.

.. note::

Output matches that of the BigQuery ML.EVALUATE function.
See: https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-evaluate#matrix_factorization_models
for the outputs relevant to this model type.

Args:
X (default None):
Ignored.

y (default None):
Ignored.
Returns:
bigframes.dataframe.DataFrame: DataFrame that represents model metrics.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

def predict(self, X):
"""Predict the closest cluster for each sample in X.

Args:
X (bigframes.dataframe.DataFrame or bigframes.series.Series or pandas.core.frame.DataFrame or pandas.core.series.Series):
Series or a DataFrame to predict.

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