File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
bayesflow/adapters/transforms Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 77
88@serializable (package = "bayesflow.adapters" )
99class Rename (Transform ):
10+ """
11+ Transform to rename keys in data dictionary. Useful to rename variables to match those required by
12+ approximator. This transform can only rename one variable at a time.
13+
14+ Parameters:
15+ - from_key: str of variable name that should be renamed
16+ - to_key: str representing new name
17+
18+ Example:
19+ adapter = (
20+ bf.adapters.Adapter()
21+
22+ # rename the variables to match the required approximator inputs
23+ .rename("theta", "inference_variables")
24+ .rename("x", "inference_conditions")
25+ )
26+ """
1027 def __init__ (self , from_key : str , to_key : str ):
1128 super ().__init__ ()
1229 self .from_key = from_key
You can’t perform that action at this time.
0 commit comments