Closed AbufoudaMohammed closed 5 years ago
What do you mean by "measure" ? the feature calculators?
You will have to pass a list of params, as the docstring tells you. It states that argument params
needs to be a list.
print('cwt_coefficients ', f.cwt_coefficients(x, [{'widths': 10, 'coeff': 5, "w":10} )])
or
print('cwt_coefficients ', f.cwt_coefficients(x, [{'widths': 10, 'coeff': 5, "w":10} ), {'widths': 3, 'coeff': 5, "w":10} ), {'widths': 10, 'coeff': 5, "w":11} )])
for multiple features
What do you mean by "measure" ? the feature calculators?
You will have to pass a list of params, as the docstring tells you. It states that argument
params
needs to be a list.print('cwt_coefficients ', f.cwt_coefficients(x, [{'widths': 10, 'coeff': 5, "w":10} )])
or
print('cwt_coefficients ', f.cwt_coefficients(x, [{'widths': 10, 'coeff': 5, "w":10} ), {'widths': 3, 'coeff': 5, "w":10} ), {'widths': 10, 'coeff': 5, "w":11} )])
for multiple features
Yes, the feature calculators. The two code lines you put were syntactically incorrect. Do you mean a list of dictionaries? if yes, then when I tried this:
print('cwt_coefficients ', f.cwt_coefficients(x, [{'widths': 10, 'coeff': 5, "w": 10}, {'widths': 3, 'coeff': 5, "w": 10}, {'widths': 10, 'coeff': 5, "w": 11} ]))
i got this error:
File "*****\scipy\signal\wavelets.py", line 360, in cwt output = np.zeros([len(widths), len(data)]) TypeError: object of type 'int' has no len()
is there a specific format for the list of dictionaries that this function (and its sisters) accepts?
Sorry, widths need to be a list of ints, so
print('cwt_coefficients ', f.cwt_coefficients(x, [{'widths': [3, 10], 'coeff': 5, "w": 10}, {'widths': [3], 'coeff': 5, "w": 10}, {'widths': [3, 10], 'coeff': 5, "w": 11} ]))
Thanks, that solved the problem.
I am trying to call the methods that calculate the measures from my code. ( i do that because I am interested in some of the measurs, not all of them)
whenever the function I am calling uses the variable
param
, i got an error. For example:print('cwt_coefficients ', f.cwt_coefficients(x,{'widths': 10, 'coeff': 5, "w":10} ))
generates the following error:Is there something wrong I am doing? I suspect that there should be specific format for the param value!