georgian-io-archive / foreshadow

An automatic machine learning system
https://foreshadow.readthedocs.io
Apache License 2.0
29 stars 2 forks source link

ParamSpec serialization with less verbose output #150

Open jzhang-gp opened 5 years ago

jzhang-gp commented 5 years ago

Description

Currently ParamSpec uses a form that follows the convention of sklearn (e.g., using __ to represent a path down to an underlying component). One example here:

{
  "param_distributions": [
    {
      "X_preparer__feature_preprocessor___parallel_process__group: 0__Scaler__transformer": "RobustScaler",
      "X_preparer__feature_preprocessor___parallel_process__group: 0__Scaler__transformer__quantile_range": [
        [25.0, 75.0],
        [55.0, 65.0]
      ]
    },
    {
      "X_preparer__feature_preprocessor___parallel_process__group: 0__Scaler__transformer": "MinMaxScaler",
      "X_preparer__feature_preprocessor___parallel_process__group: 0__Scaler__transformer__feature_range": [
        [0, 1]
      ]
    }
  ],
  "_class": "ParamSpec",
  "_method": "dict"
}

We may want to consider change __ to . form if this becomes too verbose for the user. If we decide we need to do this, we also need to deserialize the . to the __ form since sklearn only recognize the original form.