代做41040 Introduction to Artificial Intelligence - Spring 2025 Lab 4代写留学生R程序
- 首页 >> Java编程
Lab 4. Learning Algorithms for Solving Classification and Regression Problems
Aims: This lab provides an opportunity for you to exercise five selected learning algorithms, i.e., decision tree learning, random forest learning, support vector machine learning, linear regression/logistic regression and k-nearest neighbours learning, to solve a simple classification problem and a simple regression problem.
Tasks:
Task 0. Download the Lab 4 solution template package and unpack the files to your lab 4 folder. Pay attention to the two datasets used:
Dataset 1: Dataset for a classification problem
For the classification problem, the dataset is from the Iris Plants Database at https://gist.github.com/curran/a08a1080b88344b0c8a7
Note: You can go to the page from the given link, find iris.csv and download the csv file from “Raw”.
Relevant Information about this dataset: --- This is perhaps the best-known database to be found in the pattern recognition literature. The data set contains 3 classes of 50 instances each, where each class refers to a type of iris plant. One class is linearly separable from the other 2; the latter are NOT linearly separable from each other.
--- Predicted attribute: class of iris plant.
--- This is an exceedingly simple domain.
--- Number of Instances: 150 (50 in each of three classes)
--- Number of Attributes: 4 numeric, predictive attributes and the class
--- Attribute Information:
• sepal length in cm
• sepal width in cm
• petal length in cm
• petal width in cm
• class: Iris Setosa, Iris Versicolour and Iris Virginica
Dataset 2: Dataset for a regression problem
For the regression problem, a HousePrice dataset is used, which can be found from https://gist.github.com/grantbrown/5853625
Note: You can go to the page from the given link, find HousingData.csv and download the csv file from “Raw”.
Information about this dataset: This dataset contains 429 items, where each item refers to a house. It has three columns as listed below:
1. HouseAge in year
2. HouseSize in m^2
3. HousePrice in $
The input features are `HouseAge` and `HouseSize` and the attribute to be predicted or target attribute/variable is `HousePrice`.
Task 1. Apply the five algorithms to solve the classification problem
Step 1.1 Open the classifier solution template file “Lab4_classifier_tasks_student_task.ipynb”
Step 1.2 Learn how to load a data csv file from the Demo given by the tutor.
Step 1.3 Fill up the blanks with "Add your code here" in the Section 1 in the classifier solution template notebook:
Step 1.4 Learn how to define the train, validation and test datasets and how to separate two samples from the test dataset as the future samples from the Demo given by the tutor.
Step 1.5 Fill up the blanks with "Add your code here" in the Section 2 in the classifier solution template notebook.
Step 1.6 Learn how to explore a dataset in Section 3 from the Demo given by the tutor.
Step 1.7 Learn how to define a learning model from the Demo given by the tutor.
Step 1.8 Fill up the blanks with "Add your code here" in Section 4 in the classifier template notebook
Step 1.9 Learn how to train a learning model using the train dataset, how to tune hyperparameters using a validation dataset in Section 4 from the Demo given by the tutor.
Step 1.10 Learn how to evaluate a learning model using unseen test dataset from the Demo given by the tutor.
Step 1.11 Fill up the blanks with "Add your code here" in Section 5 in the template notebook
Step 1.12 Learn how to apply a learning model to predict the output of given new data samples from the Demo given by the tutor.
Step 1.13 Fill up the blanks with "Add your code here" in Section 6 in the template notebook
Task 2. Apply the five algorithms to solve the regression problem
Step 2.1 Open the regressor solution template file “Lab4_Regressor_tasks_student_task.ipynb”
Step 2.2 Learn how to load a data csv file from the Demo given by the tutor.
Step 2.3 Fill up the blanks with "Add your code here" in the Section 1 in the classifier solution template notebook:
Step 2.4 Learn how to define the train and test datasets and how to separate two samples from the test dataset as the future samples from the Demo given by the tutor.
Step 2.5 Fill up the blanks with "Add your code here" in the Section 2 in the classifier solution template notebook.
Step 2.6 Learn how to explore a dataset from the Demo given by the tutor.
Step 2.7 Learn how to train a learning model from the Demo given by the tutor.
Step 2.8 Fill up the blanks with "Add your code here" in Section 4 in the classifier template notebook
Step 2.9 Learn how to evaluate a learning model from the Demo given by the tutor.
Step 2.10 Fill up the blanks with "Add your code here" in Section 5 in the template notebook
Step 2.11 Learn how to apply a learning model to predict the output of given new data samples from the Demo given by the tutor.
Step 2.12 Fill up the blanks with "Add your code here" in Section 6 in the template notebook