public class LogisticRegressionDataGenerator
extends Object
probOne
and scales features for positive examples by eps
.Constructor and Description |
---|
LogisticRegressionDataGenerator() |
Modifier and Type | Method and Description |
---|---|
static RDD<LabeledPoint> |
generateLogisticRDD(SparkContext sc,
int nexamples,
int nfeatures,
double eps,
int nparts,
double probOne)
Generate an RDD containing test data for LogisticRegression.
|
static void |
main(String[] args) |
public static RDD<LabeledPoint> generateLogisticRDD(SparkContext sc, int nexamples, int nfeatures, double eps, int nparts, double probOne)
sc
- SparkContext to use for creating the RDD.nexamples
- Number of examples that will be contained in the RDD.nfeatures
- Number of features to generate for each example.eps
- Epsilon factor by which positive examples are scaled.nparts
- Number of partitions of the generated RDD. Default value is 2.probOne
- Probability that a label is 1 (and not 0). Default value is 0.5.public static void main(String[] args)