Open tathey1 opened 5 years ago
Did you find a solution ? I have the same error ...
I have the same error. I think that may be caused by that it has to do with how python interprets types, and how C interprets types when using Cython.
I've fixed this and should be in the next release
Since you are using Windows 10, I think you might also need to install a compiler for Cython. I can update these instructions in the ReadMe. Instructions for this can be found here: https://wiki.python.org/moin/WindowsCompilers
Describe the bug data type error when using MGC.p_value() on long type
To Reproduce from mgcpy.independence_tests.mgc import MGC a = np.array([[1.,1.],[1.,1.]]) b = np.array([[2.,2.],[2.,2.]]) mgc.p_value(a,b) Expected behavior I expected this to work.
Error output
ValueError Traceback (most recent call last) in 8 a = np.array([[1.,1.],[1.,1.]]) 9 b = np.array([[2.,2.],[2.,2.]]) ---> 10 mgc.p_value(a,b) 11 12 indices_1 = np.cumsum(n1)
~\Anaconda3\lib\site-packages\mgcpy-0.3.0-py3.7-win-amd64.egg\mgcpy\independence_tests\mgc.py in p_value(self, matrix_X, matrix_Y, replication_factor, is_fast, fast_mgc_data) 226 return p_value, p_value_metadata 227 else: --> 228 return super(MGC, self).p_value(matrix_X, matrix_Y) 229 230 def _fast_mgc_p_value(self, matrix_X, matrix_Y, sub_samples=10):
~\Anaconda3\lib\site-packages\mgcpy-0.3.0-py3.7-win-amd64.egg\mgcpy\independence_tests\abstract_class.py in p_value(self, matrix_X, matrix_Y, replication_factor) 89 90 # calculte the test statistic with the given data ---> 91 test_statistic, independence_test_metadata = self.test_statistic(matrix_X, matrix_Y) 92 93 if self.get_name() == "unbiased":
~\Anaconda3\lib\site-packages\mgcpy-0.3.0-py3.7-win-amd64.egg\mgcpy\independence_tests\mgc.py in test_statistic(self, matrix_X, matrix_Y, is_fast, fast_mgc_data) 88 distance_matrix_X, distance_matrix_Y = compute_distance(matrix_X, matrix_Y, self.compute_distance_matrix) 89 local_correlation_matrix = local_correlations(distance_matrix_X, distance_matrix_Y, ---> 90 base_global_correlation=self.base_global_correlation)["local_correlation_matrix"] 91 m, n = local_correlation_matrix.shape 92 if m == 1 or n == 1:
mgcpy\independence_tests\mgc_utils\local_correlation.pyx in mgcpy.independence_tests.mgc_utils.local_correlation.local_correlations()
mgcpy\independence_tests\mgc_utils\local_correlation.pyx in mgcpy.independence_tests.mgc_utils.local_correlation.local_correlations()
mgcpy\independence_tests\mgc_utils\local_correlation.pyx in mgcpy.independence_tests.mgc_utils.local_correlation.local_covariance()
ValueError: Buffer dtype mismatch, expected 'int_t' but got 'long long'
Desktop (please complete the following information): -Recently downloaded off pip, using Windows 10