def parse_command_line(argv):
    """ argv should be sys.argv """
    param_type = {'nh_size': int, 'nn_pure_ratio': float, 'outlier_ratio':
        float, 'min_size_cluster': int, 'perplexity': int,
        'n_iteration_tsne': int, 'late_exag': int, 'alpha_late': float,
        'n_cluster_init': int, 'eta': float, 'fdc_test_ratio_size': float,
        'root': str, 'n_clf_sample_max': int, 'clf_type': str,
        'n_bootstrap': int, 'clf_test_size_ratio': float, 'n_edge_kNN': int,
        'gap_min': float}
    parameters = {}
    for arg in argv[1:]:
        param, value = arg.strip(' ').strip('\n').split('=')
        tmp_type = param_type[param]
        if tmp_type is int:
            parameters[param] = int(float(value))
        else:
            parameters[param] = tmp_type(value)
    return parameters
