docstr: Parses the keyword arguments for the FairlearnClassifier.
  
  Parameters
  ----------
  kwargs : dict[str, Any]
      A dictionary containing the hyperparameters for the reduction method, base
      estimator and constraint. Parameters for the base estimator should be
      included with the prefix `model__`, and for the constraint with the prefix
      `constraint__`. Every other parameter will be passed down to the reductions
      method.
  
  Returns
  -------
  tuple[dict, dict, dict]
      The parameters for the base estimator, constraint, and reductions method, in
      this order.
docstr_tok: ["Parses","the","keyword","arguments","for","the","FairlearnClassifier",".","Parameters","--","--","--","--","--","kwargs",":","dict","[","str",",","Any","]","A","dictionary","containing","the","hyperparameters","for","the","reduction","method",",","base","estimator","and","constraint",".","Parameters","for","the","base","estimator","should","be","included","with","the","prefix","`","model__","`",",","and","for","the","constraint","with","the","prefix","`","constraint__","`",".","Every","other","parameter","will","be","passed","down","to","the","reductions","method",".","Returns","--","--","--","-","tuple","[","dict",",","dict",",","dict","]","The","parameters","for","the","base","estimator",",","constraint",",","and","reductions","method",",","in","this","order","."]
code: def parse_kwargs(kwargs: dict[str, Any]) -> tuple[dict, dict, dict]:
      """Parses the keyword arguments for the FairlearnClassifier.
  
      Parameters
      ----------
      kwargs : dict[str, Any]
          A dictionary containing the hyperparameters for the reduction method, base
          estimator and constraint. Parameters for the base estimator should be
          included with the prefix `model__`, and for the constraint with the prefix
          `constraint__`. Every other parameter will be passed down to the reductions
          method.
  
      Returns
      -------
      tuple[dict, dict, dict]
          The parameters for the base estimator, constraint, and reductions method, in
          this order.
      """
      MODEL_PREFIX = "model__"
      CONSTRAINT_PREFIX = "constraint__"
  
      # kwargs for base estimator (or model)
      model_kwargs = {
          k[len(MODEL_PREFIX) :]: v
          for k, v in kwargs.items()
          if k.startswith(MODEL_PREFIX)
      }
  
      # -> for the constraint
      constraint_kwargs = {
          k[len(CONSTRAINT_PREFIX) :]: v
          for k, v in kwargs.items()
          if k.startswith(CONSTRAINT_PREFIX)
      }
  
      # -> finally, everything left is a kwarg to the reductions method
      kwargs = {
          k: v
          for k, v in kwargs.items()
          if not any(
              [
                  k.startswith(MODEL_PREFIX),
                  k.startswith(CONSTRAINT_PREFIX),
              ]
          )
      }
  
      return model_kwargs, constraint_kwargs, kwargs
  
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 5 for calling the FairlearnClassifier obj's underlying member method code with example usage: obj.parse_kwargs(kwargs) and returns: model_kwargs,  constraint_kwargs,  kwargs