If a subset of samples are selected randomly, the navigate of positive classes might be too sparse or even empty. This function will repeat sampling until the classes are appropriate in this sense.

1 | ```
random.subset(F_, L_, gamma, persistence = 1000, minimum.class.size=2, replace)
``` |

`F_` |
The feature matrix, each column is a feature. |

`L_` |
The vector of labels named according to the rows of F. |

`gamma` |
A value in range 0-1 that determines the relative size of sample subsets. |

`persistence` |
Maximum number of tries for randomly choosing.samples, If we try this many times and the obtained labels are all the same, we give up (maybe the whole labels are the same) with the error message: " Not enough variation in the labels...". |

`minimum.class.size` |
A lower bound on the number of samples in each class. |

`replace` |
If TRUE, sampling is done by replacement. |

The function also returns a refined feature matrix by ignoring too sparse features after sampling.

Returns a list of:

`X_` |
The sampled feature matrix, each column is a feature after ignoring the redundant ones. |

`Y_` |
The vector of labels named according to the rows of X_. |

`remainder.samples` |
The names of the rows of F_ which do not appear in X_, later on can be used for validation. |

Habil Zare

"Statistical Analysis of Overfitting Features", manuscript in preparation.

`FeaLect`

, `train.doctor`

, `doctor.validate`

,
`random.subset`

, `compute.balanced`

,`compute.logistic.score`

,
`ignore.redundant`

, `input.check.FeaLect`

1 2 3 4 5 6 7 8 9 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.