# Tutorial: AutoAI univariate time series experiment #

Use sample data to train a univariate (single prediction column) time series experiment that predicts minimum daily temperatures\.

When you set up the experiment, you load data that tracks daily minimum temperatures for the city of Melbourne, Australia\. The experiment will generate a set of pipelines that use algorithms to predict future minimum daily temperatures\. After generating the pipelines, AutoAI compares and tests them, chooses the best performers, and presents them in a leaderboard for you to review\.

## Data set overview ##

The [*Mini\_Daily\_Temperatures*](https://dataplatform.cloud.ibm.com/exchange/public/entry/view/de4d953f2a766fbc0469723eba0d93ef) data set describes the minimum daily temperatures over 10 years (1981\-1990) in the city Melbourne, Australia\. The units are in degrees celsius and the data set contains 3650 observations\. The source of the data is the Australian Bureau of Meteorology\. Details about the data set are described here:

![Daily Min Temperature Spreadsheet](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/autoai_uni_table.png)

<!-- <ul> -->

 *  You will use the `Min_Temp` column as the prediction column to build pipelines and forecast the future daily minimum temperatures\. Before the pipeline training, the `date` column and `Min_Temp` column are used together to figure out the appropriate lookback window\.
 *  The prediction column forecasts a prediction for the daily minimum temperature on a specified day\.
 *  The sample data is *structured* in rows and columns and saved as a \.csv file\.

<!-- </ul> -->

## Tasks overview ##

In this tutorial, you follow these steps to create a univariate time series experiment:

<!-- <ol> -->

1.  [Create a project](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/autoai-ts-uni-tutorial.html?context=cdpaas&locale=en#step0)
2.  [Create an AutoAI experiment](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/autoai-ts-uni-tutorial.html?context=cdpaas&locale=en#step1)
3.  [Configure the experiment](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/autoai-ts-uni-tutorial.html?context=cdpaas&locale=en#step2)
4.  [Review experiment results](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/autoai-ts-uni-tutorial.html?context=cdpaas&locale=en#step3)
5.  [Deploy the trained model](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/autoai-ts-uni-tutorial.html?context=cdpaas&locale=en#step4)
6.  [Test the deployed model](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/autoai-ts-uni-tutorial.html?context=cdpaas&locale=en#step5)

<!-- </ol> -->

## Create a project ##

Follow these steps to download the [*Mini\_Daily\_Temperatures*](https://dataplatform.cloud.ibm.com/exchange/public/entry/view/de4d953f2a766fbc0469723eba0d93ef) data set from the **Samples** and create an empty project:

<!-- <ol> -->

1.  From the navigation menu ![Navigation menu](https://dataplatform.cloud.ibm.com/docs/content/wsj/getting-started/images/navigation-menu.svg), click **Samples** and download a local copy of the [*Mini\_Daily\_Temperatures*](https://dataplatform.cloud.ibm.com/exchange/public/entry/view/de4d953f2a766fbc0469723eba0d93ef) data set\.
2.  From the navigation menu ![Navigation menu](https://dataplatform.cloud.ibm.com/docs/content/wsj/getting-started/images/navigation-menu.svg), click **Projects > View all projects**, then click **New Project**\.
    
    <!-- <ol> -->
    
    1.  Click **Create an empty project**.
    2.  Enter a name and optional description for your project.
    3.  Click **Create**.
    
    <!-- </ol> -->
    
<!-- </ol> -->

## Create an AutoAI experiment ##

Follow these steps to create an AutoAI experiment and add sample data to your experiment:

<!-- <ol> -->

1.  On the *Assets* tab from within your project, click **New asset > Build machine learning models automatically**\.
2.  Specify a name and optional description for your experiment, then select **Create**\.
3.  Select **Associate a Machine Learning service instance** to create a new service instance or associate an existing instance with your project\. Click **Reload** to confirm your configuration\.
4.  Click **Create**\.
5.  To add the sample data, choose one of the these methods:  
    
    <!-- <ul> -->
    
     *  If you downloaded your file locally, upload the training data file, *Daily\_Min\_Temperatures.csv*, by clicking **Browse** and then following the prompts.  
        
     *  If you already uploaded your file to your project, click **Select from project**, then select the **Data asset** tab and choose *Daily\_Min\_Temperatures.csv*.
    
    <!-- </ul> -->
    
<!-- </ol> -->

## Configure the experiment ##

Follow these steps to configure your univariate AutoAI time series experiment:

<!-- <ol> -->

1.  Click **Yes** for the option to create a Time Series Forecast\.
2.  Choose as prediction columns: `Min_Temp`\.
3.  Choose as the date/time column: `Date`\.
    
    ![Configuring experiment settings. Yes to time series forecast and min temp as the prediction column with Date as the date/time column.](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/autoai_uni_run_configuration.png)
4.  Click **Experiment settings** to configure the experiment:  
    
    <!-- <ol> -->
    
    1.  In the **Data source** page, select the **Time series** tab.  
        
    2.  For this tutorial, accept the default value for *Number of backtests* (4), *Gap length* (0 steps), and *Holdout length* (20 steps).
        
        Note: The validation length changes if you change the value of any of the parameters: *Number of backtests*, *Gap length*, or *Holdout length*.
        
        c. Click **Cancel** to exit from the *Experiment settings*.  
        
    <!-- </ol> -->
    
    ![Experiment settings on Data Source page](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/autoai_uni_exp_settings.png)
5.  Click **Run experiment** to begin the training\.

<!-- </ol> -->

## Review experiment results ##

The experiment takes several minutes to complete\. As the experiment trains, a visualization shows the transformations that are used to create pipelines\. Follow these steps to review experiment results and save the pipeline with the best performance\.

<!-- <ol> -->

1.  (Optional): Hover over any node in the visualization to get details on the transformation for a particular pipeline\.
    
    ![Experiment summary generating pipelines](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/autoai_uni_pipeline_build.png)
2.  (Optional): After the pipelines are listed on the leaderboard, click **Pipeline comparison** to see how they differ\. For example:
    
    ![Metric chart of pipeline comparison](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/autoai_uni_pipeline_comparison.png)
3.  (Optional): When the training completes, the top three best performing pipelines are saved to the leaderboard\. Click **View discarded pipelines** to review pipelines with the least performance\.
    
    ![Ranked pipeline leaderboard based on accuracy](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/autoai_uni_pipeline_leaderboard.png)
4.  Select the pipeline with Rank 1 and click **Save as** to create your model\. Then, select **Create**\. This action saves the pipeline under the **Models** section in the Assets tab\.

<!-- </ol> -->

## Deploy the trained model ##

Before you can use your trained model to make predictions on new data, you must deploy the model\. Follow these steps to promote your trained model to a deployment space:

<!-- <ol> -->

1.  You can deploy the model from the model details page\. To access the model details page, choose one of the these methods:
    
    <!-- <ul> -->
    
     *  Click the model’s name in the notification that is displayed when you save the model.
     *  Open the *Assets* page for the project that contains the model and click the model’s name in the *Machine Learning Model* section.
    
    <!-- </ul> -->
    
2.  Click **Promote to Deployment Space**, then select or create a deployment space where the model will be deployed\.  
    (Optional): To create a deployment space, follow these steps:  
    
    <!-- <ol> -->
    
    1.  From the **Target space** list, select **Create a new deployment space**.  
        
    2.  Enter a name for your deployment space.  
        
    3.  To associate a machine learning instance, go to **Select machine learning service (optional)** and select an instance from the list.  
        
    4.  Click **Create**.  
        
    <!-- </ol> -->
    
3.  After you select or create your space, click **Promote**\.
4.  Click the deployment space link from the notification\.
5.  From the Assets tab of the deployment space:
    
    <!-- <ol> -->
    
    1.  Hover over the model’s name and click the deployment icon ![Deploy icon](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/deploy-icon.png).
    2.  In the page that opens, complete the fields:
        
        <!-- <ol> -->
        
        1.  Specify a name for the deployment.
        2.  Select **Online** as the *Deployment type*.
        3.  Click **Create**.
        
        <!-- </ol> -->
        
    <!-- </ol> -->
    
<!-- </ol> -->

After the deployment is complete, click the **Deployments** tab and select the deployment name to view the details page\.

## Test the deployed model ##

Follow these steps to test the deployed model from the deployment details page:

<!-- <ol> -->

1.  On the **Test tab** of the deployment details page, click the terminal icon ![Terminal icon](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/terminal-icon.png) and enter the following JSON test data:
    
        { "input_data": [ {
        
              "fields": 
        
                    "Min_Temp"
        
              ],
        
              "values": 
        
                    7], 15]
        
              ]
        
        } ] }
    
    Note: The test data replicates the data fields for the model, except the prediction field.
2.  Click **Predict** to predict the future minimum temperature\.

<!-- </ol> -->

![Test tab for deployed model with JSON code as input data](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/autoai_uni_test.png)

**Parent topic:**[Building a time series experiment](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/autoai-timeseries.html)

<!-- </article "role="article" "> -->