@main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_overwrite
@_verbose
def ocs_train(training_path, output_path, label_col, seed, flank_size, feature_dim, proximal, usegc, overwrite, verbose):
    'one-class svm training for outlier detection'
    if (seed is None):
        seed = int(time.time())
    LOGGER.log_args()
    LOGGER.log_versions(['sklearn', 'numpy'])
    start_time = time.time()
    os.makedirs(output_path, exist_ok=True)
    basename = get_basename(training_path)
    outpath = os.path.join(output_path, f'{basename}-classifier-ocs.pkl.gz')
    logfile_path = os.path.join(output_path, f'logs/{basename}-training-ocs.log')
    if (os.path.exists(outpath) and (not overwrite)):
        if (verbose > 1):
            click.secho(f'Skipping. {outpath} exists. use overwrite to force.', fg='green')
        return
    LOGGER.log_file_path = logfile_path
    LOGGER.input_file(training_path)
    start_time = time.time()
    (_, _, feat, n_dims, names) = data_to_numeric(training_path, label_col, flank_size, feature_dim, proximal, usegc=usegc, one_class='g')
    classifier = one_class_svm(feat, seed)
    result = dict(classifier=classifier)
    result['feature_params'] = dict(feature_dim=feature_dim, flank_size=flank_size, proximal=proximal, usegc=usegc)
    with open(outpath, 'wb') as clf_file:
        pickle.dump(result, clf_file)
    LOGGER.output_file(outpath)
    duration = (time.time() - start_time)
    LOGGER.log_message(('%.2f' % (duration / 60.0)), label='run duration (minutes)')
    LOGGER.shutdown()
one-class svm training for outlier detection
@main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_overwrite
@_verbose
def ocs_train(training_path, output_path, label_col, seed, flank_size, feature_dim, proximal, usegc, overwrite, verbose):
    
    if (seed is None):
        seed = int(time.time())
    LOGGER.log_args()
    LOGGER.log_versions(['sklearn', 'numpy'])
    start_time = time.time()
    os.makedirs(output_path, exist_ok=True)
    basename = get_basename(training_path)
    outpath = os.path.join(output_path, f'{basename}-classifier-ocs.pkl.gz')
    logfile_path = os.path.join(output_path, f'logs/{basename}-training-ocs.log')
    if (os.path.exists(outpath) and (not overwrite)):
        if (verbose > 1):
            click.secho(f'Skipping. {outpath} exists. use overwrite to force.', fg='green')
        return
    LOGGER.log_file_path = logfile_path
    LOGGER.input_file(training_path)
    start_time = time.time()
    (_, _, feat, n_dims, names) = data_to_numeric(training_path, label_col, flank_size, feature_dim, proximal, usegc=usegc, one_class='g')
    classifier = one_class_svm(feat, seed)
    result = dict(classifier=classifier)
    result['feature_params'] = dict(feature_dim=feature_dim, flank_size=flank_size, proximal=proximal, usegc=usegc)
    with open(outpath, 'wb') as clf_file:
        pickle.dump(result, clf_file)
    LOGGER.output_file(outpath)
    duration = (time.time() - start_time)
    LOGGER.log_message(('%.2f' % (duration / 60.0)), label='run duration (minutes)')
    LOGGER.shutdown()