Jackknife / leave-one-out is just a special case of bootstrapping. In
general I don't think you'd ever do it this way with large data, as
you are creating N-1 models, which could be billions. It's suitable
when you have very small data.
So I suppose I'd say the general bootstrapping you see in this example
is what you want anyway, if you're using Spark.
That said, you could filter() out a particular element of the RDD,
train, compare, and repeat, if you really wanted to. It's just a few
more lines of code over what you see here.
You can repeat the model build / eval process for using simple grid
search, sure. Just:
for (
kernel <- ...;
cost <- ...;
gamma <- ...) yield {
// build and eval model
((kernel, cost, gamma), eval)
}
and that gives you all evaluations for all combinations of hyperparams.
It's brute-force but certainly simple and easy.
On Wed, Mar 11, 2015 at 3:18 PM, Natalia Connolly
<[email protected]> wrote:
> Hello,
>
> I am new to Spark and I am evaluating its suitability for my machine
> learning tasks. I am using Spark v. 1.2.1. I would really appreciate if
> someone could provide any insight about the following two issues.
>
> 1. I'd like to try a "leave one out" approach for training my SVM, meaning
> that all but one data points are used for training. The example SVM
> classifier code on the Spark webpage has this:
>
> JavaRDD<LabeledPoint> data = MLUtils.loadLibSVMFile(sc, path).toJavaRDD();
>
> JavaRDD<LabeledPoint> training = data.sample(false, 0.6, 11L);
> training.cache();
> JavaRDD<LabeledPoint> test = data.subtract(training);
>
> Is there a way to iterate over data and progressively remove each element
> in order to designate the rest of the dataset as training, instead of using
> a certain fraction of all the data for training (60% in the above example)?
>
> 2. Is there a way to choose and vary the parameters of the SVM? (kernel,
> cost, gamma…)
>
> Thank you!
>
> Natalia
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]