This is a project for the Kaggle competition Don't Get Kicked!.
The project uses:
- Python (tested with 2.6 and 2.7)
- numpy (tested with 1.6.1, does not work with 1.5.1)
- FANN (2.1.0)
- argparse (tested with 1.1)
-
matplotlib (tested with 1.0.1)
- only needed for:
zipcodes.py
,states.py
- only needed for:
The project currently consists of the following files:
Main files
-
load.py
Loads the training data and transforms it into training data for FANN. (Step 1) -
train.py
- Trainer. Runs FANN on generated training data and generates neural network. (Step 2)
- Tester. Runs generated neural network on generated testing data. (Step 3)
Note: Training data and testing data are basically the same (they have the same format), but it is recommended to have them in seperate files so you don't test on the same data you trained on.
Auxiliary files
-
zipcodes.py
-- Plots the IsBadBuy score for each zipcode. -
states.py
-- Plots the IsBadBuy score for each state.
-
Make training file (reads from
training.csv
outputs todata/train.dat
)python load.py
-
Make test file (reads from
training.csv
outputs todata/train.dat
)python load.py --test-data --range 2001,4000
- The training data is by default made from line 1-2000 in
training.csv
, here we choose line 2001-4000
- The training data is by default made from line 1-2000 in
-
Train the neural network (reads from
data/train.dat
and outputs the neural network tonetworks/default.net
)python train.py
-
Test the neural network (reads from
data/test.dat
using the neural network innetworks/default.net
)python train.py --test
-
Make training file (reads lines 5000-6000 from
training.csv
outputs todata/minimal_train.dat
)The training file's input neurons is specified in
config/datamapping/minimal.py
python load.py --data-mapping minimal --range=5000,6000 --train-file 'data/minimal_train.dat'
-
Make test file (reads lines 3700-4700 from
training.csv
outputs todata/minimal_train.dat
)The test file's input neurons is specified in
config/datamapping/minimal.py
python load.py --data-mapping minimal --range=3700,4700 --test-file 'data/minimal_test.dat'
-
Train the neural network (reads from
data/minimal_train.dat
and outputs the neural network tonetworks/minimal.net
)The neural network's learning rate, hidden layer etc. is read from
config/learn/minimal.py
python train.py --train-file 'data/minimal_train.dat' --neural-config minimal --network-file 'networks/minimal.net'
-
Test the neural network (reads from
data/minimal_test.dat
using the neural network innetworks/minimal.net
) Also gives line-by-line output of the test resultspython train.py --test-file 'data/minimal_test.dat' --network-file 'networks/minimal.net' --full
The main file. Loads the training data and transforms it into training data for FANN.
Move along -- nothing to see here...
Move along -- nothing to see here...