evalml.objectives.get_objective

evalml.objectives.get_objective(objective, return_instance=False, **kwargs)[source]

Returns the Objective class corresponding to a given objective name.

Parameters
  • objective (str or ObjectiveBase) – Name or instance of the objective class.

  • return_instance (bool) – Whether to return an instance of the objective. This only applies if objective is of type str. Note that the instance will be initialized with default arguments.

  • kwargs (Any) – Any keyword arguments to pass into the objective. Only used when return_instance=True.

Returns

ObjectiveBase if the parameter objective is of type ObjectiveBase. If objective is instead a valid objective name, function will return the class corresponding to that name. If return_instance is True, an instance of that objective will be returned.