代做ECE 219 Large-Scale Data Mining: Models and Algorithms Winter 2025 Project 4代写数据结构语言

ECE 219

Large-Scale Data Mining:  Models and Algorithms

Winter 2025

Project 4: Regression Analysis and Define

Your Own Task!

Due on Mar 14, 2025, 11:59 pm


1    Introduction

Regression analysis is a statistical procedure for estimating the relationship between a target variable and a set of features that jointly inform about the target.  In this project, we explore specific-to-regression feature engineering methods and model selection that jointly improve the performance of regression.  You will conduct different experiments and identify the relative significance of the different options.

2    Datasets

You should take steps in section 3 on either one of the following datasets.

2.1    Dataset 1:  Diamond Characteristics

Valentine’s day might be over, but we are still interested in building a bot to predict the price and characteristics of diamonds. A synthetic diamonds dataset can be downloaded from this link.  This dataset contains information about 150000 round-cut diamonds. There are 14 variables (features) and for each sample, these features specify the various properties of the sample.  Below we describe some of these features:

 carat: weight of the diamond

 cut: quality of the cut

 clarity: measured diamond clarity

 length: measured length in mm

 width: measured width in mm

 depth: measured depth in mm

• depth percent: diamond’s total height divided by it’stotal width

• table percent: width of top of diamond relative to widest point

• gridle min: refers to the thinnest part of the girdle

• gridle max: refers to the thickest part of the girdle

In addition to these features, there is the target variable:  i.e what we would like to predict:

 price: price in US dollars



2.2    Dataset 2: Wine Quality Dataset

Perhaps your interests lean more towards the nuances of wine tasting rather than the than the fascination with diamonds. You can access the dataset through this link. The two datasets are related to red and white variants of the Portuguese ”Vinho Verde” wine. This dataset comprises 4, 898 instances for white wine and 1599 instances for red wine, with 13 features for each instance.

3    Required Steps

In this section, we describe the setup you need to follow.  Follow these steps to process either of the datasets in Section 2.

3.1    Before Training

Before training an algorithm, it’s always essential to inspect the data.   This provides intuition about the quality and quantity of the data and suggests ideas to extract features for downstream ML applications. In this following section we will address these steps.

3.1.1    Handling Categorical Features

A categorical feature is a feature that can take on one of a limited number of possible values.   If one  dataset  contains categorical features,  a preprocessing step needs to be carried to convert categorical variables into numbers and thus prepared for training.

One method for numerical encoding of categorical features is to assign a scalar.  For instance,  if we have a  “Quality”  feature with values  {Poor,  Fair,  Typical,  Good, Excellent} we might replace them with numbers 1 through 5.  If there is no numerical meaning behind categorical features  (e.g.   {Cat,  Dog})  one  has  to  perform.  “one-hot encoding” instead.

3.1.2    Data Inspection

The first step for data analysis is to take a close look at the dataset.

• Plot a heatmap of the Pearson correlation matrix of the dataset columns.  Report which features have the highest absolute correlation with the target variable.  In the context of either dataset, describe what the correlation patterns sug- gest.Question 1.1

• Plot the histogram of numerical features.  What preprocessing can be done if the distribution of a feature has high skewness?  Question 1.2

• Construct and inspect the box plot of categorical features vs target variable. What do you find? Question 1.3

 For the Diamonds dataset, plot the counts by color, cut and clarity. or

• For the wine quality dataset, plot histogram for quality scores. Question 1.4


3.1.3    Standardization

Standardization of datasets is a common requirement for many machine learning esti-

mators; they might behave badly if the individual features do not more-or-less look like standard normally distributed data:  Gaussian with zero mean  and unit variance.  If a feature has a variance that is orders of magnitude larger than others, it might dominate the objective function and make the estimator unable to learn from other features cor- rectly as expected.

Standardize feature columns and prepare them for training. Question 2.1

3.1.4    Feature Selection

• sklearn. feature   selection. mutual   info regression function returns estimated

mutual information between each feature and the label.  Mutual information (MI) between two random variables is a non-negative value which measures the depen- dency between the variables. It is equal to zero if and only if two random variables are independent, and higher values mean higher dependency.

• sklearn. feature   selection . f regression function provides F scores, which is a way of comparing the significance of the improvement of a model, with respect to the addition of new variables.

You **may** use these functions to select features that yield better regression re- sults (especially in the classical models). Describe how this step qualitatively affects the performance of your models in terms of test RMSE. Is it true for all model types?  Also list two features for either dataset that has the lowest MI w.r.t to the target. Question 2.2

