prospector/ranking/rank.py
def train(
    model_name: str,
    data_filename=TRAINING_DATA,
    num_elem_training_data=NUM_ELEMENTS_TRAINING_DATA,
) -> str:
    """
    Takes in input a dataset and produces a trained model that is persisted to disk.
    Dataset file contains triples:  (vuln_id,fix_id,repository,commit_id)
    Returns the path to the saved model
    """
    # read data_filename content in list of lines
    # foreach l in line:
    #   get (commit_id,repo) from l
    #   if (commit_id,repo) not found in commitdb:
    #     commit_obj = make_commit(commit_id,repo)
    #     preprocess(commit_obj)
    #     save commit_obj to db
    #   augment commit_obj with advisory-dependent features
    #   add augmented commit_obj to dataframe
    # fit(dataframe) --> model
    # compute metrics
    # save model to disk (file: model_name)
    df = make_dataframe(data_filename, num_elem_training_data)
    if df is None:
        return ""  # Special case, when returned dataframe is None

    model = ""  # here should go the actual classifier model
    # model.fit(df)
    # compute metrics
    return save_model(model, model_name)

    Takes in input a dataset and produces a trained model that is persisted to disk.
    Dataset file contains triples:  (vuln_id,fix_id,repository,commit_id)
    Returns the path to the saved model
    
Takes in input a dataset and produces a trained model that is persisted to disk.
Dataset file contains triples:  (vuln_id,fix_id,repository,commit_id)
Returns the path to the saved model
Takes in input a dataset and produces a trained model that is persisted to disk . Dataset file contains triples : ( vuln_id fix_id repository commit_id ) Returns the path to the saved model
def train(
    model_name: str,
    data_filename=TRAINING_DATA,
    num_elem_training_data=NUM_ELEMENTS_TRAINING_DATA,
) -> str:
    df = make_dataframe(data_filename, num_elem_training_data)
    if df is None:
        return ""  
    model = ""  
    return save_model(model, model_name)
def train ( model_name : str , data_filename = TRAINING_DATA , num_elem_training_data = NUM_ELEMENTS_TRAINING_DATA , ) -> str : df = make_dataframe ( data_filename , num_elem_training_data ) if df is None : return "" model = "" return save_model ( model , model_name )
Takes in input a dataset and produces a trained model that is persisted to disk.
Takes in input a dataset and produces a trained model that is persisted to disk .
"""
    Takes in input a dataset and produces a trained model that is persisted to disk.
    Dataset file contains triples:  (vuln_id,fix_id,repository,commit_id)
    Returns the path to the saved model
    """ # read data_filename content in list of lines # foreach l in line: #   get (commit_id,repo) from l #   if (commit_id,repo) not found in commitdb: #     commit_obj = make_commit(commit_id,repo) #     preprocess(commit_obj) #     save commit_obj to db #   augment commit_obj with advisory-dependent features #   add augmented commit_obj to dataframe # fit(dataframe) --> model # compute metrics # save model to disk (file: model_name) # Special case, when returned dataframe is None # here should go the actual classifier model # model.fit(df) # compute metrics
model_name
str
data_filename
num_elem_training_data