':param depgraphs : list of DependencyGraph as the training data
:type depgraphs : DependencyGraph
:param modelfile : file name to save the trained model
:type modelfile : str'

def train(self, depgraphs, modelfile, verbose=True):

    try:
        input_file = tempfile.NamedTemporaryFile(prefix='transition_parse.train', dir=tempfile.gettempdir(), delete=False)
        if (self._algorithm == self.ARC_STANDARD):
            self._create_training_examples_arc_std(depgraphs, input_file)
        else:
            self._create_training_examples_arc_eager(depgraphs, input_file)
        input_file.close()
        (x_train, y_train) = load_svmlight_file(input_file.name)
        model = svm.SVC(kernel='poly', degree=2, coef0=0, gamma=0.2, C=0.5, verbose=verbose, probability=True)
        model.fit(x_train, y_train)
        pickle.dump(model, open(modelfile, 'wb'))
    finally:
        remove(input_file.name)
