Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sliding window error #13

Open
nattafahhm opened this issue Aug 21, 2020 · 1 comment
Open

sliding window error #13

nattafahhm opened this issue Aug 21, 2020 · 1 comment

Comments

@nattafahhm
Copy link

nattafahhm commented Aug 21, 2020

Loading data... is fine
..from file data/oppChallenge_gestures.data
..reading instances: train (557963, 113), test (118750, 113)

Until I call a sliding window function, error is shown
Sensor data is segmented using a sliding window mechanism
X_test, y_test = opp_sliding_window(X_test, y_test, SLIDING_WINDOW_LENGTH, SLIDING_WINDOW_STEP_SHORT)
X_train, y_train = opp_sliding_window(X_train, y_train, SLIDING_WINDOW_LENGTH, SLIDING_WINDOW_STEP)


TypeError Traceback (most recent call last)
in ()
1 # Sensor data is segmented using a sliding window mechanism
----> 2 X_test, y_test = opp_sliding_window(X_test, y_test, SLIDING_WINDOW_LENGTH, SLIDING_WINDOW_STEP_SHORT)
3 X_train, y_train = opp_sliding_window(X_train, y_train, SLIDING_WINDOW_LENGTH, SLIDING_WINDOW_STEP)

1 frames
/content/drive/My Drive/sensors2020/sliding_window.py in sliding_window(a, ws, ss, flatten)
93 # remove any dimensions with size 1
94 dim = filter(lambda i : i != 1,dim)
---> 95 return strided.reshape(dim)

TypeError: expected sequence object with len >= 0 or a single integer

@qzd-1
Copy link

qzd-1 commented Feb 11, 2023

正在加载数据...很好..从文件数据/oppChallenge_gestures.数据..读取实例:火车(557963,113),测试(118750,113)

直到我调用滑动窗口函数,才会显示错误 传感器数据使用滑动窗口机制进行分段 X_test, y_test = opp_sliding_window(X_test, y_test, SLIDING_WINDOW_LENGTH, SLIDING_WINDOW_STEP_SHORT) X_train, y_train = opp_sliding_window(X_train, y_train, SLIDING_WINDOW_LENGTH, SLIDING_WINDOW_STEP)

类型错误回溯(最近一次调用上一次) 在 () 1 # 传感器数据使用滑动窗口机制进行分段 ----> 2 X_test,y_test = opp_sliding_window(X_test、y_test、SLIDING_WINDOW_LENGTH、SLIDING_WINDOW_STEP_SHORT) 3 X_train,y_train = opp_sliding_window(X_train、y_train、SLIDING_WINDOW_LENGTH、SLIDING_WINDOW_STEP)

1 帧/内容/驱动器/我的驱动器/传感器2020/sliding_window.py sliding_window(a、ws、ss、扁平)中的 93 # 删除大小为 1 的任何维度 94 dim = filter(lambda i : i != 1,dim) ---> 95 返回步幅.reshape(dim)

类型错误:len >= 0 或单个整数的预期序列对象

I had the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants