Skip to content

Time Series LSTMDetection and TSFCDetection Metrics #487

Closed
@ca692526

Description

@ca692526

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdata:sequentialRelated to timeseries datasetsfeature:evaluationRelated to running metrics or visualizationsresolution:duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions