FlowMeter
FlowMeter copied to clipboard
Bug in training script: TypeError in `clean_dataset` function
The training script Deepfence_ML_flowmeter.py
contains a bug that causes it to fail when executed. The error occurs in the clean_dataset
function, specifically with the any
method.
Traceback (most recent call last): File "/home/victor/FlowMeter/assets/Deepfence_ML_flowmeter.py", line 162, in <module> X, y = clean_dataset(pd_comb_features_cp) File "/home/victor/FlowMeter/assets/Deepfence_ML_flowmeter.py", line 154, in clean_dataset indices_to_keep = ~df_X.isin([np.nan, np.inf, -np.inf]).any(1) TypeError: any() takes 1 positional argument but 2 were given
Steps to Reproduce:
- Navigate to the FlowMeter directory.
- Run the script Deepfence_ML_flowmeter.py using Python 3.9.
Suggested Fix:
The issue is due to incorrect usage of the any
method. The any
method should be called with the axis parameter explicitly specified. The correct line should be:
indices_to_keep = ~df_X.isin([np.nan, np.inf, -np.inf]).any(axis=1)