class_docstr: Wrap scikitlearn regressors.
  
  Parameters
  ----------
  strategy : str, default = "LightGBM"
      The choice for the regressor.
      Available strategies = {"LightGBM", "RandomForest", "ExtraTrees",
      "Tree", "Bagging", "AdaBoost" or "Linear"}
  
  **params : default = None
      Parameters of the corresponding regressor.
      Examples : n_estimators, max_depth...
class_docstr_tok: ["Wrap","scikitlearn","regressors",".","Parameters","--","--","--","--","--","strategy",":","str",",","default","=","``","LightGBM","''","The","choice","for","the","regressor",".","Available","strategies","=","{","``","LightGBM","''",",","``","RandomForest","''",",","``","ExtraTrees","''",",","``","Tree","''",",","``","Bagging","''",",","``","AdaBoost","''","or","``","Linear","''","}","*","*","params",":","default","=","None","Parameters","of","the","corresponding","regressor",".","Examples",":","n_estimators",",","max_depth","..."]
docstr: Return R^2 coefficient of determination of the prediction.
  
  Parameters
  ----------
  df : pandas dataframe of shape = (n, n_features)
      The dataset with numerical features.
  
  y : pandas series of shape = (n,)
      The numerical encoded target for classification tasks.
  
  Returns
  -------
  float
      R^2 of self.predict(df) wrt. y.
docstr_tok: ["Return","R^2","coefficient","of","determination","of","the","prediction",".","Parameters","--","--","--","--","--","df",":","pandas","dataframe","of","shape","=","(","n",",","n_features",")","The","dataset","with","numerical","features",".","y",":","pandas","series","of","shape","=","(","n",",",")","The","numerical","encoded","target","for","classification","tasks",".","Returns","--","--","--","-","float","R^2","of","self.predict","(","df",")","wrt",".","y","."]
code: def score(self, df, y, sample_weight=None):
      """Return R^2 coefficient of determination of the prediction.
  
      Parameters
      ----------
      df : pandas dataframe of shape = (n, n_features)
          The dataset with numerical features.
  
      y : pandas series of shape = (n,)
          The numerical encoded target for classification tasks.
  
      Returns
      -------
      float
          R^2 of self.predict(df) wrt. y.
  
      """
      try:
          if not callable(getattr(self.__regressor, "score")):
              raise ValueError("score attribute is not callable")
      except Exception as e:
          raise e
  
      if self.__fitOK:
          # sanity checks
          if (type(df) != pd.SparseDataFrame) and (
              type(df) != pd.DataFrame
          ):
              raise ValueError("df must be a DataFrame")
  
          if type(y) != pd.core.series.Series:
              raise ValueError("y must be a Series")
  
          return self.__regressor.score(df.values, y, sample_weight)
      else:
          raise ValueError("You must call the fit function before !")
  
file_path: MLBox/mlbox/model/regression/regressor.py
imports: import warnings
  from copy import copy
  import numpy
  import pandas
  from sklearn.ensemble import AdaBoostRegressor, BaggingRegressor, ExtraTreesRegressor, RandomForestRegressor
  from sklearn.linear_model import Ridge
  from sklearn.tree import DecisionTreeRegressor
  from lightgbm import LGBMRegressor
label_desc: Use image node_id 9 for calling the Regressor obj's underlying member method code with example usage: obj.score(df, y, sample_weight) and returns: self