Skip to content

Latest commit

 

History

History
153 lines (87 loc) · 5.78 KB

README.rst

File metadata and controls

153 lines (87 loc) · 5.78 KB

Hetero Feature Binning

Feature binning or data binning is a data pre-processing technique. It can be use to reduce the effects of minor observation errors, calculate information values and so on.

Currently, we provide quantile binning and bucket binning methods. To achieve quantile binning approach, we have used a special data structure mentioned in this [paper]. Feel free to check out the detail algorithm in the paper.

As for calculating the federated iv and woe values, the following figure can describe the principle properly.

./images/binning_principle.png

Figure 1 (Federated Feature Binning Principle)

As the figure shows, B party which has the data labels encrypt its labels with Addiction homomorphic encryption and then send to A. A static each bin's label sum and send back. Then B can calculate woe and iv base on the given information.

For multiple hosts, it is similar with one host case. Guest sends its encrypted label information to all hosts, and each of the hosts calculates and sends back the static info.

samples

Figure 2: Multi-Host Binning Principle

For optimal binning, each party use quantile binning or bucket binning find initial split points. Then Guest will send encrypted labels to Host. Host use them calculate histogram of each bin and send back to Guest. Then start optimal binning methods.

./images/optimal_binning.png

Figure 3: Multi-Host Binning Principle

There exist two kinds of methods, merge-optimal binning and split-optimal binning. When choosing metrics as iv, gini or chi-square, merge type optimal binning will be used. On the other hand, if ks is choosed, split type optimal binning will be used.

Param

.. automodule:: federatedml.param.feature_binning_param
   :members:


Features

  1. Support Quantile Binning based on quantile summary algorithm.
  2. Support Bucket Binning.
  3. Support missing value input by ignoring them.
  4. Support sparse data format generated by dataio component.
  5. Support calculating woe and iv as well as counting positive and negative cases for each bin.
  6. Support transforming data into bin indexes.
  7. Support multiple hosts binning.
  8. Support 4 types of optimal binning.
  9. Support asymmetric binning methods on Host & Guest sides.

Hetero Feature Selection

Feature selection is a process that selects a subset of features for model construction. Take good advantage of feature selection can improve model performance.

In this version, we provide several filter methods for feature selection.

Param

.. automodule:: federatedml.param.feature_selection_param
   :members:


Features

  1. unique_value: filter the columns if all values in this feature is the same
  2. iv_value_thres: Use information value to filter columns. Filter those columns whose iv is smaller than threshold.
  3. iv_percentile: Use information value to filter columns. A float ratio threshold need to be provided. Pick floor(ratio * feature_num) features with higher iv. If multiple features around the threshold are same, all those columns will be keep.
  4. coefficient_of_variation_value_thres: Use coefficient of variation to judge whether to filter or not.
  5. outlier_cols: Filter columns whose percentile value is larger than the given threshold.
  6. manually: Indicate features that need to be filtered.

Besides, we support multi-host federated feature selection for iv filters. Hosts encode feature names and send the feature ids that are involved in feature selection. Guest use iv filters' logic to judge whether a feature is left or not. Then guest sends result back to hosts. Hosts decode feature ids back to feature names and obtain selection results.

images/multi_host_selection.png

Figure 3: Multi-Host Selection Principle</div>

More feature selection methods will be provided. Please make suggestions by submitting an issue.

Federated Sampling

From Fate v0.2 supports sample method. Sample module supports two sample modes: Random sample mode and StratifiedSampler sample mode.

  • In random mode, "downsample" and "upsample" methods are provided. Users can set the sample parameter "fractions", which is the sample ratio within data.

  • In stratified mode, "downsample" and "upsample" methods are also provided. Users can set the sample parameter "fractions" too, but it should be a list of tuples in the form (label_i, ratio). Tuples in the list each specify the sample ratio of corresponding label. e.g.

    [(0, 1.5), (1, 2.5), (3, 3.5)]
    

Param

.. automodule:: federatedml.param.sample_param
   :members:


Feature Scale

Feature scale is a process that scales each feature along column. The feature scale module now supports min-max scale and standard scale.

  1. min-max scale: this estimator scales and translates each feature individually such that it is in the given range on the training set, e.g. between min and max value of each feature.
  2. standard scale: standardize features by removing the mean and scaling to unit variance

Param

.. automodule:: federatedml.param.scale_param
   :members:


OneHot Encoder

OneHot encoding is a process by which category variables are converted to binary values. The detailed info could be found in [OneHot wiki]

Param

.. automodule:: federatedml.param.onehot_encoder_param
   :members: