Closed IceyBlackTea closed 1 year ago
Also, when I run lstm, I found that there are some data that would raise errors, such as yahoo a1 real16.
File "***/TSB_UAD/models/lstm.py", line 33, in fit
X_train = X_train.reshape((X_train.shape[0], X_train.shape[1], 1))
IndexError: tuple index out of range
I think the find_length
function in slidingWindows.py
is the reason, the window is too large, len(data_train) = 146 but slidingwindows = 167, and then X_train = [].
How should I modify the code better?
Hello,
Thanks for reporting these issues - we are having a look and will get back to you.
Best, John
Hello,
I have tried to replicate your issue on my side. However, I couldn't. I was able to install and run (LSTM with Yahoo dataset) without any issues on a new environment. Can you provide the steps you used and the example code that is causing the issue? Thanks.
Sorry, I've been updating my own project for a while, so I don't have the code with the original error.
I remember I followed the readme.md to install it.
conda env create --file environment.yml
conda activate TSB
pip install -r requirements.txt
pip install .
The python code should be similar to this,
import pandas as pd
from TSB_UAD.core import tsb_uad
for i in range(67):
df = pd.read_csv(f'data/benchmark/YAHOO/Yahoo_A1real_{i+1}_data.out',header=None).to_numpy()
data = df[:, 0].astype(float)
label = df[:, 1]
results = tsb_uad(data, label, 'LSTM', metric='all')
I run it on ubuntu 20.04 and the dataset is downloaded from the public link in readme.md.
I also use other dependencies in my project, with new versions in some packages, so I wrote this issue about setup.py & requirements.txt at first.
I modified some parameters in my own scenario, such as specifying the size of train data and window size, so there is no special problem in running my code now.
Thanks.
Hi, I tried to run the benchmark of yahoo a1 real data with lstm. I wrote the code based on your example.
Then, an error came out,
I think maybe you need to add
__init__.py
inTSB_UAD/vus/affiliation
.In addition, versions of requires in
setup.py
andrequirements.txt
are quiet different. For now, I deletedinstall_requires
insetup.py
. Some of these versions are very old, can you tell me how to modify them better?