Skip to content

Question: How to remove and rename entries in one yaml based on another yaml? #2490

@ashirwad

Description

@ashirwad

I have two yaml files--predictor_spec.yaml and actions.yaml. The predictor_spec yaml specifies the predictors and interactions used in a model. Here's a sample predictor_spec yaml:

predictors:
  age: 
    label: "Age (years)"
  height:
    label: "Height (inches)"
  weight:
    label: "Weight (pounds)"
interactions:
  age_X_height: [age, height]
  height_X_weight: [height, weight]

The actions yaml specifies the changes that we want to apply in the predictor_spec yaml:

remove: [age]
rename:
  # new_name: old_name
  height_in: height

I want to remove both age and age_X_height and rename height to height_in. So, the output yaml will look like the following:

predictors:
  height_in:
    label: "Height (inches)"
interactions:
  height_in_X_weight: [height_in, weight]

How can I do that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions