{ "key_pair_value_system": true, "answer_rating_count": "", "question_feedback_html": { "html_star": "", "html_star_feedback": "" }, "answer_average_rating_value": "", "answer_date_js": "2024-09-12T00:04:06-04:00", "answer_date": "2024-09-12 00:04:06", "is_docs_available": "", "is_excel_available": "", "is_pdf_available": "", "count_file_available": 0, "main_page": "student_question_view", "question_id": "10325416", "url": "\/study-help\/questions\/consider-a-binary-classification-problem-of-finding-the-binary-labels-10325416", "question_creation_date_js": "2024-09-12T00:04:06-04:00", "question_creation_date": "Sep 12, 2024 12:04 AM", "meta_title": "[Solved] Consider a binary classification problem | SolutionInn", "meta_description": "Answer of - Consider a binary classification problem of finding the binary labels y in { 1 , 1 } , for input examples of the form | SolutionInn", "meta_keywords": "binary,classification,problem,finding,labels,y,1,input,examples,form,x,times", "question_title_h1": "Consider a binary classification problem of finding the binary labels y in { 1 , 1 } , for input examples of the form x", "question_title": "Consider a binary classification problem of finding the binary labels y in", "question_title_for_js_snippet": "Consider a binary classification problem of finding the binary labels y in 1 , 1 , for input examples of the form x in R d times 1 We will use the following loss function which is based on margin m sy wT x y L ( m , w ) ( 0 5 m 2 for m 0 m Otherwise a For the case of d 2 i e x x 1 x 2 T , find the gradient of loss function wL ( m , w ) w r t unknown weight vector w w 1 w 2 T You may compute w 1 L ( m , w ) , and w 2 L ( m w ) and then stack them into the required gradient vector Please also note the following derivative rule that you may need 6 w f ( w ) f ( w ) f ( w ) w f ( w ) b Now, assume following training data having N 4 examples, is available 4 i Input xi Output yi 1 x 1 0 2 T y 1 1 2 x 2 0 1 T y 2 1 3 x 3 1 0 T y 3 1 4 x 4 1 0 T y 4 1 For the given loss function L ( m , w ) , and given training dataset, write down the average loss in terms of unknown weight vector w w 1 w 2 T as Lavg ( w ) 1 N XN i 1 L ( mi , w ) Compute the gradient vector of average loss Lavg ( w ) i e wLavg ( w ) w r t unknown weight vector w w 1 w 2 T c Starting from an initial weight vector w ( 0 ) 0 0 5 T , run single iteration of gradient descent algorithm to find w ( 1 ) with step size alpha 0 2 2 d Report the classification accuracy on the provided training data if you decide to use w ( 1 ) as your final weights for the model You can assume sign ( ) function as your activation function", "question_description": "
Consider a binary classification problem of finding the binary labels y in <\/span>{<\/mi><\/mi>1<\/mn>,<\/mo><\/mtext>1<\/mn>}<\/mi>,<\/mo><\/mrow><\/math> for input examples of the<\/span> <\/div>
form x in R<\/span><\/div>
d<\/span>\\<\/mi><\/mrow><\/math>times <\/span>1<\/mn><\/mrow><\/math> <\/div>
.<\/mo><\/mrow><\/math> We will use the following loss function which is based on margin m <\/span>=<\/mo><\/mrow><\/math> sy <\/span>=<\/mo><\/mrow><\/math> <\/div>
<\/div>
wT x<\/span><\/div>
<\/div>
y<\/span><\/div>
L<\/span>(<\/mi><\/mrow><\/math>m<\/span>,<\/mo><\/mrow><\/math> w<\/span>)<\/mi><\/mtext>=<\/mo><\/mtext>(<\/mi><\/mrow><\/math> <\/div>
0<\/mn>.<\/mn>5<\/mn><\/mrow><\/math>m<\/span>2<\/mn><\/mrow><\/math> <\/div>
for m <\/span><<\/mo>=<\/mo><\/mtext>0<\/mn><\/mrow><\/math> <\/div>
|<\/mi><\/mrow><\/math>m<\/span>|<\/mi><\/mrow><\/math> Otherwise<\/span> <\/div>
a<\/span>.<\/mo><\/mrow><\/math> For the case of d <\/span>=<\/mo><\/mtext>2<\/mn><\/mrow><\/math> i<\/span>.<\/mo><\/mrow><\/math>e<\/span>.<\/mo><\/mrow><\/math> x <\/span>=<\/mo><\/mtext>[<\/mi><\/mrow><\/math>x<\/span>1<\/mn><\/mrow><\/math> x<\/span>2<\/mn>]<\/mi><\/mrow><\/math> <\/div>
T<\/span><\/div>
,<\/mo><\/mrow><\/math> find the gradient of loss function <\/span><\/mi><\/mrow><\/math>wL<\/span>(<\/mi><\/mrow><\/math>m<\/span>,<\/mo><\/mrow><\/math> w<\/span>)<\/mi><\/mrow><\/math> w<\/span>.<\/mo><\/mrow><\/math>r<\/span>.<\/mo><\/mrow><\/math>t<\/span>.<\/mo><\/mrow><\/math> unknown weight vector<\/span> <\/div>
w <\/span>=<\/mo><\/mtext>[<\/mi><\/mrow><\/math>w<\/span>1<\/mn><\/mrow><\/math> w<\/span>2<\/mn>]<\/mi><\/mrow><\/math> <\/div>
T<\/span><\/div>
.<\/mo><\/mrow><\/math> You may compute <\/span><\/mi><\/mrow><\/math> <\/div>
<\/mi><\/mrow><\/math>w<\/span>1<\/mn><\/mrow><\/math> <\/div>
L<\/span>(<\/mi><\/mrow><\/math>m<\/span>,<\/mo><\/mrow><\/math> w<\/span>)<\/mi>,<\/mo><\/mrow><\/math> and <\/span><\/mi><\/mrow><\/math> <\/div>
<\/mi><\/mrow><\/math>w<\/span>2<\/mn><\/mrow><\/math> <\/div>
L<\/span>(<\/mi><\/mrow><\/math>m<\/span>.<\/mo><\/mrow><\/math>w<\/span>)<\/mi><\/mrow><\/math> and then stack them into the required gradient vector.<\/span> <\/div>
Please also note the following derivative rule that you may need: <\/span>[<\/mi>6<\/mn>]<\/mi><\/mrow><\/math> <\/div>
<\/mi><\/mrow><\/math><\/div>
<\/mi><\/mrow><\/math>w <\/span>|<\/mi><\/mrow><\/math>f<\/span>(<\/mi><\/mrow><\/math>w<\/span>)<\/mi>|<\/mi><\/mtext>=<\/mo><\/mrow><\/math> <\/div>
f<\/span>(<\/mi><\/mrow><\/math>w<\/span>)<\/mi><\/mrow><\/math> <\/div>
|<\/mi><\/mrow><\/math>f<\/span>(<\/mi><\/mrow><\/math>w<\/span>)<\/mi>|<\/mi><\/mrow><\/math> <\/div>
<\/mi><\/mrow><\/math><\/div>
<\/mi><\/mrow><\/math>w f<\/span>(<\/mi><\/mrow><\/math>w<\/span>)<\/mi><\/mrow><\/math> <\/div>
b<\/span>.<\/mo><\/mrow><\/math> Now, assume following training data having N <\/span>=<\/mo><\/mtext>4<\/mn><\/mrow><\/math> examples, is available: <\/span>[<\/mi>4<\/mn>]<\/mi><\/mrow><\/math> <\/div>
i Input: xi Output: yi<\/span><\/div>
1<\/mn><\/mrow><\/math> x<\/span>1<\/mn><\/mtext>=<\/mo><\/mtext>[<\/mi>0<\/mn><\/mtext>2<\/mn>]<\/mi><\/mrow><\/math>T y<\/span>1<\/mn><\/mtext>=<\/mo><\/mtext>1<\/mn><\/mrow><\/math> <\/div>
2<\/mn><\/mrow><\/math> x<\/span>2<\/mn><\/mtext>=<\/mo><\/mtext>[<\/mi>0<\/mn><\/mtext>1<\/mn>]<\/mi><\/mrow><\/math>T y<\/span>2<\/mn><\/mtext>=<\/mo><\/mtext>1<\/mn><\/mrow><\/math> <\/div>
3<\/mn><\/mrow><\/math> x<\/span>3<\/mn><\/mtext>=<\/mo><\/mtext>[<\/mi><\/mi>1<\/mn><\/mtext>0<\/mn>]<\/mi><\/mrow><\/math>T y<\/span>3<\/mn><\/mtext>=<\/mo><\/mtext><\/mi>1<\/mn><\/mrow><\/math> <\/div>
4<\/mn><\/mrow><\/math> x<\/span>4<\/mn><\/mtext>=<\/mo><\/mtext>[<\/mi><\/mi>1<\/mn><\/mtext>0<\/mn>]<\/mi><\/mrow><\/math>T y<\/span>4<\/mn><\/mtext>=<\/mo><\/mtext><\/mi>1<\/mn><\/mrow><\/math> <\/div>
For the given loss function L<\/span>(<\/mi><\/mrow><\/math>m<\/span>,<\/mo><\/mrow><\/math> w<\/span>)<\/mi>,<\/mo><\/mrow><\/math> and given training dataset, write down the average loss in terms of unknown weight vector<\/span> <\/div>
w <\/span>=<\/mo><\/mtext>[<\/mi><\/mrow><\/math>w<\/span>1<\/mn><\/mrow><\/math> w<\/span>2<\/mn>]<\/mi><\/mrow><\/math> <\/div>
T<\/span><\/div>
as<\/span><\/div>
Lavg<\/span>(<\/mi><\/mrow><\/math>w<\/span>)<\/mi><\/mtext>=<\/mo><\/mtext>1<\/mn><\/mrow><\/math> <\/div>
N<\/span><\/div>
XN<\/span><\/div>
i<\/span>=<\/mo>1<\/mn><\/mrow><\/math> <\/div>
L<\/span>(<\/mi><\/mrow><\/math>mi<\/span>,<\/mo><\/mrow><\/math> w<\/span>)<\/mi><\/mrow><\/math> <\/div>
Compute the gradient vector of average loss Lavg<\/span>(<\/mi><\/mrow><\/math>w<\/span>)<\/mi><\/mrow><\/math> i<\/span>.<\/mo><\/mrow><\/math>e<\/span>.<\/mo><\/mtext><\/mi><\/mrow><\/math>wLavg<\/span>(<\/mi><\/mrow><\/math>w<\/span>)<\/mi><\/mrow><\/math> w<\/span>.<\/mo><\/mrow><\/math>r<\/span>.<\/mo><\/mrow><\/math>t<\/span>.<\/mo><\/mrow><\/math> unknown weight vector w <\/span>=<\/mo><\/mtext>[<\/mi><\/mrow><\/math>w<\/span>1<\/mn><\/mrow><\/math> w<\/span>2<\/mn>]<\/mi><\/mrow><\/math> <\/div>
T<\/span><\/div>
.<\/mo><\/mrow><\/math><\/div>
c<\/span>.<\/mo><\/mrow><\/math> Starting from an initial weight vector w<\/span>(<\/mi>0<\/mn>)<\/mi><\/mtext>=<\/mo><\/mtext>[<\/mi>0<\/mn><\/mtext>0<\/mn>.<\/mn>5<\/mn>]<\/mi><\/mrow><\/math>T<\/span> <\/div>
,<\/mo><\/mrow><\/math> run single iteration of gradient descent algorithm to find w<\/span>(<\/mi>1<\/mn>)<\/mi><\/mrow><\/math> with<\/span> <\/div>
step size <\/span>\\<\/mi><\/mrow><\/math>alpha <\/span>=<\/mo><\/mtext>0<\/mn>.<\/mn>2<\/mn><\/mtext>[<\/mi>2<\/mn>]<\/mi><\/mrow><\/math> <\/div>
d<\/span>.<\/mo><\/mrow><\/math> Report the classification accuracy on the provided training data if you decide to use w<\/span>(<\/mi>1<\/mn>)<\/mi><\/mrow><\/math> as your final weights for the model.<\/span> <\/div>
You can assume sign<\/span>(<\/mi>.<\/mo>)<\/mi><\/mrow><\/math> function as your activation function<\/span> <\/div>
<\/div><\/span> <\/div><\/div>", "transcribed_text": "", "related_book": { "title": null, "isbn": null, "edition": null, "authors": null, "cover_image": null, "uri": null, "see_more_uri": "" }, "free_related_book": { "isbn": "", "uri": "", "name": "", "edition": "" }, "question_posted": "2024-09-12 00:04:06", "see_more_questions_link": "\/study-help\/questions\/computer-science-operating-system-2022-August-09", "step_by_step_answer": "The Answer is in the image, click to view ...", "students_also_viewed": [ { "url": "\/study-help\/business-communication-essentials\/this-book-gives-examples-of-occasions-when-youattitude-is-inappropriate-1996869", "description": "This book gives examples of occasions when you-attitude is inappropriate. What are some other examples? Why are they inappropriate? How would you fix them?", "stars": 0 }, { "url": "\/shortly-after-hiring-adams-goodyear-tires-transferred-him-from-houston", "description": "Shortly after hiring Adams, Goodyear Tires transferred him from Houston, which was near his home, to Bryan, Texas, to work on commercial trucks. After the transfer, Adams continued to live in Houston...", "stars": 3 }, { "url": "\/study-help\/questions\/consider-a-binary-classification-problem-of-finding-the-binary-labels-10325416", "description": "Consider a binary classification problem of finding the binary labels y in { 1 , 1 } , for input examples of the form x in R d \\ times 1 . We will use the following loss function which is based on...", "stars": 3 }, { "url": "\/study-help\/questions\/9-natick-ma-and-indianapolis-in-january-25-2006-8110598", "description": "9. Natick, MA and Indianapolis, IN (January 25, 2006) - Boston Scientific Corpora- tion (NYSE: BSX) and Guidant Corporation (NYSE: GDT) today announced that the Board of Directors of Guidant has...", "stars": 3 }, { "url": "\/study-help\/questions\/in-the-deacon-process-for-the-manufacture-of-c12-a-1017348", "description": "In the Deacon process for the manufacture of C12, a dry mixture of HCl and air is passed over a heated catalyst that promotes the oxidation of HCl to Cl2. The Deacon process can be reversed and HCl...", "stars": 3 }, { "url": "\/study-help\/questions\/consider-a-small-population-consisting-of-n-8-students-1024927", "description": "Consider a small population consisting of N = 8 students with the following exam grades: Y, 72, 74, Y-76, Y-77, Y, 81, Y-84, Y, = 85, Y = 91", "stars": 3 }, { "url": "\/study-help\/questions\/4-if-i-get-successful-in-communication-problem-in-my-1056664", "description": "4) If I get successful in communication problem in my office, how will we know? 5) What data will help track our change?", "stars": 3 }, { "url": "\/study-help\/questions\/a-company-identifies-four-market-segments-for-its-product-it-1056874", "description": "A company identifies four market segments for its product. It selects one of these segments and tailors its marketing mix to that group. This single segment is a(n): differentiated product segment....", "stars": 3 }, { "url": "\/study-help\/questions\/what-is-the-theory-population-sample-design-model-and-strengthweakness-1056895", "description": "What is the theory, population, sample, design, model and strength\/weakness of this research? Research article: Estimating the Benefits, Drawbacks and Risk of Digital Transformation Strategy | IEEE...", "stars": 3 } ], "next_back_navigation": { "previous": "\/study-help\/questions\/a-building-that-originally-cost-40000-and-which-was-threefourths-10325415", "next": "\/study-help\/questions\/the-primary-advantage-of-establishing-costs-pools-is-reducing-the-10325417" }, "breadcrumbs": [ { "name": "Study help", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers" }, { "name": "Computer Science", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers\/computer-science" }, { "name": "Databases", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/computer-science-databases" }, { "name": "Consider a binary classification problem of finding the binary labels y in", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/consider-a-binary-classification-problem-of-finding-the-binary-labels-10325416" } ], "skill_details": { "skill_id": "656", "skill_name": "Databases", "parent_id": "8" } } }