# Time-Series Forecasting

This section shows how to build an application for time-series forecasting in AI & Analytics Engine using

• Using the GUI
• Using API access through SDK

## Using the GUI

Starting from the page of a dataset, hover on the floating-action buttons at the bottom right and choose "NEW APP".

On the "NEW APP" dialog, you need to specify the app name, select the dataset that this app is built for, tick one or more target columns as well as the time column. After all of these are confirmed, click "NEXT".

Then you need to configure the proportion of data for training before click "CREATE APPLICATION".

Finally you are guided to the page of the application that you have just created with all related information. Here the problem type is automatically detected as forecasting.

## Using API access through SDK

To access the API functions, you must first authenticate into the platform by

from aiaengine import api

client = api.Client()


### Importing app

Next you need to import app in order to call functions involved in this module.

from aiaengine.api import app


### Creating an app for a dataset

Now you can add a new app by specifying the required parameter values as follows.

create_app_response = client.apps.CreateApp(
app.CreateAppRequest(
name='App Name',
dataset_id='id_of_dataset_app_is_created_for',
problem_type='forecasting',
target_columns=['target_column_1', 'target_column_2'],
extra_columns={'timeColumn': 'time_column'},
training_data_proportion=0.8
)
)


Similar to the process of building a task for classification and regression, you need the name, and description and the dataset id to build an application for times-series forecasting. Here you need to specify the problem type as 'forecasting' for this task.

Particularly for time-series forecasting, you can specify one or more target columns corresponding to input target_columns. In the above example, we have two target columns 'target_column_1' and 'target_column_2' for forecasting. You also need to specify the time column in a forecasting application. We use 'time_column' as our time column in the example. At last, you can set up a ratio of train-test split using training_data_proportion which indicates the proportion of data used for training over the whole dataset. For time-series forecasting, the training set comes in sequence before the test set in chronological order.

app_id = create_app_response.id


Once created, an application is assigned a unique id, which is frequently used in related functions.