引自免费微信小程序:皆我百晓生
看起来你遇到了一个与tsfresh
库相关的问题。错误提示是因为在尝试调用acf
函数时,它期望有一个名为unbiased
的参数,但该函数签名中并没有这个参数。这可能是由于版本问题或者是库内部实现的变化。
为了解决这个问题,你可以尝试以下几个步骤:
- 检查并更新
tsfresh
到最新版本。有时候,旧版本的库可能包含已废弃或修改的功能。 - 如果你不想更新整个库,可以尝试从源码中临时修改
agg_autocorrelation
函数,去掉对unbiased
参数的依赖。
首先,确保你已经安装了tsfresh
,如果没有,请安装它(如果你已经在环境中安装了,可以跳过此步):
pip install tsfresh
然后,我们可以尝试从源码中临时修改agg_autocorrelation
函数。创建一个名为custom_feature_calculators.py
的新Python文件,并将下面的代码复制进去:
from tsfresh.feature_extraction.feature_calculators import _centered_moving_average, _rolling_count_nans, _roll_min_max, _get_mean_of_values, _rolling_variance, _rolling_std, _rolling_skewness, _rolling_kurtosis, _mean_abs_change, _median_absolute_deviation, _rolling_mean_absolute_deviation, _range_of_changes, _maximal_lag_of_correlation, _minimal_lag_of_correlation, _maximal_amplitude_of_fluctuation, _minimal_amplitude_of_fluctuation, _entropy, _mean_second_derivative_central, _mean_third_derivative_central, _mean_fourth_derivative_central, _mean_abs_fourth_derivative_central, _mean_crossing_points, _mean_crossing_points_derivative, _variance_larger_than_standard_deviation, _variance_smaller_than_standard_deviation, _abs_energy_ratio, _root_mean_square, _root_mean_square_consecutive_differences, _consecutive_sum_over_threshold, _consecutive_sum_up_down, _consecutive_maxima, _consecutive_minima, _number_of_peaks, _number_of_valleys, _peak_to_peak, _valley_to_valley, _zero_crossings, _number_of_sign_changes, _sum_of_changes, _sum_of_changes_positive, _sum_of_changes_negative, _mean_first_derivative, _mean_second_derivative, _mean_third_derivative, _mean_fourth_derivative, _abs_energy, _autocorrelation, _mean_abs_change_rate, _mean_second_derivative_central_rate, _mean_third_derivative_central_rate, _mean_fourth_derivative_central_rate, _fft_aggregated, _fft_aggregated_linear, _fft_aggregated_squared, _fft_aggregated_cosine, _fft_aggregated_sine, _fft_aggregated_harmonics, _fft_aggregated_logamplitude, _fft_aggregated_frequency, _fft_aggregated_phase, _fft_aggregated_angle, _fft_aggregated_complex, _kurtosis, _skewness, _mean, _median, _min, _max, _std, _variance, _quantiles, _mad, _iqr, _cv, _z_score, _q_statistic, _hjorth_complexity, _hurst_exponent, _sample_entropy, _approximate_entropy, _detrended_fluctuation_analysis, _fluctuation_analysis, _longest_strike_above_median