class_docstr: A predictor for scikit-learn compatible estimators.
  
  Args:
      estimator: The fitted scikit-learn compatible estimator to use for
          predictions.
      preprocessor: A preprocessor used to transform data batches prior
          to prediction.
class_docstr_tok: ["A","predictor","for","scikit-learn","compatible","estimators",".","Args",":","estimator",":","The","fitted","scikit-learn","compatible","estimator","to","use","for","predictions",".","preprocessor",":","A","preprocessor","used","to","transform","data","batches","prior","to","prediction","."]
code: def _predict_pandas(
      self,
      data: "pd.DataFrame",
      feature_columns: Optional[Union[List[str], List[int]]] = None,
      num_estimator_cpus: Optional[int] = 1,
      **predict_kwargs,
  ) -> "pd.DataFrame":
      register_ray()
  
      if num_estimator_cpus:
          _set_cpu_params(self.estimator, num_estimator_cpus)
  
      if TENSOR_COLUMN_NAME in data:
          data = data[TENSOR_COLUMN_NAME].to_numpy()
          data = _unwrap_ndarray_object_type_if_needed(data)
          if feature_columns:
              data = data[:, feature_columns]
      elif feature_columns:
          data = data[feature_columns]
  
      with parallel_backend("ray", n_jobs=num_estimator_cpus):
          df = pd.DataFrame(
              self.estimator.predict(data, **predict_kwargs)
          )
      df.columns = (
          ["predictions"]
          if len(df.columns) == 1
          else [f"predictions_{i}" for i in range(len(df.columns))]
      )
      return df
  
file_path: ray/python/ray/train/sklearn/sklearn_predictor.py
imports: from typing import TYPE_CHECKING, List, Optional, Union
  import pandas
  from joblib import parallel_backend
  from sklearn.base import BaseEstimator
  from ray.air.constants import TENSOR_COLUMN_NAME
  from ray.air.data_batch_type import DataBatchType
  from ray.air.util.data_batch_conversion import _unwrap_ndarray_object_type_if_needed
  from ray.train.predictor import Predictor
  from ray.train.sklearn import SklearnCheckpoint
  from ray.train.sklearn._sklearn_utils import _set_cpu_params
  from ray.util.annotations import PublicAPI
  from ray.util.joblib import register_ray
label_desc: Use image node_id 5 for calling the SklearnPredictor obj's underlying member method code with example usage: obj._predict_pandas(data, feature_columns, num_estimator_cpus) and returns: df