1. Homepage
  2. Coding
  3. COMP3411/9814 24T3 Artificial Intelligence - Assignment 1: Artificial neural networks

COMP3411/9814 24T3 Artificial Intelligence - Assignment 1: Artificial neural networks

Order Now
UNSWCOMP3411COMP9814Artificial IntelligenceArtificial neural networksPython

COMP3411/9814 24T3 Artificial Intelligence Assignment Writing Service

Assignment 1 - Artificial neural networks Assignment Writing Service

1 Problem overview
Assignment Writing Service

In this assignment, you will use artificial neural networks for drought modelling in the Murray-Darling Basin. You will conduct two tasks: Assignment Writing Service

(a) A classification task to predict whether there is ‘a drought’ or ‘no drought’ based on the climate conditions. Assignment Writing Service

(b) A regression task to predict the intensity of a drought based on the climate conditions. Assignment Writing Service

The Murray-Darling Basin is a very important agricultural region in Australia that produces a large portion of the nation’s food and fibre (see Fig. 1). It is a big river system that supports many different types of crops and live- stock, making it essential for Australia’s food production. However, the basin is very prone to droughts, which can greatly affect water availability and agricultural productivity, threatening the stability of the food system. Because of this, there is a lot of interest in monitoring drought conditions in the Murray-Darling Basin to manage water resources effectively. Assignment Writing Service

Figure 1: Location of the Murray-Darling Basin and illustration of grid cells within the basin. Assignment Writing Service

2 Dataset Assignment Writing Service

The climate data used in this assignment is derived from the ERA5 cli- mate dataset. ERA5 data covers the globe and combines surface observa- tions, satellite measurements, and weather balloons, using advanced numeri- cal weather prediction models and data assimilation methods. The data you will use has been extracted from the ERA5 global dataset for the Murray- Darling Basin in Australia. The data has been processed to provide monthly values of several climate variables associated with droughts and covering the years from 1979 to 2020. The original ERA5 dataset is publicly available and consists of more than 200 terabytes. However, the datafile provided for this assignment in Climate SPI.csv has been specifically derived and cannot be downloaded from anywhere else. Assignment Writing Service

Climate predictors and additional attributes Assignment Writing Service

Table 1: List of variables included in data file Climate SPI.csv. Assignment Writing Service

Variable Description Assignment Writing Service

mn2t msl mx2t q Assignment Writing Service

t
t2
tcc
u
u10
v
v10
z month year grid ID SPI
Assignment Writing Service

Minimum temperature at 2 meters (°K) Mean sea level pressure in (Pa) Maximum temperature at 2 meters (°K) specific humidity (kg kg-1) Assignment Writing Service

Average temperature at Pressure level 850 hPa in (°K) Average temperature at 2 m in (°K)
Total cloud cover (0-1)
U wind component at pressure level 850 hPa (ms-1)
Assignment Writing Service

U wind component at 10 m (ms-1)
V wind component at Pressure level 850 hPa (ms-1) V wind component at 10 m (ms-1)
Geopotential (m2s-2)
1 to 12
1979 to 2020
The ID of the grid cell
Standardised Precipitation Index (unitless)
Assignment Writing Service

The data file Climate SPI.csv contains climate data for 30 grid cells. Each grid cell is represented as a single square within the boundaries of the basin, as shown in Fig. 1. In the data file, each row, or sample, corresponds to a grid cell identified by grid ID, and contains: Assignment Writing Service

  • Time information: year, month. Assignment Writing Service

  • A set of climate variables represented by acronyms: mn2t, msl, mx2t, q, t, t2, tcc, u, u10, v, v10, and z. The description and unit of measurement for each of these variables are provided in Table 1. A time series plot of each of these variables for a single grid is shown in Fig. 2 to help you visualise these variables. Assignment Writing Service

A drought index: SPI. Assignment Writing Service

Figure 2: Time series of the climate variables for a single grid cell. Assignment Writing Service

2.2 Target variable Assignment Writing Service

