How to use a train.csv , test.csv and ground_truth.csv in a machine learning model? (cross validation/ python)
<p>Up to now I had only one dataset (df.csv). So far I used a validation size of 20% and <code>.train_test_split</code> for a normal regression model. </p>

<pre><code>array = df.values
X = array[:,0:26]
Y = array[:,26]
validation_size = 0.20
seed = 7
X_train, X_validation, Y_train, Y_validation =
   cross_validation.train_test_split(X, Y,
   test_size=validation_size, random_state=seed)
num_folds = 10
num_instances = len(X_train)
seed = 7
scoring = 'mean_squared_error'
</code></pre>

<p>When I have three seperate datasets (train.csv/test.csv/ground_truth.csv), how can I handle it? Of course, at first I use the train.csv, then the test.csv and finally the ground_truth. But how should I implement these different datasets in my model?</p>

<p>When you perform cross-validation, train and test data are essentially the same dataset which is split in different ways in order to prevent overfitting. The number of folds indicates the different ways the set is split. </p>

<p>For example, 5-fold cross validation splits the training set in 5 pieces and each time 4 of them are used for training and 1 for testing. So in your case, you have the following options: </p>

<p>Either perform cross-validation just on the training set, then check with the test set and the ground truth (fitting is done just on the training set so if done correctly accuracy on test and ground truth ought to be similar) or combine training and test for a larger and possibly more representative dataset and then check on ground truth.</p>

python numpy machine-learning scipy cross-validation