Academic Writing Experts For Your Research Projects

Order custom papers, masters thesis and dissertation in 3 guided steps; human written!

Posted: February 26th, 2022

Artificial Intelligence

ECE 8550: Assignment 1

1 Linear regression

Who Writes College Essays, Research Papers, and Dissertations For Students?

We handpick every writer with care, ensuring they bring the perfect mix of academic qualifications and writing skills for top-notch results in essays, research papers, and dissertation help. Each one has a university degree, more than a third with Masters certification; they’ve tackled tough tests and training to excel in thesis writing and research paper assignments at any time. They’ll team up with you diligently, keeping things easy and stress-free as they relate to being immediate students. That’s what makes us the best assignment help website for "help me write my essay, research paper, or dissertation" for college coursework. Trust our team—professional research essay writers and editors—to deliver your dissertation or thesis writing within your grading criteria and deadline.

In this section, you will implement linear regression to predict the death rate from several features, including annual precipitation, temperature, population, income, pollution, etc. The data for this assignment is given in file data.txt, which contains the data description, 17 columns (features) and 60 rows (examples). In the data matrix, columns 2-16 are input features, and column 17 is the output target. Note that Column 1 is the index and should not be used in the regression. You will implement gradient descent for learning the linear regression model.

We split the data to a training set and a testing set following the 80/20 rule. Thus, we have 48 training samples (n = 48) with 16 features (d = 16). The i-th sample is denoted by xi where x

j i is the value of the j-th feature this sample.

1.1 Feature normalization

Do You Offer Thesis Writing and Dissertation Help In Any Citation Style?

No matter what citation style you need for your research paper or dissertation, our skilled writers have you covered! We provide thesis writing and dissertation help in formats like APA, AMA, MLA, Turabian, Harvard, IEEE, and more. We’re dedicated to customizing your order to the exact guidelines of your chosen style, ensuring it fits your unique academic needs—whether it’s a dissertation, research paper, or essay for a specific course. We’ve got the flexibility to make it work for you!

By looking at the feature values in the data, you may notice that some features are about 1000 times the other features. When features differ by orders of magnitude, first performing feature normalization can make gradient descent converge much more quickly. There are different ways to do the feature normalization. For simplicity, we use the following method: (1) subtract the minimal value of each feature; (2) divide the feature values by their ranges of values. Equivalently, it is given by the following equation:

for each X, let Xnorm = X −Xmin

Can I Change Instructions for Dissertation Help or Thesis Writing After Ordering?

You can absolutely reach out to your academic writer using our simple, user-friendly chat feature. It’s there so you can add details, clarify instructions, or tweak adjustments for editing your research paper or dissertation according to your grading rubric—even after you’ve submitted "help me with thesis writing or dissertation help" and they’ve started working on your project.

Xmax −Xmin

Similarly normalize the target Y . Note that to make prediction for a new data point, you also need to first normalize the features as what you did previously for the training dataset.

1

1.2 Feature appending

Classic regression is defined as

f(xi) = w · xi + b = d∑

j=1

wj ×xji + b,

where bi is the intercept. For simplicity, we let b = w d+1 ×xd+1i where x

d+1 i = 1 and w

d+1 is unknown but learnable parameter. Thus, we can combine w and b via letting

w ←[w1, w2, w3, . . . ,wd,wd+1]T ; xi ←[x1i , x

2 i , x

3 i , . . . , x

d i , 1]

T .

1.3 Gradient descent with ridge regularization

To recap, the prediction function for linear regression is given by

f(xi) = w · xi = wT xi = d+1∑ j=1

wj ×xji, (1)

where

• xi is the feature vecter of the i-th sample;

• xji is the value of the j-th feature for the i-th sample;

• wj is the j-th parameter of w;

The loss function for linear regression with ridge regularization is given by

J(w) = 1

2n

n∑ i=1

(f(xi) −yi) 2

+ λ

2(d + 1)

d+1∑ j=1

(wj)2. (2)

To minimize this function, we first obtain the gradient with respect to each parameter wj as:

∂J(w)

∂wj =

1

n

n∑ i=1

(f(xi) −yi) x j i +

λ

d + 1 wj. (3)

Then, the (full) gradient descent algorithm is given as:

where α is the learning rate. The convergence criteria for the above algorithm is ∆%cost < �, where

∆%cost = |Jk−1(w) −Jk(w)|× 100

Jk−1(w) ,

2

Algorithm 1: Batch Gradient Descent

k = 0; while convergence criteria not reached do

for j = 1, . . . ,m do

Update wj ← wj −α∂J(w) ∂wj

Update k ← k + 1;

where Jk(w) is the value of Eq. (2) at k-th iteration, and ∆%cost is computed at the end of each iteration of the while loop. Initialize w = 0 and compute J0(w) with these values.

Important: You must simultaneously update wj for all j.

