{"record":{"id":"a08d8974c5144b7e","repo":"microsoft/qlib","slug":"please-implement-the-create-exp-method","errorCode":null,"errorMessage":"Please implement the `create_exp` method.","messagePattern":"Please implement the `create_exp` method\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"qlib/workflow/expm.py","lineNumber":136,"sourceCode":"\n    def create_exp(self, experiment_name: Optional[Text] = None):\n        \"\"\"\n        Create an experiment.\n\n        Parameters\n        ----------\n        experiment_name : str\n            the experiment name, which must be unique.\n\n        Returns\n        -------\n        An experiment object.\n\n        Raise\n        -----\n        ExpAlreadyExistError\n        \"\"\"\n        raise NotImplementedError(f\"Please implement the `create_exp` method.\")\n\n    def search_records(self, experiment_ids=None, **kwargs):\n        \"\"\"\n        Get a pandas DataFrame of records that fit the search criteria of the experiment.\n        Inputs are the search criteria user want to apply.\n\n        Returns\n        -------\n        A pandas.DataFrame of records, where each metric, parameter, and tag\n        are expanded into their own columns named metrics.*, params.*, and tags.*\n        respectively. For records that don't have a particular metric, parameter, or tag, their\n        value will be (NumPy) Nan, None, or None respectively.\n        \"\"\"\n        raise NotImplementedError(f\"Please implement the `search_records` method.\")\n\n    def get_exp(self, *, experiment_id=None, experiment_name=None, create: bool = True, start: bool = False):\n        \"\"\"\n        Retrieve an experiment. This method includes getting an active experiment, and get_or_create a specific experiment.","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/workflow/expm.py#L118-L154","documentation":"ExpManager.create_exp is abstract: it must create an experiment with a unique name and return an Experiment object (raising ExpAlreadyExistError on duplicates in concrete backends). The base stub raising NotImplementedError means no concrete manager (e.g. MLflowExpManager) performed the creation.","triggerScenarios":"exp_manager.create_exp('name') on a bare ExpManager; get_exp(create=True) routing creation through a custom manager subclass that lacks create_exp.","commonSituations":"Custom manager backends under construction; config switched away from MLflowExpManager while workflow code still assumes experiment auto-creation.","solutions":["Keep C['exp_manager']['class'] = 'MLflowExpManager' (default) so creation goes to MLflow.","Implement create_exp(self, experiment_name=None) in your subclass, raising ExpAlreadyExistError on duplicates.","Use R.get_exp(experiment_name=..., create=True) which handles creation through the concrete manager."],"exampleFix":"# before\nExpManager().create_exp('alpha158')  # NotImplementedError\n\n# after\nexp = R.get_exp(experiment_name='alpha158', create=True)  # via MLflowExpManager","handlingStrategy":"type-guard","validationCode":"from qlib.workflow.expm import ExpManager\nassert R.exp_manager.__class__.create_exp is not ExpManager.create_exp, 'creation unsupported'","typeGuard":"def manager_can_create(mgr) -> bool:\n    from qlib.workflow.expm import ExpManager\n    return mgr.__class__.create_exp is not ExpManager.create_exp","tryCatchPattern":null,"preventionTips":["Create experiments through R.get_exp(create=True) with the default manager.","Keep custom managers complete before pointing C['exp_manager'] at them."],"tags":["qlib","abstract-method","not-implemented","exp-manager"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}