Can I match without replacement?
The matching process is done with replacement, so a single majority record can be matched to multiple minority records. Can I match without replacement? So a single majority record can only be matched to one minority record.
I'm also interested in such an option.
update: I've implemented a matching with replacement option in the matching method on my local machine. If using this option, it also permutes the dataframe indices so you can check for order effects (which are necessarily imposed by matching without replacement). Happy to help if you still need that!
I am interested in this feature. Any prevision of when the pull request will be reviewed?
Yeah, I am also waiting desperately for this feature. It would be very nice if this would be implemented!
Yeah, I am also waiting desperately for this feature. It would be very nice if this would be implemented!
Very welcome to use the adapted version in the meanwhile which has this feature implemented!
https://github.com/tlooden/pymatch
Yeah, I am also waiting desperately for this feature. It would be very nice if this would be implemented!
Very welcome to use the adapted version in the meanwhile which has this feature implemented!
https://github.com/tlooden/pymatch
Your version again throws the error "ValueError: Unable to coerce to Series, length must be 1: given 393". Seems to be related to issues #12 / #11
Thank you for the feedback, i will have a look at that!
EDIT: yes i see what you mean. I had downgraded pandas to 0.23.4 in my pymatch environment, then it works. Hopefully both solutions will be merged.
Thank you for the feedback, i will have a look at that!
EDIT: yes i see what you mean. I had downgraded pandas to 0.23.4 in my pymatch environment, then it works. Hopefully both solutions will be merged.
Any idea how to resolve the error ""ValueError: Unable to coerce to Series, length must be 1: given 393" without downgraded Pandas? I am unable to install Pandas 0.23.4 on my system so I'm looking for a way to modify the code to be compatible with a newer Pandas version.
The same error here. Add this after you importing pymatch: class MyMatcher(Matcher): @staticmethod def _scores_to_accuracy(m, X, y): preds = [[1.0 if i >= .5 else 0.0 for i in m.predict(X)]] return (y.to_numpy().T == preds).sum() * 1.0 / len(y)
I layered in the with_replacement flag in my fork and set the default value to False. It seems to work.
pip install git+https://github.com/chrico-bu-uab/pymatch.git#egg=pymatch