From this point on, you are free to use any combination of features,  as long as the performance on the regression model is on par (or slightly worse) than the Neural Network model.

3.2    Training

Once the data is prepared, we would like to train multiple algorithms and compare their performance using average RMSE from 10-fold cross-validation (please refer to part 3.3).

3.3    Evaluation

Perform 10-fold cross-validation and measure average RMSE errors for training and val- idation sets.

For random forest model, measure “Out-of-Bag Error” (OOB) as well.

3.3.1    Linear Regression

What is the objective function?  Train three models:  (a) ordinary least squares  (linear regression without regularization),  (b) Lasso and (c) Ridge regression, and answer the following questions.

• Explain how each regularization scheme affects the learned parameter set.  Ques- tion 4.1


• Report your choice of the best regularization scheme along with the optimal penalty parameter and explain how you computed it. Question 4.2

• Does feature standardization play a role in improving the model performance (in the cases with ridge regularization)? Justify your answer. Question 4.3

• Some linear regression packages return p-values for different features. What is the meaning of these p-values and how can you infer the most significant features?  A qualitative reasoning is sufficient. Question 4.4

3.3.2    Polynomial Regression

Perform polynomial regression by crafting products of features you selected in part 3.1.4 up to a certain degree (max degree 6) and applying ridge regression on the compound features. You can use scikit-learn library to build such features. Avoid overfitting by proper regularization. Answer the following:

 What are the most salient features? Why? Question 5.1

• What degree of polynomial is best?  How did you find the optimal degree?  What does a very high-order polynomial imply about the fit on the training data? What about its performance on testing data? Question 5.2

3.3.3    Neural Network

You will train a multi-layer perceptron (fully connected neural network). You can simply

use the sklearn implementation:

• Adjust your network size (number of hidden neurons and depth), and weight decay as regularization.  Find a good hyper-parameter set systematically  (no more than

20 experiments in total). Question 6.1

• How does the performance generally compare with linear regression? Why? Ques- tion 6.2

• What activation function did you use for the output and why? You may use none. Question 6.3

 What is the risk of increasing the depth of the network too far?  Question 6.4

3.3.4    Random Forest

We will train a random forest regression model on datasets, and answer the following:

 Random forests have the following hyper-parameters:

 Maximum number of features;

 Number of trees;

 Depth of each tree;

Explain how these hyper-parameters affect the overall performance.   Describe  if and how each hyper-parameter results in a regularization effect during training.

Question 7.1



• How do random forests create a highly non-linear decision boundary despite the fact that all we do at each layer is apply a threshold on a feature? Question 7.2

• Randomly pick a tree in your random forest model (with maximum depth of 4) and plot its structure. Which feature is selected for branching at the root node? What can you infer about the importance of this feature as opposed to others?  Do the important features correspond to what you got in part 3.3.1? Question 7.3

• Measure “Out-of-Bag Error” (OOB). Explain what OOB error and R2 score means.

Question 7.4

3.3.5    LightGBM, CatBoost and Bayesian Optimization

Boosted tree methods have shown advantages when dealing with tabular data, and recent advances make these algorithms scalable to large scale data and enable natural treatment of (high-cardinality) categorical features.  Two of the most successful examples are Light- GBM and CatBoost.

Both algorithms have many hyperparameters that influence their performance. This results in large search space of hyperparameters, making the tuning of the hyperparame- ters hard with naive random search and grid search. Therefore, one may want to utilize “smarter” hyperparameter search schemes. We specifically explore one of them:  Bayesian optimization.

In this part, pick either one of the datasets and apply LightGBM OR CatBoost.  If you do both, we will only look at the first one.

• Read the documentation of LightGBM OR CatBoost and determine the important hyperparameters along with a search space for the tuning of these parameters (keep the search space small). Question 8.1

• Apply Bayesian optimization using skopt.BayesSearchCVfrom scikit-optmizeto find the ideal hyperparameter combination in your search space. Keep your search space small enough to finish running on a single Google Colab instance within 60 minutes. Report the best hyperparameter set found and the corresponding RMSE.

Question 8.2

• Qualitatively interpret the effect of the hyperparameters using the Bayesian opti- mization results:  Which of them helps with performance?  Which helps with reg- ularization (shrinks the generalization gap)?  Which affects the fitting efficiency?

Question 8.3




热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图