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

12 statements  

« prev     ^ index     » next       coverage.py v7.5.1, created at 2024-05-06 00:35 +0000

1# 

2# Copyright (c) Microsoft Corporation. 

3# Licensed under the MIT License. 

4# 

5""" 

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

7""" 

8 

9import ConfigSpace 

10import pandas as pd 

11 

12from mlos_core.spaces.adapters.adapter import BaseSpaceAdapter 

13 

14 

15class IdentityAdapter(BaseSpaceAdapter): 

16 """Identity (no-op) SpaceAdapter class. 

17 

18 Parameters 

19 ---------- 

20 orig_parameter_space : ConfigSpace.ConfigurationSpace 

21 The original parameter space to explore. 

22 """ 

23 

24 @property 

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

26 return self._orig_parameter_space 

27 

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

29 return configuration 

30 

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

32 return configurations