mlcompare.models.models.ModelFactory#
- class mlcompare.models.models.ModelFactory(params_list)[source]#
Takes in a list of dictionaries and constructs model classes based on the library keyword provided for each. The class is designed to be iterated over.
Attributes:#
params_list (list[dict[str, Any]] | str | Path): List of dictionaries containing dataset parameters or a path to a .json file with one. For a list of keys required in each dictionary, see below:
Required keys: - library (Literal[“sklearn”, “xgboost”, “pytorch”, “tensorflow”, “custom”]): The library to use. - module (str): Module containing the model class. - name (str): Name of the model class.
Optional keys: - params (dict | None): The parameters to pass to the model class constructor
Raises:#
AssertionError: If dataset_params is not a list of dictionaries or a path to a .json file containing one.
- Parameters:
params_list (ParamsInput)