The drought index SPI (Standardised Precipitation Index) is used here as a proxy to characterise the intensity of drought caused by precipitation defi- ciency. Very low SPI values suggest intense drought, while very high values indicate very wet conditions. In the regression task, SPI is your target vari- able, and you need to predict it based on the climate variables. In the classi- fication task, you will calculate a binary target variable ’Drought’ from SPI. The ’Drought’ variable will be 1 to indicate the occurrence of drought and 0 to indicate no drought. You will apply a threshold of -1 to SPI, where values below or equal to this threshold indicate drought conditions (i.e. Drought = 1); otherwise, there is no drought (i.e. Drought = 0). A time series plot of SPI for a single grid cell is shown in Fig. 3. Periods where SPI falls below or is equal to -1 indicate periods of drought. Assignment Writing Service

Figure 3: Time series of the drought index SPI for a single grid cell. Periods where SPI falls below or is equal to -1 indicate periods of drought. Assignment Writing Service

2.3 Data cleansing Assignment Writing Service

Next is the description of the classification and regression tasks. You can treat each task separately. Do not use ’year’ and ’Grid ID’ for either task. Additionally, you cannot use ‘Drought’ and ‘SPI’ as predictors for either task. For both tasks, you will need to create your artificial neural network using Keras and TensorFlow packages. Before you start solving the tasks, please carefully read the entire assignment description, including how to submit your assignment. Assignment Writing Service

3 Classification task Assignment Writing Service

In this classification task, the goal is for the neural network to predict whether there is a drought or no drought based on climate data predictors. A complete script should include all the steps below, along with any additional necessary steps: Assignment Writing Service

(a) Calculate ‘Drought’ from ‘SPI’ by setting a threshold of -1 for the ‘SPI’ values. Assignment Writing Service

(b) Split your data into training, validation and test sets. 5 Assignment Writing Service

(c) Pre-processing: Apply any necessary transformation to the training set, then apply the same transformation to the validation and test sets. Keep record of all applied transformations. Assignment Writing Service

  1. (d)  Build your model by defining its architecture, and hyperparameters. This includes: loss function, optimiser, batch size, learning rate, and number of epochs. It is recommended that your network has fewer parameters than the number of samples divided by 10. Assignment Writing Service

  2. (e)  Train the neural network and monitor the evolution of the loss values. Assignment Writing Service

3.1 Evaluate model performance on validation set Assignment Writing Service

(f) Createaplotshowingtheaccuracy(y-axis)versusthenumberofepochs (x-axis) for both the training and validation sets. Assignment Writing Service

3.2 Optimise your neural network Assignment Writing Service

  1. (g)  Repeat steps d), e), and f) to find the best neural network configuration. Assignment Writing Service

  2. (h)  Build and train your model on different subsets of climate predictors. Use the subset of climate predictors that achieve the best outcome based on the validation set. Assignment Writing Service

3.3 Evaluate your classification model on test set Assignment Writing Service

  1. (i)  Applythesametransformationstothetestsetasyoudidtothetraining set. Assignment Writing Service

  2. (j)  Use your model to predict the class on the test set. Assignment Writing Service

  3. (k)  Evaluate the performance of your model using sklearn and/or creating your own functions: Assignment Writing Service

    Compute and plot a confusion matrix. Note that your positive class is 1, i.e. ‘Drought’. Assignment Writing Service

    Calculate and print “Balanced Accuracy” and “Precision”.  Assignment Writing Service

Additional notes (apply to both tasks) Assignment Writing Service

You need to set the random seed to ensure that your results are repro- ducible. Assignment Writing Service

You must save your model. Assignment Writing Service

In step f), you only need to show the plot(s) for the best neural network configuration and the chosen predictors. Assignment Writing Service

If you choose to use ‘month’ as a predictor, encode it using cyclic en- coding to ensure that your neural network understands the relationship between December and January. To achieve this: Assignment Writing Service

Normalise the month to the range [0, 2π] using: month normalised = 2π× (month - 1)/12. Assignment Writing Service

Replace ’month’ with two new predictors: ‘cos(month normalised)’ and ‘sin(month normalised)’. Assignment Writing Service

Regression task Assignment Writing Service

In this regression task, the goal is for the neural network to predict the inten- sity of the drought, represented by ‘SPI’, based on climate data predictors. A complete script should include all the steps below, along with any additional necessary steps. Assignment Writing Service

  1. (a)  Split your data into training, validation and test sets. Assignment Writing Service

  2. (b)  Pre-processing: Apply any necessary transformation to the training set, then apply the same transformation to the validation and test sets. Keep record of all applied transformations. Assignment Writing Service

  3. (c)  Build your model by defining its architecture, and hyperparameters. This includes: loss function, optimiser, batch size, learning rate, and number of epochs. it is recommended that your network has fewer parameters than the number of samples divided by 10. Assignment Writing Service

  4. (d)  Train the neural network and monitor the evolution of the loss values. Assignment Writing Service

