DSoftWarePythonpythonexe CUsers17731Desktop毕业设计代码SVMmainpy Traceback most recent call last File CUsers17731Desktop毕业设计代码SVMmainpy line 197 in module x_train x_test y_train y_test max_value = get_d
The error message suggests that there is a TypeError in the code. Specifically, it seems that the code is trying to convert an array to a scalar value, which is not allowed.
To fix this issue, you can try the following:
-
Check if the
max_value[j]variable is a scalar value. Make sure it is not an array or a list. -
If
max_value[j]is an array or a list, you need to access the specific element you want to use. For example, ifmax_value[j]is an array, you can usemax_value[j][0]to access the first element.
Here's an example of how you can modify the code:
x_train[:, j] = log10(x_train[:, j] + 1e-5) / log10(max_value[j][0])
Make sure to double-check the data types and values of the variables involved to ensure the code runs correctly
原文地址: https://www.cveoy.top/t/topic/h77C 著作权归作者所有。请勿转载和采集!