Closed
Description
Environment Details
SDV version: 0.10.0
Python version: 3.7.10
Operating System: Windows
Error Description
When executing LSTMDetection and TSFCDetection time series evaluation metrics the following error is presented:
"ValueError: No group keys passed!"
The PAR model was not trained with any entity columns or context columns. The PAR model was only trained with the sequence index. i.e model = PAR(sequence_index="timestamp")
model.fit(df) # Train the model
Does the model have to have an entity column to utilize the metric functions?
Steps to reproduce
import pandas as pd
import numpy as np
from pathlib import Path
from sdv.timeseries import PAR
from sdv.metrics.timeseries import LSTMDetection, TSFCDetection
real_data = pd.read_csv(DATA_DIR / "real_data.csv", parse_dates=['timestamp'])
synthetic_data = pd.read_csv(DATA_DIR / "synthetic_data.csv", parse_dates=['timestamp'])
metadata = {'fields': {'engine': {'type': 'numerical', 'subtype': 'float'},
'airspeed': {'type': 'numerical', 'subtype': 'float'},
'timestamp': {'type': 'datetime'}},
'sequence_index': 'timestamp'}
LSTMDetection.compute(real_data, synthetic_data, metadata)
TSFCDetection.compute(real_data, synthetic_data, metadata)