def run_ecoc(ier, idr):
    encoder = getattr(shogun, encoders[ier])()
    decoder = getattr(shogun, decoders[idr])()
    if hasattr(encoder, 'set_labels'):
        encoder.set_labels(gnd_train)
        encoder.set_features(fea_train)
    strategy = ECOCStrategy(encoder, decoder)
    classifier = LinearMulticlassMachine(strategy, fea_train, base_classifier, gnd_train)
    classifier.train()
    label_pred = classifier.apply(fea_test)
    if (gnd_test is not None):
        evaluator = MulticlassAccuracy()
        acc = evaluator.evaluate(label_pred, gnd_test)
    else:
        acc = None
    return (classifier.get_num_machines(), acc)
def run_ecoc(ier, idr):
    encoder = getattr(shogun, encoders[ier])()
    decoder = getattr(shogun, decoders[idr])()
    if hasattr(encoder, 'set_labels'):
        encoder.set_labels(gnd_train)
        encoder.set_features(fea_train)
    strategy = ECOCStrategy(encoder, decoder)
    classifier = LinearMulticlassMachine(strategy, fea_train, base_classifier, gnd_train)
    classifier.train()
    label_pred = classifier.apply(fea_test)
    if (gnd_test is not None):
        evaluator = MulticlassAccuracy()
        acc = evaluator.evaluate(label_pred, gnd_test)
    else:
        acc = None
    return (classifier.get_num_machines(), acc)