@main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_score
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_c_values
@_penalty_options
@_n_jobs
@_overwrite
@_verbose
def lr_train(training_path, output_path, label_col, seed, scoring, flank_size, feature_dim, proximal, usegc, c_values, penalty_options, n_jobs, overwrite, verbose):
    'logistic regression training, validation, dumps optimal model'
    if (not seed):
        seed = int(time.time())
    np_seed(seed)
    LOGGER.log_args()
    LOGGER.log_versions(['sklearn', 'numpy'])
    os.makedirs(output_path, exist_ok=True)
    basename = get_basename(training_path)
    outpath = os.path.join(output_path, f'{basename}-classifier-lr.pkl.gz')
    if (os.path.exists(outpath) and (not overwrite)):
        if (verbose > 1):
            click.secho(f'Skipping. {outpath} exists. use overwrite to force.', fg='green')
        return
    logfile_path = os.path.join(output_path, f'logs/{basename}-training-lr.log')
    LOGGER.log_file_path = logfile_path
    LOGGER.input_file(training_path)
    start_time = time.time()
    (_, resp, feat, n_dims, names) = data_to_numeric(training_path, label_col, flank_size, feature_dim, proximal, usegc)
    if usegc:
        scaler = get_scaler(feat)
        feat = scaler.transform(feat)
    classifier = logistic_regression(feat, resp, seed, scoring, c_values, penalty_options.split(','), n_jobs)
    betas = dict(zip(names, classifier.best_estimator_.coef_.tolist()[0]))
    result = dict(classifier=classifier.best_estimator_, betas=betas, scoring=scoring)
    result['feature_params'] = dict(feature_dim=feature_dim, flank_size=flank_size, proximal=proximal, usegc=usegc)
    if usegc:
        result['scaler'] = scaler
    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()
logistic regression training, validation, dumps optimal model
@main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_score
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_c_values
@_penalty_options
@_n_jobs
@_overwrite
@_verbose
def lr_train(training_path, output_path, label_col, seed, scoring, flank_size, feature_dim, proximal, usegc, c_values, penalty_options, n_jobs, overwrite, verbose):
    
    if (not seed):
        seed = int(time.time())
    np_seed(seed)
    LOGGER.log_args()
    LOGGER.log_versions(['sklearn', 'numpy'])
    os.makedirs(output_path, exist_ok=True)
    basename = get_basename(training_path)
    outpath = os.path.join(output_path, f'{basename}-classifier-lr.pkl.gz')
    if (os.path.exists(outpath) and (not overwrite)):
        if (verbose > 1):
            click.secho(f'Skipping. {outpath} exists. use overwrite to force.', fg='green')
        return
    logfile_path = os.path.join(output_path, f'logs/{basename}-training-lr.log')
    LOGGER.log_file_path = logfile_path
    LOGGER.input_file(training_path)
    start_time = time.time()
    (_, resp, feat, n_dims, names) = data_to_numeric(training_path, label_col, flank_size, feature_dim, proximal, usegc)
    if usegc:
        scaler = get_scaler(feat)
        feat = scaler.transform(feat)
    classifier = logistic_regression(feat, resp, seed, scoring, c_values, penalty_options.split(','), n_jobs)
    betas = dict(zip(names, classifier.best_estimator_.coef_.tolist()[0]))
    result = dict(classifier=classifier.best_estimator_, betas=betas, scoring=scoring)
    result['feature_params'] = dict(feature_dim=feature_dim, flank_size=flank_size, proximal=proximal, usegc=usegc)
    if usegc:
        result['scaler'] = scaler
    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()