def params_to_string(params):
    """
    Converts a params dictionary in a string suitable for file name creation.

    @param params: The clustering algorithm params (kwargs) to convert.

    @return: Stringification of this params.
    """
    s = ""
    for k in params:
        try:
            value = params[k]
            if isinstance( value, ( int, long ) ):
                s += "%s_%d_"%(k, value)
            else:
                s += "%s_%.3f_"%(k, value)
        except TypeError:
            s += "%s_%s_"%(k, params[k])
    return s[:-1]
dataset/ETHPy150Open victor-gil-sepulveda/pyProCT/validation/bidimensional/validationTools.py/params_to_string/original