diff --git a/cml/__init__.py b/cml/__init__.py index 3b336da9f4ef00623ae43d31679bb5305010f4df..23756009cc1cf319f1dee2763a8c65eb1eedfe32 100644 --- a/cml/__init__.py +++ b/cml/__init__.py @@ -1,4 +1,5 @@ from cml.controller import load_settings from cml.controller import get_data_source +from cml.controller import construction # TODO (dmt): Load default settings automatically. diff --git a/cml/controller/api.py b/cml/controller/api.py index 12b05b49da213b1e4f31741da92b1ba953ea1dc3..dba0c9ca8da13a957bda14c4fba257abd8ccb5c7 100644 --- a/cml/controller/api.py +++ b/cml/controller/api.py @@ -9,6 +9,7 @@ from cml.usecases.query import ( CreateConstructorUsecase ) from cml.ports.source_adapters import PandasAdapter +from cml.ports.scikit_adapter import ConstructionClusteringMLModel from cml.shared.settings import Settings from cml.shared.settings import specific_settings_factory, read_settings from cml.shared.request import ( @@ -75,8 +76,13 @@ def get_data_source(): return preprocessing_usecase.execute(preprocessing_req) -def construction(): - pass +def construction(*args): + ml_models = [ConstructionClusteringMLModel(raw_model) for raw_model in args] + construction_settings = specific_settings_factory("construction") + create_constructor_req = CreateConstructorRequest(construction_settings, + ml_models) + create_construction_usecase = CreateConstructorUsecase() + return create_construction_usecase.execute(create_constructor_req) def reconstruction():