oxcsml / kerpy

python code for kernel methods
Other
36 stars 10 forks source link

kerpy for python 3.6 #2

Open LaurentLefebvre opened 6 years ago

LaurentLefebvre commented 6 years ago

Good morning,

First it was a pleasure to find these package to compute HSIC index. Congratulations, it is an impressive work.

I use python 3.6 on ubuntu16.04 and i had some troubles to install/use kerpy. I solved all the issues. So here my guide line:

  1. Update all python files from python2.x to python3.x bu using 2to3-3.6 helper:

    • 2to3-3.6 -w independence_testing/*.py
    • 2to3-3.6 -w kerpy/*.py
    • 2to3-3.6 -w tools/*.py
    • 2to3-3.6 -w weak_conditional_independence_testing/*.py
  2. Update file "independence_testing/HSICBlockTestObject.py"by correcting this line: "num_blocks = ( self.num_samples ) / self.blocksize" by the new one "num_blocks = int(( self.num_samples ) // self.blocksize)". Indeed, without that, you have this error: "TypeError: 'float' object cannot be interpreted as an integer".

Thank you for this package. Again, it is a very good work.

Best regards.

MrHuff commented 5 years ago

Hi,

Thank you for your message. I have patched up the package with the proposed changes and made it more or less compatible with python 3.xx.

Thank you!

Best regards, Robert Hu