Skip to content

Bug/issue324

Kostas FILIPPOPOLITIS requested to merge bug/issue324 into master

Created by: jassak

  • Bug fix (issue324): Problem: The initialization procedure in LogisticRegression sometimes assigns y values (0 and 1) to different levels of the target variable across local nodes. The code which assigns y levels in [0, 1] is y = self.data.variables.iloc[:, 1] which is not guarantied to lead to the same values, hence the bug. Solution: The user inputs the levels he wishes to assign to positive and negative outcomes. This also eliminates the need to use filters to handle multilevel variables. Only two levels are always filter from within the algorithm now (method: keep_levels).

  • Bug fix: Problem: In some cases all levels of a categorical variable are not present in every node. This led to exceptions since the corresponding design matrices schemata were not aligned across local nodes. Solution: Add method for aligning categorical variables across local nodes. Checks all categorical columns in design matrices produced by patsy and if any level is missing in some local node it adds the corresponding column (all zeros since the level was missing originally). Caveat: Adding non-existing levels to a local nodes, without affecting the record count is only possible in design matrices with dummy coding, i.e. in variables and covariables matrices. This is done simply by adding all-zero columns for the missing levels. Warning: in the full matrix which in not dummy coded the missing levels are still missing!

  • Enhancement: Add more nodes to LogisticRegression and CalibrationBelt tests.

Merge request reports