1
$\begingroup$

I am trying to select features and develop a predictive model.

Imagine I run a elastic net regression where lambda > 0. There are ten predictors, and the coefficients for five of those predictors is set to zero. The other five have coefficients that do not equal zero. This was all completed on the same dataset though the the tuning of alpha and lambda parameters was done using a search grid and k-fold cross-validation.

I am assuming that it is appropriate that the feature selection, model training and model validation were combined when I ran the elastic net and estimated the lambda/alpha values using k-fold cross-validation. However, there should be a test phase too where I go about estimating model performance.

Do I need to run this model using the coefficients on a test set? Or is there another option?

(FYI: I am using caret but this is aimed at being a conceptual question rather that is function-specific)

$\endgroup$
1
$\begingroup$

You should first split your data into training and test sets. The exact split will depend on the amount of data you have but most suggest 70:30.

You should use the training set for your model training, tuning and parameter selection. In caret this is usually via a grid search and cross validation in multiple training and validation sets.

Once you have the optimum model from your test split, you then work out the prediction performance on the test set. This minimises overfitting.

See this question- What is the difference between test set and validation set?

$\endgroup$
  • $\begingroup$ Thanks! I was getting confused between whether or not I needed to split up the feature selection and parameter selection parts using different datasets. $\endgroup$ – SimonsSchus May 11 '17 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.