public class LinearDataGenerator
extends Object
eps to the
response variable Y.| Constructor and Description |
|---|
LinearDataGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static scala.collection.Seq<LabeledPoint> |
generateLinearInput(double intercept,
double[] weights,
int nPoints,
int seed,
double eps) |
static java.util.List<LabeledPoint> |
generateLinearInputAsList(double intercept,
double[] weights,
int nPoints,
int seed,
double eps)
Return a Java List of synthetic data randomly generated according to a multi
collinear model.
|
static RDD<LabeledPoint> |
generateLinearRDD(SparkContext sc,
int nexamples,
int nfeatures,
double eps,
int nparts,
double intercept)
Generate an RDD containing sample data for Linear Regression models - including Ridge, Lasso,
and uregularized variants.
|
static void |
main(String[] args) |
public static java.util.List<LabeledPoint> generateLinearInputAsList(double intercept, double[] weights, int nPoints, int seed, double eps)
intercept - Data interceptweights - Weights to be applied.nPoints - Number of points in sample.seed - Random seedpublic static scala.collection.Seq<LabeledPoint> generateLinearInput(double intercept, double[] weights, int nPoints, int seed, double eps)
intercept - Data interceptweights - Weights to be applied.nPoints - Number of points in sample.seed - Random seedeps - Epsilon scaling factor.public static RDD<LabeledPoint> generateLinearRDD(SparkContext sc, int nexamples, int nfeatures, double eps, int nparts, double intercept)
sc - SparkContext to be used for generating 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 examples are scaled.nparts - Number of partitions in the RDD. Default value is 2.
public static void main(String[] args)