Skip to content

Train Regression Model in Shifu

Hu Zhanghao edited this page Apr 17, 2020 · 4 revisions

In most case, Shifu is designed for 0-1 regression, including data binning, data normalization and variable selection. But we can also do Linear Regression using Shifu.

There are two ways to train regression model in Shifu.

Method 1: Make temporary 0-1 Tag

  • Create a temporary 0-1 target column by using original target (you can decide how to do do that.)
  • Run shifu stats, shifu norm, shifu varsel as normal
  • After the ColumnConfig.json is generated, and final variables are selected, then change temporary target column to original target column, and remove tags in posTags and negTags
  • Add OutputActivationFunc to ModelConfig.json -> train -> params. The value of OutputActivationFunc could be Linear|ReLU|LeakyReLU|Swish. Depends on what you need.
  • Rerun shifu norm and shifu train step to build model

Method 2: Native

  • Keep posTags and negTags empty in ModelConfig.json
  • Use EqualTotal to do binning when run shifu stats
  • Use ONEHOT or ZSCALE_ONEHOT to do data normalization
  • Since IV/KS are all zeros, you can use SE to do variable selection. Or you can use shifu varsel -f <variables.names.file> to select variables manually
  • Add OutputActivationFunc to ModelConfig.json -> train -> params. The value of OutputActivationFunc could be Linear|ReLU|LeakyReLU|Swish. Depends on what you need.
  • Rerun shifu norm and shifu train step to build model
Clone this wiki locally