linkedin / photon-ml

A scalable machine learning library on Apache Spark
Other
790 stars 185 forks source link

Minor Feature Normalization Refactor #469

Closed yunboouyang closed 4 years ago

yunboouyang commented 4 years ago

Had a minor refactor of feature normalization related code. Changes are:

  1. Fixed a bug in calculating variance when feature normalization is enabled. Previous variance calculation function createModel was wrong because means and variance cannot share the same transformation. The correct way of calculating variance when feature normalization is enabled is: first transform the means back to the original space, and then call computeVariances function.

  2. Added normalizationContext in PriorDistribution.scala to enable mean and variance normalization in incremental learning.