## Files

*   **train.csv** - the training set
*   **test.csv**  - the test set
*   **sample_submission.csv** - a sample submission file in the correct format, with the header and the first rows

The train dataset, has 2 array X and Y, the samples and labels. It is in HDF5 format stored in a ‘.mat’ Matlab file

train.mat

The test dataset is in pickle format. It stores just the X array with the samples:

test.pickle


A function to load a *.mat file and shuffle the samples:

```
import numpy as np

database = 'spamDatabases/DB2/mini1000dataset/emails-text.csv'
predictions = 'predictions.csv'

# Read and predict
cnt = 0
Yp = []
outFile = open(predictions, 'w')
outFile.write('id,label\n')

with open(database, 'r') as inFile:
    for line in inFile:
        word_indices = processEmail(line)
        x = emailFeatures(word_indices)
        p = predict(model, x)
        Yp.append(p)
        print(f'{cnt},{p}')
        outFile.write(f'{cnt},{p}\n')
        cnt += 1

outFile.close()    
```
