Beispiel #1
0
def boost_digits_show(n_trials, round_len, n_features):
    dct = cPickle.load(
            open(boost_digits_filename(n_trials, round_len, n_features)))
    trials = dct['trials']
    bandit = BoostableDigits()
    algo = hyperopt.Random(bandit)
    boosting_algo = BoostingAlgo(algo, round_len=round_len)

    best_trials = boosting_algo.best_by_round(list(trials))
    train_err_rates, test_err_rates = bandit.score_mixture_partial_svm(
            best_trials)

    train_err_rate_full, test_err_rate_full = bandit.score_mixture_full_svm(
            best_trials)

    hyperopt.plotting.main_plot_history(trials, bandit, do_show=False)

    best_times = range(round_len, len(trials) + round_len, round_len)
    matplotlib.pyplot.scatter(best_times, train_err_rates, c='g')
    matplotlib.pyplot.scatter(best_times, test_err_rates, c='r')

    matplotlib.pyplot.axhline(train_err_rate_full)
    matplotlib.pyplot.axhline(test_err_rate_full)
    matplotlib.pyplot.show()
Beispiel #2
0
 def evaluate(self, config, ctrl):
     print 'FatFeatures.evaluate', config['feat_spec']
     return BoostableDigits.evaluate(self, config, ctrl)