Skip to content

problems if specifying -ts value #5

Description

@adriantich

Hello,

if the -fs is used in ashure.py clst then it returns the following error:
pid[3483496] 2024-07-30 19:16:07.750 INFO: Running kmeans with n_clusters = 4.0
Traceback (most recent call last):
File "/PATH/TO/FOLDER/ashure/src/ashure.py", line 1169, in
main()
File "/PATH/TO/FOLDER/ashure/src/ashure.py", line 1157, in main
data, flist = perform_cluster(df, df_d, max_iter=config['clst_N_iter'], csize=config['clst_csize'], N=config['clst_N'], th_s=config['clst_th_s'], th_m=config['clst_th_m'], pw_config=config['clst_pw_config'], msa_config=config['msa_config'], workspace=config['clst_folder'], track_file=config['clst_iter_out'], timestamp=True)
File "/PATH/TO/FOLDER/ashure/src/ashure.py", line 567, in perform_cluster
df_c = cluster_sweep(df_q, df_c, th_s, N, csize, pw_config, msa_config, workspace)
File "/PATH/TO/FOLDER/ashure/src/ashure.py", line 602, in cluster_sweep
x = bpy.cluster_Kmeans(df_align[['id','m1']], n_clusters=th_s, n_init=10, n_iter=100, ordered=True)
File "/PATH/TO/FOLDER/ashure/src/bilge_pype.py", line 1634, in cluster_Kmeans
clust.fit(x)
File "/home/.local/lib/python3.10/site-packages/sklearn/base.py", line 1466, in wrapper
estimator._validate_params()
File "/home/.local/lib/python3.10/site-packages/sklearn/base.py", line 666, in _validate_params
validate_parameter_constraints(
File "/home/.local/lib/python3.10/site-packages/sklearn/utils/_param_validation.py", line 95, in validate_parameter_constraints
raise InvalidParameterError(
sklearn.utils._param_validation.InvalidParameterError: The 'n_clusters' parameter of MiniBatchKMeans must be an int in the range [1, inf). Got 4.0 instead.

(I've changed the paths for security reasons)

This does not happen if the config.json is used or if the -ts is not specified and run by default.
I believe that the problem could be solved if in line 944 of src/ashure.py:
clst_parser.add_argument('-ts', dest='clst_th_s', type=float, help='how many partition to split the sequences for sweep')

the "float" type is changed by "int"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions