\documentclass[10pt]{article}

\usepackage{fullpage}
\usepackage{setspace}
\usepackage{parskip}
\usepackage{titlesec}
\usepackage[section]{placeins}
\usepackage{xcolor}
\usepackage{breakcites}
\usepackage{lineno}
\usepackage{hyphenat}





\PassOptionsToPackage{hyphens}{url}
\usepackage[colorlinks = true,
            linkcolor = blue,
            urlcolor  = blue,
            citecolor = blue,
            anchorcolor = blue]{hyperref}
\usepackage{etoolbox}
\makeatletter
\patchcmd\@combinedblfloats{\box\@outputbox}{\unvbox\@outputbox}{}{%
  \errmessage{\noexpand\@combinedblfloats could not be patched}%
}%
\makeatother


\usepackage[round]{natbib}
\let\cite\citep




\renewenvironment{abstract}
  {{\bfseries\noindent{\abstractname}\par\nobreak}\footnotesize}
  {\bigskip}

\titlespacing{\section}{0pt}{*3}{*1}
\titlespacing{\subsection}{0pt}{*2}{*0.5}
\titlespacing{\subsubsection}{0pt}{*1.5}{0pt}


\usepackage{authblk}


\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{latexsym}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{booktabs,array,multirow}
\usepackage{amsfonts,amsmath,amssymb}
\providecommand\citet{\cite}
\providecommand\citep{\cite}
\providecommand\citealt{\cite}
% You can conditionalize code for latexml or normal latex using this.
\newif\iflatexml\latexmlfalse
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}%

\AtBeginDocument{\DeclareGraphicsExtensions{.pdf,.PDF,.eps,.EPS,.png,.PNG,.tif,.TIF,.jpg,.JPG,.jpeg,.JPEG}}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}










\begin{document}

\title{Machine Learning HW2 Programming assignment}



\author[1]{Gur Asees Singh Chandok}%
\affil[1]{Boston University}%


\vspace{-1em}



  
  \date{May 08, 2024}


\begingroup
\let\center\flushleft
\let\endcenter\endflushleft
\maketitle
\endgroup








\sloppy


\section*{2.}

{\label{374577}}

\section*{a. Linear Regression:}

{\label{374577}}\par\null

This Problem was solved using matlab and the code for the solution is
present in file~\textbf{hw2part2a.m.}

\par\null

\textbf{Below derivation was used for getting to the formula for
calculating the least squares}

\par\null\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=1.00\columnwidth]{figures/New-Doc-2018-02-24-1/New-Doc-2018-02-24-1}
\caption{{Derivation for computing sum of squares function using Matrix method
{\label{435982}}%
}}
\end{center}
\end{figure}

\par\null

In the code~\(R=I,\ \phi\rightarrow X\ ,t\rightarrow y\ and\ w^{\ast}\ \rightarrow weights\). Also,comments are present before each
line of code to make it easy to understand.The output of the code is the
best choice for 3rd variable.The program would can be used with
different data provided the column names are same.However, even if the
column names are different the program should give the right index for
the best new variable but the label would be incorrect.

\par\null

Each variable was tested as a prospective 3rd variable and~In addition
to finding~ least squares, R2 score was used to choose the variable.

R2

\par\null

Using this method the variable \textbf{`LIC' i.e. 4th column} was chosen
as it had the \textbf{best R2 score( coefficient of determination) and
least squares.}

\textbf{This can be also be seen in the plot below, the plot shows the
R2 score after choosing each variable as 3rd variable on y axis against
variable name on the x axis.}

\par\null\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=1.00\columnwidth]{figures/untitled/untitled}
\caption{{Improvement in R2 score after choosing each variable as variable 3
{\label{168036}}%
}}
\end{center}
\end{figure}

\par\null

\textbf{~}

\subsection*{Clearly,~LIC~has the best R2 score after selection as the
3rd variable and therefore it was chosen as the 3rd
variable}\label{clearlylichas-the-best-r2-score-after-selection-as-the-3rd-variable-and-therefore-it-was-chosen-as-the-3rd-variable}

\textbf{}

\selectlanguage{english}
\FloatBarrier
\end{document}

