def get_experiment_model(experiment_id: int) -> object: database = Database() query = f"SELECT project_id FROM experiment WHERE id = {experiment_id}" project_id = database.read(query=query)[0]['project_id'] registry = Registry() return registry.get_model(path=f"{project_id}-{experiment_id}", key='model')
def get_experiment_target(experiment_id: int) -> pd.DataFrame: database = Database() query = f"SELECT project_id FROM experiment WHERE id = {experiment_id}" project_id = database.read(query=query)[0]['project_id'] registry = Registry() return registry.get_dataset(path=f"{project_id}-{experiment_id}", key='target')
def get_experiment(experiment_id: int) -> dict: query = f"SELECT * FROM experiment WHERE id = {experiment_id}" database = Database() return database.read(query=query)[0]
def get_experiments() -> dict: query = "SELECT * FROM experiment" database = Database() return database.read(query=query)
def get_projects() -> dict: query = "SELECT * FROM project" database = Database() return database.read(query=query)
def get_prediction(prediction_id: int): database = Database() query = f"SELECT * FROM serving WHERE id = {prediction_id}" return database.read(query=query)[0]
def get_deployments(): query = f"SELECT * FROM experiment WHERE status = 'deployed'" database = Database() return database.read(query=query)