benmiroglio / pymatch

MIT License
276 stars 129 forks source link

Cleaned up `Matcher` initialization to use provided formula #57

Open harveyaa opened 2 years ago

harveyaa commented 2 years ago

Addresses issue #36 In a cleaner way by solving the upstream problem - the formula provided to the Matcher initialization isn't used to build self.X & self.y causing the uf.is_continuous() check to fail since the column names don't reflect the formula. Changed the order of definitions in the initialization & made the definition of self.formula conditional on the input, if None is passed the formula is built in the default way that is currently used and then from there out self.formula is always used and is properly printed out.

harveyaa commented 2 years ago

Also addresses issue #55 - added a fix to the initialisation to keep the original index provided alongside the new record_id to allow the user to find what subjects end up in the matched sample by looking at the og_idx column of the matched data output.