Questions tagged [mutual-information]

22 questions
8
votes
2 answers

How to calculate pairwise Mutual Information for entire pandas dataset?

I have 50 variables in my dataframe. 46 are dependant variables and 4 are independandt variables (precipitation, temperature, dew, snow). I want to calculate the mutual information of my dependant variables agaisnt my independant. So in the end i…
Denise
  • 153
  • 3
  • 15
1
vote
0 answers

ValueError: Found array with 0 sample(s) (shape=(0, 1)) while a minimum of 1 is required. While performing mutual information regression

I am trying to perform mutual information regression on the Kaggle Houses dataset. However, I get an error when I run mutual_info_regression. I am getting the error: ValueError: Found array with 0 sample(s) (shape=(0, 1)) while a minimum of 1 is…
LC1996
  • 11
  • 2
1
vote
2 answers

How to calculate mutual information in PyTorch (differentiable estimator)

I am training a model with pytorch, where I need to calculate the degree of dependence between two tensors (let's say they are the two tensors each containing values very close to zero or one, e.g. v1 = [0.999, 0.998, 0.001, 0.98] and v2 = [0.97,…
Arsalan
  • 333
  • 4
  • 14
1
vote
0 answers

Mutual Information calculation

I have a matrix of size 13X8 given below (q'). now the author calculated the mutual information of two adjacent row in this matrix. In order to calculate mutual information first, she calculated the probability distribution of each element in this…
0
votes
1 answer

understanding mutual information score of two lists

I am unable to understand how does the from sklearn.metrics import mutual_info_score package works? so I have a list which is representative of the arms of a maze the numbers can be between 1-8. But the numbers don't have weightage and all are…
Kshtj
  • 91
  • 3
  • 11
0
votes
0 answers

How to calculate the pairwise mutual information (MI) for N number of variables?

I want to compare the mutual information for each possible pair of variables. I want to identify the lower and higher mutual information of all possible combination. I'm not sure if doing the traditional way is correct. Maybe some kind of…
0
votes
1 answer

mutual information for continuous variables with scikit-learn

I have two continuous variables, and would like to compute mutual information between them as a measure of similarity. I've read some posts suggesting to use the mutual_info_score from scikit-learn but will this work for continuous variables? One SO…
HappyPy
  • 9,839
  • 13
  • 46
  • 68
0
votes
1 answer

batch_size isn't match with output_size.size(0)

I am trying to use SelectKBest, mutual_info_classif with CNN model on cifar10 data. In the for loop,after the model.eval() in the below code, the outputs of model gives (3136,10) tensor size but batch size is 64. This is the code I run on colab. …
0
votes
0 answers

How use mutual information when Y is 2D Array

I have x and y data in 2D array. then I want to find the correlation value between x and y using mutual information. But whenI try it, y should be 1D array. can I use 2d array for y X shape : 2050,11 X Data : [ 0. 0. 0. 11. 1. 39. 0. 52.…
stack offer
  • 143
  • 8
0
votes
0 answers

feature selection: minimum redundancy, maximum relevancy (mRMR) using mutual information and scikit-learn

I've been trying to implement a minimum redondancy, maximum relevency strategy for feature selection using mutual information. def mrmr(X_train, y_train): X_train_copy = X_train.copy() y_train_copy = y_train.copy() # relevancy of input…
0
votes
0 answers

sk-learn feature selection, remove redundant features according to a mutual information matrix

I made a method in python to compute a triangular mutual information matrix. def get_mutual_information_matrix(X_train): p = len(X_train.columns) MI_matrix = np.zeros((p,p)) for i in range(p): for j in range(p): …
0
votes
0 answers

how to use numpy mutual information correctly

i want to use principal component analysis-mutual information (PCA-MI) to have data representation from source which has source relevance of (value from smartinsole) and ouput variable (value from force plate). PCA was used to determine the…
stack offer
  • 143
  • 8
0
votes
0 answers

Mutual Information: np.nan is an invalid document, expected byte or unicode string

am using mutua information and count vect and i got this erorr: np.nan is an invalid document, expected byte or unicode string. from sklearn.feature_selection import mutual_info_classif from sklearn.feature_extraction.text import…
0
votes
1 answer

Calculating the mutual information between two random vectors returns the same value

I want to calculate the mutual information between two numpy vectors: >>>from sklearn.metrics.cluster import mutual_info_score >>>import numpy as np >>>a, b = np.random.rand(10), np.random.rand(10) >>>mutual_info_score(a,…
Shayan
  • 5,165
  • 4
  • 16
  • 45
0
votes
0 answers

How to do Feature Selection if X is nomical and y is nomical as well?

According to machine learning mastery. We should use sklearn.feature_selection.chi2 or sklearn.feature_selection.mutual_info_classif for X nominal and y nominal. However, both chi2 and mutual_info_classif do not accept X nominal. It wants a X…
1
2