Spaces:
Sleeping
Sleeping
hot fix
Browse files
app.py
CHANGED
|
@@ -60,12 +60,11 @@ with gr.Blocks(title="Time series anomaly detection with Chronos2") as demo:
|
|
| 60 |
- "timestamp": the timestamp column of your data (e.g., "2023-01-01 00:00:00"). It is optional, if missing we will add a default timestamp ourselves.
|
| 61 |
- "values": the columns containing the values of the time series data. They can be named as you wish. At least one column of values is required.
|
| 62 |
2. Answer the question about the timestamp in your data to help the model understand the temporal structure of your data.
|
| 63 |
-
- if present, the timestamp column should be in a recognizable datetime format (e.g., "YYYY-MM-DD HH:MM:SS").
|
| 64 |
- if present, you will need to specify the column name of the timestamp in your data.
|
| 65 |
-
-
|
| 66 |
3. Click on the "Detect Anomalies" button to run the Chronos2 pipeline and visualize the detected anomalies.
|
| 67 |
4. If the number of series is reasonably small, we will plot the original time series along with the detected anomalies.
|
| 68 |
-
5. We will provide a downloadable CSV file containing the original time series data along with an additional column indicating whether each point is an anomaly or not.
|
| 69 |
|
| 70 |
## Note
|
| 71 |
- The Chronos2 pipeline is designed to handle multivariate time series data, so you can upload datasets with multiple columns of values.
|
|
@@ -105,4 +104,4 @@ with gr.Blocks(title="Time series anomaly detection with Chronos2") as demo:
|
|
| 105 |
)
|
| 106 |
|
| 107 |
|
| 108 |
-
demo.launch()
|
|
|
|
| 60 |
- "timestamp": the timestamp column of your data (e.g., "2023-01-01 00:00:00"). It is optional, if missing we will add a default timestamp ourselves.
|
| 61 |
- "values": the columns containing the values of the time series data. They can be named as you wish. At least one column of values is required.
|
| 62 |
2. Answer the question about the timestamp in your data to help the model understand the temporal structure of your data.
|
|
|
|
| 63 |
- if present, you will need to specify the column name of the timestamp in your data.
|
| 64 |
+
- Otherwise, no need to do anything, just mark No.
|
| 65 |
3. Click on the "Detect Anomalies" button to run the Chronos2 pipeline and visualize the detected anomalies.
|
| 66 |
4. If the number of series is reasonably small, we will plot the original time series along with the detected anomalies.
|
| 67 |
+
5. We will provide a downloadable CSV file containing the original time series data along with an additional column indicating whether each point is an anomaly or not. We will label as 1 anomalies, as 0 normal points and as -1 the points for which we don't have a prediction because they are before the minimum length required by the model.
|
| 68 |
|
| 69 |
## Note
|
| 70 |
- The Chronos2 pipeline is designed to handle multivariate time series data, so you can upload datasets with multiple columns of values.
|
|
|
|
| 104 |
)
|
| 105 |
|
| 106 |
|
| 107 |
+
demo.launch(share=True)
|
utils.py
CHANGED
|
@@ -46,7 +46,7 @@ def validateData(file, timestamp_column:str=None):
|
|
| 46 |
|
| 47 |
assert df.isna().sum().sum() == 0, "Missing values detected in the uploaded data. Please ensure your CSV file does not contain any missing values (NaNs) for accurate anomaly detection."
|
| 48 |
assert np.isfinite(df.select_dtypes(include=[np.number])).all().all(), "Non-finite values detected in the uploaded data. Please ensure your CSV file does not contain any non-finite values (e.g., inf, -inf) for accurate anomaly detection."
|
| 49 |
-
assert not
|
| 50 |
|
| 51 |
|
| 52 |
|
|
|
|
| 46 |
|
| 47 |
assert df.isna().sum().sum() == 0, "Missing values detected in the uploaded data. Please ensure your CSV file does not contain any missing values (NaNs) for accurate anomaly detection."
|
| 48 |
assert np.isfinite(df.select_dtypes(include=[np.number])).all().all(), "Non-finite values detected in the uploaded data. Please ensure your CSV file does not contain any non-finite values (e.g., inf, -inf) for accurate anomaly detection."
|
| 49 |
+
assert 'object' not in df.columns.dtype, "Non-numeric value columns detected. Please ensure all value columns in your CSV file contain numeric data for accurate anomaly detection."
|
| 50 |
|
| 51 |
|
| 52 |
|