docstr: Generates a grid to pass to GridSearch method.
  
  Parameters
  ----------
  X : pd.DataFrame
      The input data.
  y : pd.Series
      The target values.
  s : pd.Series
      The protected attribute.
docstr_tok: ["Generates","a","grid","to","pass","to","GridSearch","method",".","Parameters","--","--","--","--","--","X",":","pd.DataFrame","The","input","data",".","y",":","pd.Series","The","target","values",".","s",":","pd.Series","The","protected","attribute","."]
code: def _generate_grid(
      self, X: pd.DataFrame, y: pd.Series, s: pd.Series
  ) -> None:
      """Generates a grid to pass to GridSearch method.
  
      Parameters
      ----------
      X : pd.DataFrame
          The input data.
      y : pd.Series
          The target values.
      s : pd.Series
          The protected attribute.
      """
      dummy_constraint = deepcopy(self.constraint)
      dummy_constraint.load_data(X, y, sensitive_features=s)
  
      # Randomly select a set of Lagrangian multipliers from the generated grid
      grid = _GridGenerator(
          grid_size=self.kwargs.pop("grid_size", 50),
          grid_limit=self.kwargs.pop("grid_limit", 3.0),
          pos_basis=self.kwargs.pop(
              "pos_basis", dummy_constraint.pos_basis
          ),
          neg_basis=self.kwargs.pop(
              "neg_basis", dummy_constraint.neg_basis
          ),
          neg_allowed=self.kwargs.pop(
              "neg_allowed", dummy_constraint.neg_basis_present
          ),
          force_L1_norm=self.kwargs.pop(
              "force_L1_norm",
              dummy_constraint.default_objective_lambda_vec is not None,
          ),
          grid_offset=None,
      ).grid
  
      self.rng = np.random.RandomState(
          self.kwargs.pop("random_state", 42)
      )
      rng_indices = self.rng.choice(grid.shape[1], 2, replace=False)
      grid = grid.iloc[:, rng_indices]
  
      self.reduction.grid = grid
  
file_path: aequitas/src/aequitas/fairflow/methods/inprocessing/fairlearn_classifier.py
imports: from copy import deepcopy
  from typing import Any, Callable, Optional, Union
  import numpy
  import pandas
  from fairlearn.reductions import ExponentiatedGradient, GridSearch
  from fairlearn.reductions._grid_search._grid_generator import _GridGenerator
  from ...utils import create_logger, import_object
  from .inprocessing import InProcessing
label_desc: Use image node_id 4 for calling the FairlearnClassifier obj's underlying member method code with example usage: obj._generate_grid(X, y, s) without return types