4.1 Evaluate model performance on validation set Assignment Writing Service

Assess the model’s performance over the epochs by creating a plot showing the loss value (y-axis) versus the number of epochs (x-axis) for both the training and validation sets. Assignment Writing Service

4.2 Optimise your neural network Assignment Writing Service

Repeat steps c), d), and e) to find the best neural network configura- tion. Assignment Writing Service

Build and train your model on different subsets of climate predictors. You may start with the same set of predictors that achieved the best outcome in the regression task. Assignment Writing Service

4.3 Evaluate your regression model on test set Assignment Writing Service

Applythesametransformationstothetestsetasyoudidtothetraining set. Assignment Writing Service

Use your model to predict SPI on the test set. Assignment Writing Service

Evaluate the performance of your model using sklearn and/or scipy metrics: Assignment Writing Service

In addition to the scripts you wrote for the classification and regression tasks, you need to prepare a script to evaluate your model on new data. The new data will be formatted exactly like Climate SPI.csv, so you can assume Climate SPI.csv is the new data for now. Your script should include all the steps below, along with any additional necessary steps. Assignment Writing Service

5.1 Evaluating your classification model on a new dataset Assignment Writing Service

  1. (a)  Load Climate SPI.csv. Assignment Writing Service

  2. (b)  Calculate ‘Drought’ from ‘SPI’ by setting a threshold of -1 for the ‘SPI’ values, where values below or equal to this threshold indicate drought conditions (i.e. Drought = 1); otherwise, there is no drought (i.e. Drought = 0). Assignment Writing Service

  3. (c)  Apply the same transformations to the new data as you did to the training set in the classification task. Assignment Writing Service

  4. (d)  Load your classification model. Assignment Writing Service

  5. (e)  Use your model to predict the class ‘Drought’ on the new data. Assignment Writing Service

  6. (f)  Compute and plot a confusion matrix. Assignment Writing Service

  7. (g)  Calculate and print “Balanced Accuracy” and “Precision”. Assignment Writing Service

  8. (h)  Print the number of samples and your model’s predictors set. Assignment Writing Service

You must demonstrate a complete understanding of the code and analysis during the discussion. Assignment Writing Service

5.2 Evaluating your regression model on a new dataset Assignment Writing Service

  1. (a)  Load Climate SPI.csv. Assignment Writing Service

  2. (b)  Apply the same transformations to the new data as you did to the Assignment Writing Service

    training set in the regression task. Assignment Writing Service

  3. (c)  Load your regression model. Assignment Writing Service

  4. (d)  Use your model to predict ‘SPI’ on the new data. Assignment Writing Service

  5. (e)  Create a scatter plot to show predicted SPI (y-axis) versus true SPI (x-axis). Assignment Writing Service

  6. (f)  Calculate and print “Mean Absolute Error” and the “Pearson Correla- tion Coefficient” between the true and predicted SPI. Assignment Writing Service

(g) Print the number of samples and your model’s predictors set. Assignment Writing Service

You must demonstrate a complete understanding of the code and anal- ysis during the discussion. Assignment Writing Service

6 Testing and discussing your code Assignment Writing Service

As part of the assignment evaluation, your code will be tested by tutors along with you in a discussion session carried out in the tutorial session. The assignment has a total of 25 marks. The discussion is mandatory and, therefore, we will not mark any assignment not discussed with tutors. Assignment Writing Service

You are expected to propose and build neural models for classification and regression tasks. You will receive marks for each section as shown in Table 2. For marking your results, you should be prepared to simulate your neural model with a generalisation set we have saved apart for that purpose. Assignment Writing Service

You will receive 1 mark for code readability, and your tutor will also give you a maximum of 8 marks for each task depending on the level of code understanding as follows: 8. Outstanding, 6. Great, 4. Fair, 2. Low, 0. Deficient or No answer. Assignment Writing Service

7 Submitting your assignment Assignment Writing Service

The assignment must be done individually. You need to submit your solution on Moodle. Your submission must include: Assignment Writing Service

  • A single Jupyter notebook (.ipynb). Assignment Writing Service

  • The trained models for both the classification task and the regression Assignment Writing Service

    task. Assignment Writing Service

    The first line of your Jupyter notebook should display your full name and your zID as a comment. The notebook should contain all the necessary code for reading files, data preprocessing, network architecture, and result evaluations. Additionally, your file should include short text descriptions to help markers better understand your code. Please be mindful that providing clean and easy-to-read code is a part of your assignment. Assignment Writing Service

    You can submit as many times as you like before the deadline – later submissions overwrite earlier ones. After submitting your file a good practice is to take a screenshot of it for future reference. Assignment Writing Service

Table 2: Marking scheme for the assignment. Assignment Writing Service

Classification Task Assignment Writing Service

Plot of the accuracy (y-axis) versus the number of epochs (x- axis) for both the training and validation sets.
Performance metrics “Balanced Accuracy” and “Precision” cal- culated on the test set.
Assignment Writing Service

Confusion matrix on the unseen data.
“Balanced Accuracy” and “Precision” on the unseen data. Demonstrate complete understanding of the code and analysis during discussion.
Assignment Writing Service

Regression Task Assignment Writing Service

A plot showing the loss value (y-axis) versus the number of epochs (x-axis) for both the training and validation sets. Create a scatter plot showing predicted SPI (y-axis) versus true SPI (x-axis) based on the test set. Assignment Writing Service

“Mean Absolute Error (MAE)” and the “Pearson Correlation Coefficient” between the true and predicted SPI.
A scatter plot showing predicted SPI (y-axis) versus true SPI (x-axis) based on the unseen dataset.
Assignment Writing Service

Demonstrate complete understanding of the code and analysis during discussion. Assignment Writing Service

Code understanding and discussion Assignment Writing Service

Overall code readability including tidy and well-commented script Assignment Writing Service

Total marks Assignment Writing Service

Late submission penalty: UNSW has a standard late submission penalty of 5% per day from your mark, capped at five days from the as- sessment deadline, after that students cannot submit the assignment. Assignment Writing Service

8 Deadline and questions
Deadline: Week 5, Friday 11 October 2024, 5pm. Please use the forum Assignment Writing Service

on Moodle to ask questions related to the assignment. We will prioritise 11 Assignment Writing Service

Assignment Writing Service

questions asked in the forum. However, you should not share your code to avoid making it public and possible plagiarism. If that’s the case, use the course email cs3411@cse.unsw.edu.au as alternative. Assignment Writing Service

Although we try to answer questions as quickly as possible, we might take up to 1 or 2 business days to reply, therefore, last-moment questions might not be answered timely. Assignment Writing Service

For any questions regarding the discussion sessions, please contact directly your tutor. You can have access to your tutor email address through Table 3. Assignment Writing Service


Table 3: COMP3411/9814 24T2 Tutorials Assignment Writing Service

Your program must be entirely your own work. Plagiarism detection software might be used to compare submissions pairwise (including submissions for any similar projects from previous years) and serious penalties will be applied, particularly in the case of repeat offences. Assignment Writing Service

Do not copy from others. Do not allow anyone to see your code. Assignment Writing Service

Please refer to the UNSW Policy on Academic Honesty and Plagiarism if you require further clarification on this matter. Assignment Writing Service

联系辅导老师!
私密保护
WeChat 微信
UNSW代写,COMP3411代写,COMP9814代写,Artificial Intelligence代写,Artificial neural networks代写,Python代写,UNSW代编,COMP3411代编,COMP9814代编,Artificial Intelligence代编,Artificial neural networks代编,Python代编,UNSW代考,COMP3411代考,COMP9814代考,Artificial Intelligence代考,Artificial neural networks代考,Python代考,UNSW代做,COMP3411代做,COMP9814代做,Artificial Intelligence代做,Artificial neural networks代做,Python代做,UNSWhelp,COMP3411help,COMP9814help,Artificial Intelligencehelp,Artificial neural networkshelp,Pythonhelp,UNSW作业代写,COMP3411作业代写,COMP9814作业代写,Artificial Intelligence作业代写,Artificial neural networks作业代写,Python作业代写,UNSW编程代写,COMP3411编程代写,COMP9814编程代写,Artificial Intelligence编程代写,Artificial neural networks编程代写,Python编程代写,UNSW作业答案,COMP3411作业答案,COMP9814作业答案,Artificial Intelligence作业答案,Artificial neural networks作业答案,Python作业答案,