Skip to content
Snippets Groups Projects
Commit 88864054 authored by dmt's avatar dmt
Browse files

Provide construction api endpoint.

parent 4aada053
No related branches found
No related tags found
No related merge requests found
from cml.controller import load_settings from cml.controller import load_settings
from cml.controller import get_data_source from cml.controller import get_data_source
from cml.controller import construction
# TODO (dmt): Load default settings automatically. # TODO (dmt): Load default settings automatically.
...@@ -9,6 +9,7 @@ from cml.usecases.query import ( ...@@ -9,6 +9,7 @@ from cml.usecases.query import (
CreateConstructorUsecase CreateConstructorUsecase
) )
from cml.ports.source_adapters import PandasAdapter 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 Settings
from cml.shared.settings import specific_settings_factory, read_settings from cml.shared.settings import specific_settings_factory, read_settings
from cml.shared.request import ( from cml.shared.request import (
...@@ -75,8 +76,13 @@ def get_data_source(): ...@@ -75,8 +76,13 @@ def get_data_source():
return preprocessing_usecase.execute(preprocessing_req) return preprocessing_usecase.execute(preprocessing_req)
def construction(): def construction(*args):
pass 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(): def reconstruction():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment