Coverage for mlos_core/mlos_core/spaces/adapters/identity_adapter.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-10-07 01:52 +0000

1# 

2# Copyright (c) Microsoft Corporation. 

3# Licensed under the MIT License. 

4# 

5"""Contains the Identity (no-op) Space Adapter class.""" 

6 

7import ConfigSpace 

8import pandas as pd 

9 

10from mlos_core.spaces.adapters.adapter import BaseSpaceAdapter 

11 

12 

13class IdentityAdapter(BaseSpaceAdapter): 

14 """ 

15 Identity (no-op) SpaceAdapter class. 

16 

17 Parameters 

18 ---------- 

19 orig_parameter_space : ConfigSpace.ConfigurationSpace 

20 The original parameter space to explore. 

21 """ 

22 

23 @property 

24 def target_parameter_space(self) -> ConfigSpace.ConfigurationSpace: 

25 return self._orig_parameter_space 

26 

27 def transform(self, configuration: pd.DataFrame) -> pd.DataFrame: 

28 return configuration 

29 

30 def inverse_transform(self, configurations: pd.DataFrame) -> pd.DataFrame: 

31 return configurations