@@ -171,7 +171,7 @@ def _iterate_columns(X, columns=None):
171
171
X : ndarray or csc_matrix, shape (n_samples, n_features)
172
172
Matrix over which to iterate.
173
173
174
- columns : iterable or None, default None
174
+ columns : iterable or None, default= None
175
175
Indices of columns to iterate over. If None, iterate over all columns.
176
176
177
177
Yields
@@ -202,29 +202,29 @@ def _estimate_mi(X, y, discrete_features='auto', discrete_target=False,
202
202
X : array-like or sparse matrix, shape (n_samples, n_features)
203
203
Feature matrix.
204
204
205
- y : array-like, shape (n_samples,)
205
+ y : array-like of shape (n_samples,)
206
206
Target vector.
207
207
208
- discrete_features : {'auto', bool, array-like}, default 'auto'
208
+ discrete_features : {'auto', bool, array-like}, default= 'auto'
209
209
If bool, then determines whether to consider all features discrete
210
210
or continuous. If array, then it should be either a boolean mask
211
211
with shape (n_features,) or array with indices of discrete features.
212
212
If 'auto', it is assigned to False for dense `X` and to True for
213
213
sparse `X`.
214
214
215
- discrete_target : bool, default False
215
+ discrete_target : bool, default= False
216
216
Whether to consider `y` as a discrete variable.
217
217
218
- n_neighbors : int, default 3
218
+ n_neighbors : int, default= 3
219
219
Number of neighbors to use for MI estimation for continuous variables,
220
220
see [1]_ and [2]_. Higher values reduce variance of the estimation, but
221
221
could introduce a bias.
222
222
223
- copy : bool, default True
223
+ copy : bool, default= True
224
224
Whether to make a copy of the given data. If set to False, the initial
225
225
data will be overwritten.
226
226
227
- random_state : int, RandomState instance or None, optional, default None
227
+ random_state : int, RandomState instance or None, default= None
228
228
Determines random number generation for adding small noise to
229
229
continuous variables in order to remove repeated values.
230
230
Pass an int for reproducible results across multiple function calls.
@@ -313,26 +313,26 @@ def mutual_info_regression(X, y, *, discrete_features='auto', n_neighbors=3,
313
313
X : array-like or sparse matrix, shape (n_samples, n_features)
314
314
Feature matrix.
315
315
316
- y : array-like, shape (n_samples,)
316
+ y : array-like of shape (n_samples,)
317
317
Target vector.
318
318
319
- discrete_features : {'auto', bool, array-like}, default 'auto'
319
+ discrete_features : {'auto', bool, array-like}, default= 'auto'
320
320
If bool, then determines whether to consider all features discrete
321
321
or continuous. If array, then it should be either a boolean mask
322
322
with shape (n_features,) or array with indices of discrete features.
323
323
If 'auto', it is assigned to False for dense `X` and to True for
324
324
sparse `X`.
325
325
326
- n_neighbors : int, default 3
326
+ n_neighbors : int, default= 3
327
327
Number of neighbors to use for MI estimation for continuous variables,
328
328
see [2]_ and [3]_. Higher values reduce variance of the estimation, but
329
329
could introduce a bias.
330
330
331
- copy : bool, default True
331
+ copy : bool, default= True
332
332
Whether to make a copy of the given data. If set to False, the initial
333
333
data will be overwritten.
334
334
335
- random_state : int, RandomState instance or None, optional, default None
335
+ random_state : int, RandomState instance or None, default= None
336
336
Determines random number generation for adding small noise to
337
337
continuous variables in order to remove repeated values.
338
338
Pass an int for reproducible results across multiple function calls.
@@ -350,13 +350,15 @@ def mutual_info_regression(X, y, *, discrete_features='auto', n_neighbors=3,
350
350
For example, pixel intensities of an image are discrete features
351
351
(but hardly categorical) and you will get better results if mark them
352
352
as such. Also note, that treating a continuous variable as discrete and
353
- vice versa will usually give incorrect results, so be attentive about that.
353
+ vice versa will usually give incorrect results, so be attentive about
354
+ that.
354
355
2. True mutual information can't be negative. If its estimate turns out
355
356
to be negative, it is replaced by zero.
356
357
357
358
References
358
359
----------
359
- .. [1] `Mutual Information <https://en.wikipedia.org/wiki/Mutual_information>`_
360
+ .. [1] `Mutual Information
361
+ <https://en.wikipedia.org/wiki/Mutual_information>`_
360
362
on Wikipedia.
361
363
.. [2] A. Kraskov, H. Stogbauer and P. Grassberger, "Estimating mutual
362
364
information". Phys. Rev. E 69, 2004.
@@ -391,26 +393,26 @@ def mutual_info_classif(X, y, *, discrete_features='auto', n_neighbors=3,
391
393
X : array-like or sparse matrix, shape (n_samples, n_features)
392
394
Feature matrix.
393
395
394
- y : array-like, shape (n_samples,)
396
+ y : array-like of shape (n_samples,)
395
397
Target vector.
396
398
397
- discrete_features : {'auto', bool, array-like}, default 'auto'
399
+ discrete_features : {'auto', bool, array-like}, default= 'auto'
398
400
If bool, then determines whether to consider all features discrete
399
401
or continuous. If array, then it should be either a boolean mask
400
402
with shape (n_features,) or array with indices of discrete features.
401
403
If 'auto', it is assigned to False for dense `X` and to True for
402
404
sparse `X`.
403
405
404
- n_neighbors : int, default 3
406
+ n_neighbors : int, default= 3
405
407
Number of neighbors to use for MI estimation for continuous variables,
406
408
see [2]_ and [3]_. Higher values reduce variance of the estimation, but
407
409
could introduce a bias.
408
410
409
- copy : bool, default True
411
+ copy : bool, default= True
410
412
Whether to make a copy of the given data. If set to False, the initial
411
413
data will be overwritten.
412
414
413
- random_state : int, RandomState instance or None, optional, default None
415
+ random_state : int, RandomState instance or None, default= None
414
416
Determines random number generation for adding small noise to
415
417
continuous variables in order to remove repeated values.
416
418
Pass an int for reproducible results across multiple function calls.
@@ -428,13 +430,15 @@ def mutual_info_classif(X, y, *, discrete_features='auto', n_neighbors=3,
428
430
For example, pixel intensities of an image are discrete features
429
431
(but hardly categorical) and you will get better results if mark them
430
432
as such. Also note, that treating a continuous variable as discrete and
431
- vice versa will usually give incorrect results, so be attentive about that.
433
+ vice versa will usually give incorrect results, so be attentive about
434
+ that.
432
435
2. True mutual information can't be negative. If its estimate turns out
433
436
to be negative, it is replaced by zero.
434
437
435
438
References
436
439
----------
437
- .. [1] `Mutual Information <https://en.wikipedia.org/wiki/Mutual_information>`_
440
+ .. [1] `Mutual Information
441
+ <https://en.wikipedia.org/wiki/Mutual_information>`_
438
442
on Wikipedia.
439
443
.. [2] A. Kraskov, H. Stogbauer and P. Grassberger, "Estimating mutual
440
444
information". Phys. Rev. E 69, 2004.
0 commit comments