@@ -158,65 +158,39 @@ def list_evaluation_measures() -> list[str]:
158158 return openml ._backend .evaluation_measure .list ()
159159
160160
161- @overload
162- def list_estimation_procedures (
163- output_format : Literal ["dataframe" ],
164- ) -> pd .DataFrame : ...
165-
166-
167- @overload
168- def list_estimation_procedures (
169- output_format : Literal ["object" ],
170- ) -> dict [int , OpenMLEstimationProcedure ]: ...
171-
172-
173- @overload
174161def list_estimation_procedures (
175- output_format : None = None ,
176- ) -> list [str ]: ...
177-
178-
179- def list_estimation_procedures (
180- output_format : Literal ["object" , "dataframe" ] | None = None ,
181- ) -> list [str ] | dict [int , OpenMLEstimationProcedure ] | pd .DataFrame :
162+ * ,
163+ get_procedures : bool = False ,
164+ ) -> list [str ] | list [OpenMLEstimationProcedure ]:
182165 """Return the estimation procedures available on OpenML.
183166
184167 The function performs an API call to retrieve the entire list of
185168 evaluation procedures.
186169
187170 Parameters
188171 ----------
189- output_format : {"object", "dataframe"}, optional
190- The format of the returned procedures. ``"object"`` returns a
191- dictionary mapping procedure IDs to ``OpenMLEstimationProcedure``
192- instances. ``"dataframe"`` returns one row per procedure.
193- If omitted, a list of procedure names is returned for backwards
194- compatibility and a warning is emitted.
172+ get_procedures : bool, default=False
173+ Return full procedure objects when True. By default, return the
174+ procedure names and emit a warning about the future change.
195175
196176 Returns
197177 -------
198- list[str], dict[int, OpenMLEstimationProcedure], or pandas.DataFrame
199- The available estimation procedures in the requested format .
178+ list[str] or list[ OpenMLEstimationProcedure]
179+ The available estimation procedure names or full procedure objects .
200180 """
201181 result = openml ._backend .estimation_procedure .list ()
202182
203- if output_format is None :
204- warnings .warn (
205- "The default output will change from a list of names to a dictionary of "
206- "OpenMLEstimationProcedure objects in a future release. Set "
207- "output_format='object' to use the new format." ,
208- FutureWarning ,
209- stacklevel = 2 ,
210- )
211- return [procedure .name for procedure in result ]
183+ if get_procedures :
184+ return result
212185
213- if output_format == "dataframe" :
214- return pd .DataFrame .from_records (procedure ._to_dict () for procedure in result )
215-
216- if output_format == "object" :
217- return {procedure .id : procedure for procedure in result }
218-
219- raise ValueError ("Invalid output format. Only 'object' and 'dataframe' are applicable." )
186+ warnings .warn (
187+ "The default output will change from a list of names to a list of "
188+ "OpenMLEstimationProcedure objects in a future release. Set "
189+ "get_procedures=True to use the new format." ,
190+ FutureWarning ,
191+ stacklevel = 2 ,
192+ )
193+ return [procedure .name for procedure in result ]
220194
221195
222196def list_evaluations_setups (
0 commit comments