Initial commit of the random forest classifier.
This commit is contained in:
parent
cb2d937a34
commit
43c20264b0
|
|
@ -124,7 +124,8 @@ public class Tranche {
|
||||||
final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
|
final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
|
||||||
final PrintStream stream = new PrintStream(bytes);
|
final PrintStream stream = new PrintStream(bytes);
|
||||||
|
|
||||||
Collections.sort( tranches, new TrancheTruthSensitivityComparator() );
|
if( tranches.size() > 1 )
|
||||||
|
Collections.sort( tranches, new TrancheTruthSensitivityComparator() );
|
||||||
|
|
||||||
stream.println("# Variant quality score tranches file");
|
stream.println("# Variant quality score tranches file");
|
||||||
stream.println("# Version number " + CURRENT_VERSION);
|
stream.println("# Version number " + CURRENT_VERSION);
|
||||||
|
|
|
||||||
|
|
@ -1531,6 +1531,15 @@ public class MathUtils {
|
||||||
return sliceListByIndices(sampleIndicesWithoutReplacement(list.size(),N),list);
|
return sliceListByIndices(sampleIndicesWithoutReplacement(list.size(),N),list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw N random elements from list with replacement
|
||||||
|
* @param list - the list from which to draw randomly
|
||||||
|
* @param N - the number of elements to draw
|
||||||
|
*/
|
||||||
|
public static <T> List<T> randomSample(final List<T> list, final int N) {
|
||||||
|
return sliceListByIndices(sampleIndicesWithReplacement(list.size(),N),list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the likelihood of observing the counts of categories having sampled a population
|
* Return the likelihood of observing the counts of categories having sampled a population
|
||||||
* whose categorial frequencies are distributed according to a Dirichlet distribution
|
* whose categorial frequencies are distributed according to a Dirichlet distribution
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue