original_docstring: 
      Mutual information estimator based on approximating the distibutions and numerical integration
      using Monte-Carlo method.
      :param data1: first distribution data (rows -- samples, cols -- axes)
      :param data2: second distribution data (rows -- samples, cols -- axes)
      :param debug: debug mode on/off
      :return: estimated mutual information
      
docstring: Mutual information estimator based on approximating the distibutions and numerical integration
  using Monte-Carlo method.
docstring_tokens: Mutual information estimator based on approximating the distibutions and numerical integration using Monte - Carlo method .
code: def mutual_information_naive(data1, data2, debug=False):
      """
      Mutual information estimator based on approximating the distibutions and numerical integration
      using Monte-Carlo method.
      :param data1: first distribution data (rows -- samples, cols -- axes)
      :param data2: second distribution data (rows -- samples, cols -- axes)
      :param debug: debug mode on/off
      :return: estimated mutual information
      """
      data1 = np.transpose(np.array(data1))
      data2 = np.transpose(np.array(data2))
      distr1 = mutinfo_density_estimator(data1)
      distr2 = mutinfo_density_estimator(data2)
      distr12 = mutinfo_density_estimator(np.vstack([data1, data2]))
      if debug:
          plot_distr(distr1)
          plot_distr(distr2)
          plot_distr(distr12)
      dim1 = data1.shape[0]
      dim2 = data2.shape[0]
  
      def f(x):
          return np.log(distr12(x)) - np.log(distr1(x[:dim1])) - np.log(distr2(x[dim1:]))
  
      return monte_carlo_integration(lambda size=1: np.transpose(distr12.resample(size=size)), f)[0]
code_tokens: def mutual_information_naive ( data1 , data2 , debug = False ) : data1 = np . transpose ( np . array ( data1 ) ) data2 = np . transpose ( np . array ( data2 ) ) distr1 = mutinfo_density_estimator ( data1 ) distr2 = mutinfo_density_estimator ( data2 ) distr12 = mutinfo_density_estimator ( np . vstack ( [ data1 , data2 ] ) ) if debug : plot_distr ( distr1 ) plot_distr ( distr2 ) plot_distr ( distr12 ) dim1 = data1 . shape [ 0 ] dim2 = data2 . shape [ 0 ] def f ( x ) : return np . log ( distr12 ( x ) ) - np . log ( distr1 ( x [ : dim1 ] ) ) - np . log ( distr2 ( x [ dim1 : ] ) ) return monte_carlo_integration ( lambda size = 1 : np . transpose ( distr12 . resample ( size = size ) ) , f ) [ 0 ]
short_docstring: Mutual information estimator based on approximating the distibutions and numerical integration
  using Monte-Carlo method.
short_docstring_tokens: Mutual information estimator based on approximating the distibutions and numerical integration using Monte - Carlo method .
comment: """
      Mutual information estimator based on approximating the distibutions and numerical integration
      using Monte-Carlo method.
      :param data1: first distribution data (rows -- samples, cols -- axes)
      :param data2: second distribution data (rows -- samples, cols -- axes)
      :param debug: debug mode on/off
      :return: estimated mutual information
      """