Task: Load the dataset in data.txt, split it into 80% / 20% training/test. The dataset is already shuffled so you can simply use the first 80% examples for training and the remaining 20% for test. Learn the linear regression model using the training data. Plot the value of loss function Jk(w) vs. the number of iterations (k). For each iteration, compute the mean squared loss (w/o regularization function) on the test data. Plot the mean squared loss over the test data v.s. the number of iterations (k) in the same figure. The mean squared loss is defined as

MSE = 1

2m

m∑ i=1

[yi −w · xi] 2 .

1.4 Gradient descent with lasso regularization

The loss function for linear regression with lasso regularization is given by

J(w) = 1

2n

n∑ i=1

(yi −f(xi)) 2

+ λ

2(d + 1)

d+1∑ j=1

|wj|. (4)

To minimize the loss function, you will need to derive the gradient by yourself. The gradient descent algorithm is the same as the above.

Hint: For simplicity, you can consider ∂|wj| wj

= 1 when wj = 0.

Task: Load the dataset in data.txt, split it into 80% / 20% training/test,. Learn the lasso regression model using the training data. Plot the value of loss function Jk(w) vs. the number of iterations (k). Plot the mean squared loss over the test data v.s. the number of iterations (k) in the same figure.

3

1.5 What to submit

In this assignment, use α = 0.01 and � = 0.001. Use λ = 2 for ridge regularization, and use λ = 0.3 for lasso regularization.

1. (50 pts) The source code (.py) without running errors in Anaconda 2021.11 (Python 3.9).

2. (20 pts) Plot the value of loss function Jk(w) and MSE vs. the number of iterations (k) for Section 1.2, report the squared loss on the test data for Section 1.3.

3. (10 pts) The number of elements in w whose absoluate value is smaller than 0.01 for Section 1.3.

4. (10 pts) Equation for the gradient of Eq. (4) which should be similar to Eq. 3.

5. (10 pts) Plot the value of loss function Jk(w) and MSE vs. the number of iterations (k) for Section 1.3, report the squared loss on the test data for Section 1.4.

6. (10 pts) The number of elements in w whose absoluate value is smaller than 0.01 for Section 1.4.

1.6 Requirements

1. This assignment is implemented using Python in Anaconda 2021.11 (Python 3.9).

2. No libraries are allowed except Python built-ins, numpy, and matplotlib.

3. Figures, equations, and numbers should be in a PDF file.

4. Zip the Python source code (.py) and your PDF file before uploading.

4

----

Assignment 1 for ECE 8550

1 Regression Linear

In this section, you will use linear regression to forecast the death rate based on a variety of factors such as annual precipitation, temperature, population, wealth, pollution, and so on. This assignment's data is contained in the file data.txt, which comprises the data description, 17 columns (features), and 60 rows (examples). Columns 2-16 of the data matrix are input features, while column 17 is the output target. It is important to note that Column 1 is the index and should not be used in the regression. For learning the linear regression model, you will use gradient descent.

We divided the data into two sets, one for training and one for testing, using the 80/20 approach. As a result, there are 48 training examples (n = 48) with 16 features (d = 16). The

Tags: write my history essay for me, psychology assignment topics, online nursing papers, online nursing essay writing service, nursing assignment writers, nursing assignment help canada

Why choose Homework Ace Tutors

You Want Quality and That’s What We Deliver

Top Academic Writers

We’ve put together our writing team with care, choosing talented writers who shine in their fields. Each one goes through a tough selection process, where we look for folks with deep expertise in specific subjects and a solid history of academic writing. They bring their own mix of know-how and flair to the table, making sure our content hits the mark—packed with info, easy to read, and perfect for college students like you.

College Prices

We don’t do AI-written essays or copycat work—everything’s original. Competitive pricing is a big deal for us; we keep costs fair while delivering top-notch quality. Our writers are some of the best out there, and we charge rates that stack up well against other services. This means you get stellar content without draining your wallet. Our pricing is straightforward and honest, built to give you real value for your money. That’s why students turn to us for high-quality writing services that won’t break the bank.

100% Plagiarism-Free

Academic integrity is at the heart of what we do. Every paper starts from scratch, with original research and writing tailored just for you. We write 100% authentic—no plagiarism research essays. Our strict quality control process includes scanning every draft with top tools like SafeAssign and Turnitin, so you get a similarity score and proof of originality. We’re obsessive about proper citation and referencing too, crediting every source to keep things legit. It’s all about giving you peace of mind with content that meets the highest standards.

How it works

When you decide to place an order with Dissertation Writer, here is what happens:

Complete the Order Form

You will complete our order form, filling in all of the fields and giving us as much detail as possible.

Assignment of Writer

We analyze your order and match it with a writer who has the unique qualifications to complete it, and he begins from scratch.

Order in Production and Delivered

You and your writer communicate directly during the process, and, once you receive the final draft, you either approve it or ask for revisions.

Giving us Feedback (and other options)

We want to know how your experience went and the marking criteria grade you scored. You can leave a review recommending a writer for your class and course mates.