edu.uci.jforests.sample
Class Sample
- java.lang.Object
-
- edu.uci.jforests.sample.Sample
-
- Direct Known Subclasses:
- RankingSample
public class Sample extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classSample.BinFreq
-
Field Summary
Fields Modifier and Type Field and Description Datasetdatasetint[]indicesInDatasetint[]indicesInParentSampleintsizedouble[]targetsdouble[]weights
-
Constructor Summary
Constructors Constructor and Description Sample(Dataset dataset)Sample(Dataset dataset, int[] indicesInDataset, double[] weights, double[] targets, int[] indicesInParentSample, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleevaluate(double[] predictions, EvaluationMetric evaluationMetric)doubleevaluate(double[] predictions, EvaluationMetric evaluationMetric, double factor)SamplegetClone()SamplegetOutOfSample(Sample subSample)Creates a sample from instances that are in this sample and not in subSampleSamplegetRandomSubSample(double rate, java.util.Random rnd)SamplegetRandomTargetBiasedSubSample(double rate, java.util.Random rnd)Returns a random subsample that is biased with respect to targets.booleanisEmpty()
-
-
-
Field Detail
-
dataset
public Dataset dataset
-
indicesInDataset
public int[] indicesInDataset
-
weights
public double[] weights
-
targets
public double[] targets
-
size
public int size
-
indicesInParentSample
public int[] indicesInParentSample
-
-
Constructor Detail
-
Sample
public Sample(Dataset dataset)
-
Sample
public Sample(Dataset dataset, int[] indicesInDataset, double[] weights, double[] targets, int[] indicesInParentSample, int size)
-
-
Method Detail
-
getClone
public Sample getClone()
-
getRandomSubSample
public Sample getRandomSubSample(double rate, java.util.Random rnd)
-
getRandomTargetBiasedSubSample
public Sample getRandomTargetBiasedSubSample(double rate, java.util.Random rnd)
Returns a random subsample that is biased with respect to targets. In other words it tries to include items with more diverse targets
-
evaluate
public double evaluate(double[] predictions, EvaluationMetric evaluationMetric) throws java.lang.Exception- Throws:
java.lang.Exception
-
evaluate
public double evaluate(double[] predictions, EvaluationMetric evaluationMetric, double factor) throws java.lang.Exception- Throws:
java.lang.Exception
-
isEmpty
public boolean isEmpty()
-
-
DMelt 3.0 © DataMelt by jWork.ORG