This demo illustrates the usage of ConvNetJS' MagicNet class, which performs fully automatic prediction given your arbitrary data. Internally, the MagicNet tries out many different types of networks, performs cross-validations of network hyper-parameters across folds of your data, and creates a final classifier by model averaging the best architectures. The API for MagicNet looks as follows:
var opts = {}; // options struct opts.train_ratio = 0.7; opts.num_folds = 10; // number of folds to eval per candidate opts.num_candidates = 10; // number of candidates to eval in parallel opts.num_epochs = 50; // epochs to make through data per fold // below, train_data is a list of input Vols and train_labels is a // list of integer correct labels (in 0...K). var magicNet = new convnetjs.MagicNet(train_data, train_labels, opts); magicNet.onFinishBatch(finishedBatch); // example of setting callback for events // start training magicNet. Every step() call all candidates train on one example setInterval(function(){ magicNet.step() }, 0}); // once at least one batch of candidates is evaluated on all folds we can do prediction! function finishedBatch() { // prediction example. xout is Vol of scores // there is also predict_soft(), which returns the full score volume for all labels var predicted_label = magicNet.predict(some_test_vol); }
Currently made input data assumptions:
The text area is pre-filled with a Car Quality Evaluation dataset to show you example input, but there are a few buttons that load some example datasets (more details on these: Iris data, Car Eval data, Yeast Data). A nice place to find more datasets are UCI Repository or mldata.org.
Below: graph of the validation accuracy for current batch of candidate models as a function of the number of training points they have seen during training. Good networks will rise up as high as possible and stay there. The best performer is printed in detail below the graph. The graph is less wiggly if there is more data.
Paste a test set in box below to evaluate the final test accuracy, which is based on a model-averaged ensemble of the best discovered network from the training data above. The CSV pasted below should be in the same format as the one used for training data above. The text field is pre-filled with the training data.
var magicNet = new convnetjs.MagicNet(); magicNet.fromJSON(json); magicNet.predict(some_vol); // ready to use!