I am playing with mutual information in scikit-learn.
import numpy as np from sklearn.feature_selection import mutual_info_regression X = np.linspace(-10,10,101) y = X**2 print('MI:', mutual_info_regression(X.reshape(-1, 1),y))
This gives me the result
Then I change the number of points,
X = np.linspace(-10,10,1001)
For 10001 points:
For 100001 points:
Why is that? Should it really depend on the number of points or I am doing something wrong? Mutual information is a measure of the mutual dependence between the two variables. I would expect from such a measure some fluctuation when the number of points is small. But here, it looks like it monotonously increases with the number of points.