---
title: Time Series Forecasting
slug: time-series-forecasting
docTags: 
createdAt: 2023-06-04T18:16:39.000Z
---

The below input parameters are for different attack types. To start working with the APIs view the [Times Series Forecasting](docId\:EB7FsMB2O-fz1_RLafm9u).

### File upload format

- **Data**: Data should be in a CSV file with a header as all the features (Columns) name and the last column as the target variable.

[Downloa sample data](https://aisdocs.blob.core.windows.net/reference/upload/TimeSeries/Forecasting/ML/data.zip)

- **Minmax**: Data should be in a CSV file with a header as all the feature (Columns) names and the last column as the target variable. The first row of the CSV file should contain the minimum value for each column (feature), and the second row should contain the max value.&#x20;

[Downloa sample minmax](https://aisdocs.blob.core.windows.net/reference/upload/TimeSeries/Forecasting/ML/minmax.zip)

- **Model**: The model should be saved in either .pkl, .h5 or TensorFlow format with full architecture. Full architecture is needed when loading the model to the platofrm for assessment either in encrypted or unencrypted. This can be ignored when model is hosted as an API.

[Download sample model](https://aisdocs.blob.core.windows.net/reference/upload/TimeSeries/Forecasting/ML/model0.zip)

:::hint{type="warning"}
All files uploaded should be in zipped format. The above files are sample data.
:::

:::ExpandableHeading
## Extraction parameters

| Parameter                      | Data type | Descrption                                                                                                                                                                                       | Remark                                                                                                                                                                                                                                                                            |
| ------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| model\_id                      | String    | Model\_id received during model registration. We need to provide<br />this model\_id  in query parameter in URL.                                                                                 | you have to do model registration only once for a model and you can perform many analysis. This will help you to track how many api call has been made, how many has successed.                                                                                                   |
| **Request Body (Json format)** |           |                                                                                                                                                                                                  |                                                                                                                                                                                                                                                                                   |
| attack\_type                   | String    | You can select the attack type either Blackbox or Greybox.                                                                                                                                       | **Blackbox**: for performing model analysis, no information about model or data will be used.                                              **Greybox**: information about data will be leverage for creation of attack data<br />**Note:&#x20;**&#x6F;nly 2-5 % of data is needed |
| input\_dimensions              | String    | Input dimension (Example 100,6 for Pump Sensor)                                                                                                                                                  | the parameter should be string.                                                                                                                                                                                                                                                   |
| number\_of\_attack\_queries    | String    | Number of attack queries that model will be subjected to.                                                                                                                                        | generally Heigher the number of attack queries, better would be the analysis. And it would take more time to process. (Range:  >0<br />& \<=400000)                                                                                                                               |
| model\_framework               | String    | Original model is built with tensorflow framework.(Option :\[tensorflow])                                                                                                                        | curretly supported framework are: tensorflow, scikit-learn, keras                                                                                                                                                                                                                 |
| model\_api\_details            | String    | If use\_model\_api is Yes, then provide API details of hosted model as<br />encrypted JSON string is mandatory                                                                                   | provide this only if use\_model\_api is "yes".                                                                                                                                                                                                                                    |
| use\_model\_api                | String    | Use model API to train your model instead of uploading the model as a zip.                                                                                                                       | when this parameter is yes, you don't have to upload model as zip. You can pass api url along with other verification credential in json file.                                                                                                                                    |
| defense\_bestonly              | String    | Highly optimized defense model will be returned.                                                                                                                                                 | when selected **"yes"**, it will train N number of model and select best model. Ofcourse this will take longer time. If **"no"**, then once defense model accuracy reached above 95% It will stop                                                                                 |
| encryption\_strategy           | Int       | Choose a encryption strategy for you model. if model is uploaded directly as a<br />zip pick 0, 1 if model is encryted as .pyc and<br />uploaded as a zip. Ignore if use\_model\_api is<br />Yes | select 0: pass tensorflow model as it is, select 1: pass encrypted model. It could be .pyc file                                                                                                                                                                                   |
| vulnerability\_threshold       | String    | Threshold percent of stolen model accuracy at which defense model should be generated                                                                                                            | parameter value will be between 0 to 1.                                                                                                                                                                                                                                           |
:::

:::hint{type="info"}
To access all sample artifacts, please visit [Artifacts](docId\:iJNEOCXoStabvvrsq11fa).&#x20;

- For specific artifact details,  refer&#x20;
  - Vulnerability Report : [Vulnerability Report](docId\:hL0uT2MWlCBkt8F97fr-W)    &#x20;
  - Sample Attacks : [Sample Attacks](docId:4G1mjM5lQjfm8t5WBVwpr)
  - Defense Report: [Defense Report](docId\:VtzlTtpja2VSF2j0STLSQ)                   &#x20;
  - Defense Model: [Defense Model](docId\:xSbxmZXW4vv14-8NmBF8M)
:::

:::hint{type="info"}
**Note**: For Time series forecasting, supported attack types are - Extraction
:::

