Skip to content

problem: input parameters  #4

@BlueFM

Description

@BlueFM

if i input number of out function equels 0, the code will get an error like :

UnboundLocalError Traceback (most recent call last)
Cell In[47], line 4
1 features.to_csv("features.csv", header=False)
2 from parallel_principal_feature_analysis import par_pfa # import the main pfa function
----> 4 par_pfa("features.csv",0,1)

File /opt/conda/lib/python3.10/site-packages/parallel_principal_feature_analysis/execute_PFA.py:38, in par_pfa(path, number_output_functions, number_sweeps, cluster_size, alpha, min_n_datapoints_a_bin, shuffle_feature_numbers, frac, calculate_mutual_information, basis_log_mutual_information)
36 for sweep in range(0,number_sweeps):
37 print("Sweep number: " + str(sweep+1))
---> 38 pf_ds,pf,indices_principal_feature_values=find_relevant_principal_features(data,number_output_functions,cluster_size,alpha,min_n_datapoints_a_bin,shuffle_feature_numbers,frac)
39 list_pf_ds.append(pf_ds)
40 # Output the principal features related to the output function in a list where the numbers correspod to the rows of the input csv-file

File /opt/conda/lib/python3.10/site-packages/parallel_principal_feature_analysis/find_relevant_principal_features.py:122, in find_relevant_principal_features(data, number_output_functions, cluster_size, alpha, min_n_datapoints_a_bin, shuffle_feature_numbers, frac)
120 intermediate_list_not_depending_on_system_state.append(j)
121 pv=1.1
--> 122 indices_principal_feature_values=np.concatenate((indices_principal_feature_values, np.array([j, pv]).reshape((1, 2))), axis=0)
124 #Output the result
125 intermediate_list_depending_on_system_state_empty = 1

UnboundLocalError: local variable 'pv' referenced before assignment

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