Information Value
- src.meliora.core.calc_iv(df, feature, target, pr=0)[source]
A numerical value that quantifies the predictive power of an independent variable in capturing the binary dependent variable. Weight of evidence (WOE) is a measure of how much the evidence supports or undermines a hypothesis. WOE measures the relative risk of an attribute of binning level. The value depends on whether the value of the target variable is a nonevent or an event. The information value (IV) is a weighted sum of the WOE of the characteristic’s attributes. The weight is the difference between the conditional probability of an attribute for an event and the conditional probability of that attribute for a nonevent. An information value can be any real number. Generally speaking, the higher the information value, the more predictive an attribute is likely to be. :param df: Contains information on the the feature and target variable :type df: Pandas dataframe :param feature: independent variable :type feature: string :param feature: dependent variable :type feature: string
- Returns
iv – Information Value.
- Return type
float
References
https://www.lexjansen.com/mwsug/2013/AA/MWSUG-2013-AA14.pdf.
https://documentation.sas.com/doc/en/vdmmlcdc/8.1/casstat/viyastat_binning_details02.htm.
Examples
>>> iv = calc_iv(df, feature, target, pr=0) >>> iv -0.47140452079103173