Ejemplo n.º 1
0
def _train_svr(mat_files, out_file, C=1000, gamma=0.001, epsilon=0.01):
    """
    Trains SVR with the given parameters
    """
    peptides, signals = _get_peptides_signals(mat_files)
    model = SvrBlockade()
    model.train(peptides, signals, C, gamma, epsilon)
    store_model(model, out_file)
Ejemplo n.º 2
0
def _train_svr(mat_files, out_file, C=1000, gamma=0.001, epsilon=0.01):
    """
    Trains SVR with the given parameters
    """
    peptides, signals = _get_peptides_signals(mat_files)
    model = SvrBlockade()
    model.train(peptides, signals, C, gamma, epsilon)
    store_model(model, out_file)
Ejemplo n.º 3
0
def load_model(filename):
    if filename == "-":
        return MvBlockade()

    dump = pickle.load(open(filename, "rb"))

    if dump.name == SvrBlockade().name:
        model = SvrBlockade()
    elif dump.name == RandomForestBlockade().name:
        model = RandomForestBlockade()

    model.load_from_dump(dump)
    return model
Ejemplo n.º 4
0
def load_model(filename):
    if filename == "-":
        return MvBlockade()

    dump = pickle.load(open(filename, "rb"))

    if dump.name == SvrBlockade().name:
        model = SvrBlockade()
    elif dump.name == RandomForestBlockade().name:
        model = RandomForestBlockade()

    model.load_from_dump(dump)
    return model