<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://btechwiki.duckdns.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=66.134.54.86</id>
	<title>Bitnami MediaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://btechwiki.duckdns.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=66.134.54.86"/>
	<link rel="alternate" type="text/html" href="https://btechwiki.duckdns.org/wiki/Special:Contributions/66.134.54.86"/>
	<updated>2026-12-03T13:34:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=175</id>
		<title>Linear Methods</title>
		<link rel="alternate" type="text/html" href="https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=175"/>
		<updated>2021-02-07T00:36:01Z</updated>

		<summary type="html">&lt;p&gt;66.134.54.86: /* Linear Regression */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Metrics===&lt;br /&gt;
Primary purpose is to minimize some error metric:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{RMSE(}\textbf{X}\textit{,h}) = \sqrt{\dfrac{1}{m} \sum^m_{i=1}(h(\textbf{x}^{(i)} - y^{(i)})^2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{MAE(}\textbf{X}\textit{,h}) = \dfrac{1}{m}\sum^m_{i=1} | h(\textbf{x}^{(i)} - y^{(i)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RMSE gives the Euclidean norm, &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt;. MAE gives the Manhattan norm, &amp;lt;math&amp;gt;\ell_1&amp;lt;/math&amp;gt;. A higher norm index overweights large values relative to small ones. This makes RMSE more sensitive to outliers than MAE. In general, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\|\textbf{v}\|_k = (|v_0|^k + |v_1|^k + \dots + |v_n|^k)^{1/k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linear Regression===&lt;br /&gt;
::&amp;lt;math&amp;gt;\hat{y} = \theta_0 + \theta_1x_1 + \theta_2x_2 + \cdots + \theta_nx_n = h_\theta(\textbf{x}) = \boldsymbol{\theta} \cdot \textbf{x} &amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{\theta}&amp;lt;/math&amp;gt; is the parameter vector. The bias term is &amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt; and the feature weights are the &amp;lt;math&amp;gt;\theta_1 \dots \theta_n&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\textbf{x}&amp;lt;/math&amp;gt; is the feature vector of &amp;lt;math&amp;gt;x_0 \dots x_n&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;x_0 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\boldsymbol{\theta}\cdot \mathbf{x}&amp;lt;/math&amp;gt; is the dot product of feature weights and features&lt;br /&gt;
* Solve using the normal equation:&lt;br /&gt;
:: &amp;lt;math&amp;gt; \boldsymbol{\hat{\theta}} = (\mathbf{X}^T\mathbf{X})^{-1} \,\mathbf{X}^T\,\mathbf{y}&amp;lt;/math&amp;gt;&lt;br /&gt;
; Performance Metrics&lt;br /&gt;
* &amp;lt;math&amp;gt;R^2 = 1 - \dfrac{SS_\text{res}}{SS_\text{tot}} &amp;lt;/math&amp;gt;, where&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = \displaystyle\sum_i (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{res} = \displaystyle\sum_i e_i^2 = \sum(y_i - \hat{y}_i)^2 &amp;lt;/math&amp;gt;, and&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{reg} = \displaystyle\sum_i (\hat{y}_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = SS_\text{reg} + SS_\text{res}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;F = \dfrac{\left(\dfrac{\text{RSS}_1-\text{RSS}_2}{p_2-p_1}\right)}{\left(\dfrac{\text{RSS}_2}{n-p_2}\right)} &amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\text{Adj} R^2 = 1 - (1-R^2)\dfrac{n-1}{n-p-1} &amp;lt;/math&amp;gt; with p independent variables and n observations. &lt;br /&gt;
* &amp;lt;math&amp;gt;\rho_{\hat{\alpha},\hat{\beta}}  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Confusingly, the literature also uses ESS (explained sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{reg}&amp;lt;/math&amp;gt; and RSS (Residual sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{res}&amp;lt;/math&amp;gt;. In addition, for the formulae above the acronyms SST (total), SSE (errors/residuals) and SSR (regression) are also in use.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! name 1&lt;br /&gt;
! name 2&lt;br /&gt;
! formula&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| TSS&amp;lt;br /&amp;gt;Total sum of squares&lt;br /&gt;
| SST&amp;lt;br /&amp;gt;Sum of squares, total&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| ESS&amp;lt;br /&amp;gt;Explained sum of squares&lt;br /&gt;
| SSR&amp;lt;br /&amp;gt;Sum of squares, regression&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (\hat{y}_i-\bar{y}_i)^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| predicted vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| RSS&amp;lt;br /&amp;gt;Residual sum of squares&lt;br /&gt;
| SSE&amp;lt;br /&amp;gt;Sum of squared errors&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\hat{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. predicted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logistic Regression===&lt;br /&gt;
Logistic regression, unlike linear regression, is more of a classifier. It generates probabilities rather than scalar estimates. &lt;br /&gt;
Some terminology:&lt;br /&gt;
* The '''logit''' function or log-odds is the log of the odds p/(1-p):&lt;br /&gt;
::&amp;lt;math&amp;gt;\log \left(\dfrac{p}{1-p} \right) = \log(p) - \log(1-p) &amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''sigmoid function''' is &lt;br /&gt;
::&amp;lt;math&amp;gt; \sigma(x) = \dfrac{1}{1+e^{-x}}&amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''logistic''' function:&lt;br /&gt;
::&amp;lt;math&amp;gt; P(Y=1|X) = \dfrac{\exp({\beta_0+\beta_1x})}{\exp({\beta_0+\beta_1x}+1)} &amp;lt;/math&amp;gt;&lt;br /&gt;
* Unlike linear regression which uses OLS to determine coefficients, logistic regression uses the '''maximum likelihood''' method:&lt;br /&gt;
::&amp;lt;math&amp;gt; \ell(\beta_0, \beta_1) = \displaystyle \prod_{i:y_i=1} p(x_i) \prod_{i':y'_i=0} (1-p(x'_i))&amp;lt;/math&amp;gt;&lt;br /&gt;
* Measures of goodness of fit include AIC, null and residual deviance, and the confusion matrix&lt;br /&gt;
:AIC (Akaike Information Criterion): &amp;lt;math&amp;gt; \textrm{AIC} = 2k - 2\ln(\hat{L})&amp;lt;/math&amp;gt;&lt;br /&gt;
:Null and Residual Deviance:&lt;br /&gt;
:Confusion Matrix. Here is some Python code that explains it compactly:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
def deconfuse(tn, fp, fn, tp):&lt;br /&gt;
    print('Precision:', tp/(tp+fp))&lt;br /&gt;
    print('Recall (TPR):', tp/(tp+fn))&lt;br /&gt;
    print('Specificity (TNR):', tn/(tn+fp))&lt;br /&gt;
    print('Accuracy:', (tp+tn)/(tp+tn+fp+fn))&lt;br /&gt;
    print('F1-score:', tp/(tp+(fn+fp)/2))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>66.134.54.86</name></author>
	</entry>
	<entry>
		<id>https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=174</id>
		<title>Linear Methods</title>
		<link rel="alternate" type="text/html" href="https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=174"/>
		<updated>2021-02-07T00:33:45Z</updated>

		<summary type="html">&lt;p&gt;66.134.54.86: /* Linear Regression */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Metrics===&lt;br /&gt;
Primary purpose is to minimize some error metric:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{RMSE(}\textbf{X}\textit{,h}) = \sqrt{\dfrac{1}{m} \sum^m_{i=1}(h(\textbf{x}^{(i)} - y^{(i)})^2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{MAE(}\textbf{X}\textit{,h}) = \dfrac{1}{m}\sum^m_{i=1} | h(\textbf{x}^{(i)} - y^{(i)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RMSE gives the Euclidean norm, &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt;. MAE gives the Manhattan norm, &amp;lt;math&amp;gt;\ell_1&amp;lt;/math&amp;gt;. A higher norm index overweights large values relative to small ones. This makes RMSE more sensitive to outliers than MAE. In general, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\|\textbf{v}\|_k = (|v_0|^k + |v_1|^k + \dots + |v_n|^k)^{1/k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linear Regression===&lt;br /&gt;
::&amp;lt;math&amp;gt;\hat{y} = \theta_0 + \theta_1x_1 + \theta_2x_2 + \cdots + \theta_nx_n = h_\theta(\textbf{x}) = \boldsymbol{\theta} \cdot \textbf{x} &amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{\theta}&amp;lt;/math&amp;gt; is the parameter vector. The bias term is &amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt; and the feature weights are the &amp;lt;math&amp;gt;\theta_1 \dots \theta_n&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\textbf{x}&amp;lt;/math&amp;gt; is the feature vector of &amp;lt;math&amp;gt;x_0 \dots x_n&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;x_0 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\boldsymbol{\theta}\cdot \mathbf{x}&amp;lt;/math&amp;gt; is the dot product of feature weights and features&lt;br /&gt;
* Solve using the normal equation:&lt;br /&gt;
:: &amp;lt;math&amp;gt; \boldsymbol{\hat{\theta}} = (\mathbf{X}^T\mathbf{X})^{-1} \,\mathbf{X}^T\,\mathbf{y}&amp;lt;/math&amp;gt;&lt;br /&gt;
; Performance Metrics&lt;br /&gt;
* &amp;lt;math&amp;gt;R^2 = 1 - \dfrac{SS_\text{res}}{SS_\text{tot}} &amp;lt;/math&amp;gt;, where&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = \displaystyle\sum_i (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{res} = \displaystyle\sum_i e_i^2 = \sum(y_i - \hat{y}_i)^2 &amp;lt;/math&amp;gt;, and&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{reg} = \displaystyle\sum_i (\hat{y}_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = SS_\text{reg} + SS_\text{res}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;F = \dfrac{\left(\dfrac{\text{RSS}_1-\text{RSS}_2}{p_2-p_1}\right)}{\left(\dfrac{\text{RSS}_2}{n-p_2}\right)} &amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\text{Adj} R^2 = 1 - (1-R^2)\dfrac{n-1}{n-p-1} &amp;lt;/math&amp;gt; with p independent variables and n observations. &lt;br /&gt;
&lt;br /&gt;
Confusingly, the literature also uses ESS (explained sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{reg}&amp;lt;/math&amp;gt; and RSS (Residual sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{res}&amp;lt;/math&amp;gt;. In addition, for the formulae above the acronyms SST (total), SSE (errors/residuals) and SSR (regression) are also in use.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! name 1&lt;br /&gt;
! name 2&lt;br /&gt;
! formula&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| TSS&amp;lt;br /&amp;gt;Total sum of squares&lt;br /&gt;
| SST&amp;lt;br /&amp;gt;Sum of squares, total&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| ESS&amp;lt;br /&amp;gt;Explained sum of squares&lt;br /&gt;
| SSR&amp;lt;br /&amp;gt;Sum of squares, regression&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (\hat{y}_i-\bar{y}_i)^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| predicted vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| RSS&amp;lt;br /&amp;gt;Residual sum of squares&lt;br /&gt;
| SSE&amp;lt;br /&amp;gt;Sum of squared errors&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\hat{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. predicted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logistic Regression===&lt;br /&gt;
Logistic regression, unlike linear regression, is more of a classifier. It generates probabilities rather than scalar estimates. &lt;br /&gt;
Some terminology:&lt;br /&gt;
* The '''logit''' function or log-odds is the log of the odds p/(1-p):&lt;br /&gt;
::&amp;lt;math&amp;gt;\log \left(\dfrac{p}{1-p} \right) = \log(p) - \log(1-p) &amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''sigmoid function''' is &lt;br /&gt;
::&amp;lt;math&amp;gt; \sigma(x) = \dfrac{1}{1+e^{-x}}&amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''logistic''' function:&lt;br /&gt;
::&amp;lt;math&amp;gt; P(Y=1|X) = \dfrac{\exp({\beta_0+\beta_1x})}{\exp({\beta_0+\beta_1x}+1)} &amp;lt;/math&amp;gt;&lt;br /&gt;
* Unlike linear regression which uses OLS to determine coefficients, logistic regression uses the '''maximum likelihood''' method:&lt;br /&gt;
::&amp;lt;math&amp;gt; \ell(\beta_0, \beta_1) = \displaystyle \prod_{i:y_i=1} p(x_i) \prod_{i':y'_i=0} (1-p(x'_i))&amp;lt;/math&amp;gt;&lt;br /&gt;
* Measures of goodness of fit include AIC, null and residual deviance, and the confusion matrix&lt;br /&gt;
:AIC (Akaike Information Criterion): &amp;lt;math&amp;gt; \textrm{AIC} = 2k - 2\ln(\hat{L})&amp;lt;/math&amp;gt;&lt;br /&gt;
:Null and Residual Deviance:&lt;br /&gt;
:Confusion Matrix. Here is some Python code that explains it compactly:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
def deconfuse(tn, fp, fn, tp):&lt;br /&gt;
    print('Precision:', tp/(tp+fp))&lt;br /&gt;
    print('Recall (TPR):', tp/(tp+fn))&lt;br /&gt;
    print('Specificity (TNR):', tn/(tn+fp))&lt;br /&gt;
    print('Accuracy:', (tp+tn)/(tp+tn+fp+fn))&lt;br /&gt;
    print('F1-score:', tp/(tp+(fn+fp)/2))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>66.134.54.86</name></author>
	</entry>
	<entry>
		<id>https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=173</id>
		<title>Linear Methods</title>
		<link rel="alternate" type="text/html" href="https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=173"/>
		<updated>2021-02-07T00:28:19Z</updated>

		<summary type="html">&lt;p&gt;66.134.54.86: /* Linear Regression */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Metrics===&lt;br /&gt;
Primary purpose is to minimize some error metric:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{RMSE(}\textbf{X}\textit{,h}) = \sqrt{\dfrac{1}{m} \sum^m_{i=1}(h(\textbf{x}^{(i)} - y^{(i)})^2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{MAE(}\textbf{X}\textit{,h}) = \dfrac{1}{m}\sum^m_{i=1} | h(\textbf{x}^{(i)} - y^{(i)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RMSE gives the Euclidean norm, &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt;. MAE gives the Manhattan norm, &amp;lt;math&amp;gt;\ell_1&amp;lt;/math&amp;gt;. A higher norm index overweights large values relative to small ones. This makes RMSE more sensitive to outliers than MAE. In general, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\|\textbf{v}\|_k = (|v_0|^k + |v_1|^k + \dots + |v_n|^k)^{1/k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linear Regression===&lt;br /&gt;
::&amp;lt;math&amp;gt;\hat{y} = \theta_0 + \theta_1x_1 + \theta_2x_2 + \cdots + \theta_nx_n = h_\theta(\textbf{x}) = \boldsymbol{\theta} \cdot \textbf{x} &amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{\theta}&amp;lt;/math&amp;gt; is the parameter vector. The bias term is &amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt; and the feature weights are the &amp;lt;math&amp;gt;\theta_1 \dots \theta_n&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\textbf{x}&amp;lt;/math&amp;gt; is the feature vector of &amp;lt;math&amp;gt;x_0 \dots x_n&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;x_0 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\boldsymbol{\theta}\cdot \mathbf{x}&amp;lt;/math&amp;gt; is the dot product of feature weights and features&lt;br /&gt;
* Solve using the normal equation:&lt;br /&gt;
:: &amp;lt;math&amp;gt; \boldsymbol{\hat{\theta}} = (\mathbf{X}^T\mathbf{X})^{-1} \,\mathbf{X}^T\,\mathbf{y}&amp;lt;/math&amp;gt;&lt;br /&gt;
; Performance Metrics&lt;br /&gt;
* &amp;lt;math&amp;gt;R^2 = 1 - \dfrac{SS_\text{res}}{SS_\text{tot}} &amp;lt;/math&amp;gt;, where&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = \displaystyle\sum_i (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{res} = \displaystyle\sum_i e_i^2 = \sum(y_i - \hat{y}_i)^2 &amp;lt;/math&amp;gt;, and&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{reg} = \displaystyle\sum_i (\hat{y}_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = SS_\text{reg} + SS_\text{res}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;F = \dfrac{\left(\dfrac{\text{RSS}_1-\text{RSS}_2}{p_2-p_1}\right)}{\left(\dfrac{\text{RSS}_2}{n-p_2}\right)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Confusingly, the literature also uses ESS (explained sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{reg}&amp;lt;/math&amp;gt; and RSS (Residual sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{res}&amp;lt;/math&amp;gt;. In addition, for the formulae above the acronyms SST (total), SSE (errors/residuals) and SSR (regression) are also in use.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! name 1&lt;br /&gt;
! name 2&lt;br /&gt;
! formula&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| TSS&amp;lt;br /&amp;gt;Total sum of squares&lt;br /&gt;
| SST&amp;lt;br /&amp;gt;Sum of squares, total&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| ESS&amp;lt;br /&amp;gt;Explained sum of squares&lt;br /&gt;
| SSR&amp;lt;br /&amp;gt;Sum of squares, regression&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (\hat{y}_i-\bar{y}_i)^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| predicted vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| RSS&amp;lt;br /&amp;gt;Residual sum of squares&lt;br /&gt;
| SSE&amp;lt;br /&amp;gt;Sum of squared errors&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\hat{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. predicted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logistic Regression===&lt;br /&gt;
Logistic regression, unlike linear regression, is more of a classifier. It generates probabilities rather than scalar estimates. &lt;br /&gt;
Some terminology:&lt;br /&gt;
* The '''logit''' function or log-odds is the log of the odds p/(1-p):&lt;br /&gt;
::&amp;lt;math&amp;gt;\log \left(\dfrac{p}{1-p} \right) = \log(p) - \log(1-p) &amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''sigmoid function''' is &lt;br /&gt;
::&amp;lt;math&amp;gt; \sigma(x) = \dfrac{1}{1+e^{-x}}&amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''logistic''' function:&lt;br /&gt;
::&amp;lt;math&amp;gt; P(Y=1|X) = \dfrac{\exp({\beta_0+\beta_1x})}{\exp({\beta_0+\beta_1x}+1)} &amp;lt;/math&amp;gt;&lt;br /&gt;
* Unlike linear regression which uses OLS to determine coefficients, logistic regression uses the '''maximum likelihood''' method:&lt;br /&gt;
::&amp;lt;math&amp;gt; \ell(\beta_0, \beta_1) = \displaystyle \prod_{i:y_i=1} p(x_i) \prod_{i':y'_i=0} (1-p(x'_i))&amp;lt;/math&amp;gt;&lt;br /&gt;
* Measures of goodness of fit include AIC, null and residual deviance, and the confusion matrix&lt;br /&gt;
:AIC (Akaike Information Criterion): &amp;lt;math&amp;gt; \textrm{AIC} = 2k - 2\ln(\hat{L})&amp;lt;/math&amp;gt;&lt;br /&gt;
:Null and Residual Deviance:&lt;br /&gt;
:Confusion Matrix. Here is some Python code that explains it compactly:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
def deconfuse(tn, fp, fn, tp):&lt;br /&gt;
    print('Precision:', tp/(tp+fp))&lt;br /&gt;
    print('Recall (TPR):', tp/(tp+fn))&lt;br /&gt;
    print('Specificity (TNR):', tn/(tn+fp))&lt;br /&gt;
    print('Accuracy:', (tp+tn)/(tp+tn+fp+fn))&lt;br /&gt;
    print('F1-score:', tp/(tp+(fn+fp)/2))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>66.134.54.86</name></author>
	</entry>
	<entry>
		<id>https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=172</id>
		<title>Linear Methods</title>
		<link rel="alternate" type="text/html" href="https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=172"/>
		<updated>2021-02-07T00:24:07Z</updated>

		<summary type="html">&lt;p&gt;66.134.54.86: /* Linear Regression */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Metrics===&lt;br /&gt;
Primary purpose is to minimize some error metric:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{RMSE(}\textbf{X}\textit{,h}) = \sqrt{\dfrac{1}{m} \sum^m_{i=1}(h(\textbf{x}^{(i)} - y^{(i)})^2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{MAE(}\textbf{X}\textit{,h}) = \dfrac{1}{m}\sum^m_{i=1} | h(\textbf{x}^{(i)} - y^{(i)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RMSE gives the Euclidean norm, &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt;. MAE gives the Manhattan norm, &amp;lt;math&amp;gt;\ell_1&amp;lt;/math&amp;gt;. A higher norm index overweights large values relative to small ones. This makes RMSE more sensitive to outliers than MAE. In general, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\|\textbf{v}\|_k = (|v_0|^k + |v_1|^k + \dots + |v_n|^k)^{1/k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linear Regression===&lt;br /&gt;
::&amp;lt;math&amp;gt;\hat{y} = \theta_0 + \theta_1x_1 + \theta_2x_2 + \cdots + \theta_nx_n = h_\theta(\textbf{x}) = \boldsymbol{\theta} \cdot \textbf{x} &amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{\theta}&amp;lt;/math&amp;gt; is the parameter vector. The bias term is &amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt; and the feature weights are the &amp;lt;math&amp;gt;\theta_1 \dots \theta_n&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\textbf{x}&amp;lt;/math&amp;gt; is the feature vector of &amp;lt;math&amp;gt;x_0 \dots x_n&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;x_0 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\boldsymbol{\theta}\cdot \mathbf{x}&amp;lt;/math&amp;gt; is the dot product of feature weights and features&lt;br /&gt;
* Solve using the normal equation:&lt;br /&gt;
:: &amp;lt;math&amp;gt; \boldsymbol{\hat{\theta}} = (\mathbf{X}^T\mathbf{X})^{-1} \,\mathbf{X}^T\,\mathbf{y}&amp;lt;/math&amp;gt;&lt;br /&gt;
; Performance Metrics&lt;br /&gt;
* &amp;lt;math&amp;gt;R^2 = 1 - \dfrac{SS_\text{res}}{SS_\text{tot}} &amp;lt;/math&amp;gt;, where&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = \displaystyle\sum_i (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{res} = \displaystyle\sum_i e_i^2 = \sum(y_i - \hat{y}_i)^2 &amp;lt;/math&amp;gt;, and&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{reg} = \displaystyle\sum_i (\hat{y}_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = SS_\text{reg} + SS_\text{res}&amp;lt;/math&amp;gt;&lt;br /&gt;
; Other Performance Metrics&lt;br /&gt;
&amp;lt;math&amp;gt;F = \dfrac{\left(\dfrac{\text{RSS}_1-\text{RSS}_2}{p_2-p_1}\right)}{\left(\dfrac{\text{RSS}_2}{n-p_2}\right)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confusingly, the literature also uses ESS (explained sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{reg}&amp;lt;/math&amp;gt; and RSS (Residual sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{res}&amp;lt;/math&amp;gt;. In addition, for the formulae above the acronyms SST (total), SSE (errors/residuals) and SSR (regression) are also in use.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! name 1&lt;br /&gt;
! name 2&lt;br /&gt;
! formula&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| TSS&amp;lt;br /&amp;gt;Total sum of squares&lt;br /&gt;
| SST&amp;lt;br /&amp;gt;Sum of squares, total&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| ESS&amp;lt;br /&amp;gt;Explained sum of squares&lt;br /&gt;
| SSR&amp;lt;br /&amp;gt;Sum of squares, regression&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (\hat{y}_i-\bar{y}_i)^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| predicted vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| RSS&amp;lt;br /&amp;gt;Residual sum of squares&lt;br /&gt;
| SSE&amp;lt;br /&amp;gt;Sum of squared errors&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\hat{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. predicted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logistic Regression===&lt;br /&gt;
Logistic regression, unlike linear regression, is more of a classifier. It generates probabilities rather than scalar estimates. &lt;br /&gt;
Some terminology:&lt;br /&gt;
* The '''logit''' function or log-odds is the log of the odds p/(1-p):&lt;br /&gt;
::&amp;lt;math&amp;gt;\log \left(\dfrac{p}{1-p} \right) = \log(p) - \log(1-p) &amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''sigmoid function''' is &lt;br /&gt;
::&amp;lt;math&amp;gt; \sigma(x) = \dfrac{1}{1+e^{-x}}&amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''logistic''' function:&lt;br /&gt;
::&amp;lt;math&amp;gt; P(Y=1|X) = \dfrac{\exp({\beta_0+\beta_1x})}{\exp({\beta_0+\beta_1x}+1)} &amp;lt;/math&amp;gt;&lt;br /&gt;
* Unlike linear regression which uses OLS to determine coefficients, logistic regression uses the '''maximum likelihood''' method:&lt;br /&gt;
::&amp;lt;math&amp;gt; \ell(\beta_0, \beta_1) = \displaystyle \prod_{i:y_i=1} p(x_i) \prod_{i':y'_i=0} (1-p(x'_i))&amp;lt;/math&amp;gt;&lt;br /&gt;
* Measures of goodness of fit include AIC, null and residual deviance, and the confusion matrix&lt;br /&gt;
:AIC (Akaike Information Criterion): &amp;lt;math&amp;gt; \textrm{AIC} = 2k - 2\ln(\hat{L})&amp;lt;/math&amp;gt;&lt;br /&gt;
:Null and Residual Deviance:&lt;br /&gt;
:Confusion Matrix. Here is some Python code that explains it compactly:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
def deconfuse(tn, fp, fn, tp):&lt;br /&gt;
    print('Precision:', tp/(tp+fp))&lt;br /&gt;
    print('Recall (TPR):', tp/(tp+fn))&lt;br /&gt;
    print('Specificity (TNR):', tn/(tn+fp))&lt;br /&gt;
    print('Accuracy:', (tp+tn)/(tp+tn+fp+fn))&lt;br /&gt;
    print('F1-score:', tp/(tp+(fn+fp)/2))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>66.134.54.86</name></author>
	</entry>
	<entry>
		<id>https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=171</id>
		<title>Linear Methods</title>
		<link rel="alternate" type="text/html" href="https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=171"/>
		<updated>2021-02-07T00:22:28Z</updated>

		<summary type="html">&lt;p&gt;66.134.54.86: /* Linear Regression */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Metrics===&lt;br /&gt;
Primary purpose is to minimize some error metric:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{RMSE(}\textbf{X}\textit{,h}) = \sqrt{\dfrac{1}{m} \sum^m_{i=1}(h(\textbf{x}^{(i)} - y^{(i)})^2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{MAE(}\textbf{X}\textit{,h}) = \dfrac{1}{m}\sum^m_{i=1} | h(\textbf{x}^{(i)} - y^{(i)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RMSE gives the Euclidean norm, &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt;. MAE gives the Manhattan norm, &amp;lt;math&amp;gt;\ell_1&amp;lt;/math&amp;gt;. A higher norm index overweights large values relative to small ones. This makes RMSE more sensitive to outliers than MAE. In general, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\|\textbf{v}\|_k = (|v_0|^k + |v_1|^k + \dots + |v_n|^k)^{1/k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linear Regression===&lt;br /&gt;
::&amp;lt;math&amp;gt;\hat{y} = \theta_0 + \theta_1x_1 + \theta_2x_2 + \cdots + \theta_nx_n = h_\theta(\textbf{x}) = \boldsymbol{\theta} \cdot \textbf{x} &amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{\theta}&amp;lt;/math&amp;gt; is the parameter vector. The bias term is &amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt; and the feature weights are the &amp;lt;math&amp;gt;\theta_1 \dots \theta_n&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\textbf{x}&amp;lt;/math&amp;gt; is the feature vector of &amp;lt;math&amp;gt;x_0 \dots x_n&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;x_0 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\boldsymbol{\theta}\cdot \mathbf{x}&amp;lt;/math&amp;gt; is the dot product of feature weights and features&lt;br /&gt;
* Solve using the normal equation:&lt;br /&gt;
:: &amp;lt;math&amp;gt; \boldsymbol{\hat{\theta}} = (\mathbf{X}^T\mathbf{X})^{-1} \,\mathbf{X}^T\,\mathbf{y}&amp;lt;/math&amp;gt;&lt;br /&gt;
; Performance Metrics&lt;br /&gt;
* &amp;lt;math&amp;gt;R^2 = 1 - \dfrac{SS_\text{res}}{SS_\text{tot}} &amp;lt;/math&amp;gt;, where&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = \displaystyle\sum_i (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{res} = \displaystyle\sum_i e_i^2 = \sum(y_i - \hat{y}_i)^2 &amp;lt;/math&amp;gt;, and&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{reg} = \displaystyle\sum_i (\hat{y}_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = SS_\text{reg} + SS_\text{res}&amp;lt;/math&amp;gt;&lt;br /&gt;
; Other Performance Metrics&lt;br /&gt;
&amp;lt;math&amp;gt;F = \dfrac{\left(\dfrac{\text{RSS}_1-\text{RSS}_2}{p_2-p_1}\right)}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confusingly, the literature also uses ESS (explained sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{reg}&amp;lt;/math&amp;gt; and RSS (Residual sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{res}&amp;lt;/math&amp;gt;. In addition, for the formulae above the acronyms SST (total), SSE (errors/residuals) and SSR (regression) are also in use.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! name 1&lt;br /&gt;
! name 2&lt;br /&gt;
! formula&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| TSS&amp;lt;br /&amp;gt;Total sum of squares&lt;br /&gt;
| SST&amp;lt;br /&amp;gt;Sum of squares, total&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| ESS&amp;lt;br /&amp;gt;Explained sum of squares&lt;br /&gt;
| SSR&amp;lt;br /&amp;gt;Sum of squares, regression&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (\hat{y}_i-\bar{y}_i)^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| predicted vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| RSS&amp;lt;br /&amp;gt;Residual sum of squares&lt;br /&gt;
| SSE&amp;lt;br /&amp;gt;Sum of squared errors&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\hat{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. predicted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logistic Regression===&lt;br /&gt;
Logistic regression, unlike linear regression, is more of a classifier. It generates probabilities rather than scalar estimates. &lt;br /&gt;
Some terminology:&lt;br /&gt;
* The '''logit''' function or log-odds is the log of the odds p/(1-p):&lt;br /&gt;
::&amp;lt;math&amp;gt;\log \left(\dfrac{p}{1-p} \right) = \log(p) - \log(1-p) &amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''sigmoid function''' is &lt;br /&gt;
::&amp;lt;math&amp;gt; \sigma(x) = \dfrac{1}{1+e^{-x}}&amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''logistic''' function:&lt;br /&gt;
::&amp;lt;math&amp;gt; P(Y=1|X) = \dfrac{\exp({\beta_0+\beta_1x})}{\exp({\beta_0+\beta_1x}+1)} &amp;lt;/math&amp;gt;&lt;br /&gt;
* Unlike linear regression which uses OLS to determine coefficients, logistic regression uses the '''maximum likelihood''' method:&lt;br /&gt;
::&amp;lt;math&amp;gt; \ell(\beta_0, \beta_1) = \displaystyle \prod_{i:y_i=1} p(x_i) \prod_{i':y'_i=0} (1-p(x'_i))&amp;lt;/math&amp;gt;&lt;br /&gt;
* Measures of goodness of fit include AIC, null and residual deviance, and the confusion matrix&lt;br /&gt;
:AIC (Akaike Information Criterion): &amp;lt;math&amp;gt; \textrm{AIC} = 2k - 2\ln(\hat{L})&amp;lt;/math&amp;gt;&lt;br /&gt;
:Null and Residual Deviance:&lt;br /&gt;
:Confusion Matrix. Here is some Python code that explains it compactly:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
def deconfuse(tn, fp, fn, tp):&lt;br /&gt;
    print('Precision:', tp/(tp+fp))&lt;br /&gt;
    print('Recall (TPR):', tp/(tp+fn))&lt;br /&gt;
    print('Specificity (TNR):', tn/(tn+fp))&lt;br /&gt;
    print('Accuracy:', (tp+tn)/(tp+tn+fp+fn))&lt;br /&gt;
    print('F1-score:', tp/(tp+(fn+fp)/2))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>66.134.54.86</name></author>
	</entry>
	<entry>
		<id>https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=170</id>
		<title>Linear Methods</title>
		<link rel="alternate" type="text/html" href="https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=170"/>
		<updated>2021-02-07T00:15:14Z</updated>

		<summary type="html">&lt;p&gt;66.134.54.86: /* Linear Regression */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Metrics===&lt;br /&gt;
Primary purpose is to minimize some error metric:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{RMSE(}\textbf{X}\textit{,h}) = \sqrt{\dfrac{1}{m} \sum^m_{i=1}(h(\textbf{x}^{(i)} - y^{(i)})^2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{MAE(}\textbf{X}\textit{,h}) = \dfrac{1}{m}\sum^m_{i=1} | h(\textbf{x}^{(i)} - y^{(i)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RMSE gives the Euclidean norm, &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt;. MAE gives the Manhattan norm, &amp;lt;math&amp;gt;\ell_1&amp;lt;/math&amp;gt;. A higher norm index overweights large values relative to small ones. This makes RMSE more sensitive to outliers than MAE. In general, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\|\textbf{v}\|_k = (|v_0|^k + |v_1|^k + \dots + |v_n|^k)^{1/k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linear Regression===&lt;br /&gt;
::&amp;lt;math&amp;gt;\hat{y} = \theta_0 + \theta_1x_1 + \theta_2x_2 + \cdots + \theta_nx_n = h_\theta(\textbf{x}) = \boldsymbol{\theta} \cdot \textbf{x} &amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{\theta}&amp;lt;/math&amp;gt; is the parameter vector. The bias term is &amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt; and the feature weights are the &amp;lt;math&amp;gt;\theta_1 \dots \theta_n&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\textbf{x}&amp;lt;/math&amp;gt; is the feature vector of &amp;lt;math&amp;gt;x_0 \dots x_n&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;x_0 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\boldsymbol{\theta}\cdot \mathbf{x}&amp;lt;/math&amp;gt; is the dot product of feature weights and features&lt;br /&gt;
* Solve using the normal equation:&lt;br /&gt;
:: &amp;lt;math&amp;gt; \boldsymbol{\hat{\theta}} = (\mathbf{X}^T\mathbf{X})^{-1} \,\mathbf{X}^T\,\mathbf{y}&amp;lt;/math&amp;gt;&lt;br /&gt;
; Performance Metrics&lt;br /&gt;
* &amp;lt;math&amp;gt;R^2 = 1 - \dfrac{SS_\text{res}}{SS_\text{tot}} &amp;lt;/math&amp;gt;, where&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = \displaystyle\sum_i (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{res} = \displaystyle\sum_i e_i^2 = \sum(y_i - \hat{y}_i)^2 &amp;lt;/math&amp;gt;, and&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{reg} = \displaystyle\sum_i (\hat{y}_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = SS_\text{reg} + SS_\text{res}&amp;lt;/math&amp;gt;&lt;br /&gt;
Confusingly, the literature also uses ESS (explained sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{reg}&amp;lt;/math&amp;gt; and RSS (Residual sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{res}&amp;lt;/math&amp;gt;. In addition, for the formulae above the acronyms SST (total), SSE (errors/residuals) and SSR (regression) are also in use.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! name 1&lt;br /&gt;
! name 2&lt;br /&gt;
! formula&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| TSS&amp;lt;br /&amp;gt;Total sum of squares&lt;br /&gt;
| SST&amp;lt;br /&amp;gt;Sum of squares, total&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| ESS&amp;lt;br /&amp;gt;Explained sum of squares&lt;br /&gt;
| SSR&amp;lt;br /&amp;gt;Sum of squares, regression&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (\hat{y}_i-\bar{y}_i)^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| predicted vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| RSS&amp;lt;br /&amp;gt;Residual sum of squares&lt;br /&gt;
| SSE&amp;lt;br /&amp;gt;Sum of squared errors&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\hat{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. predicted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logistic Regression===&lt;br /&gt;
Logistic regression, unlike linear regression, is more of a classifier. It generates probabilities rather than scalar estimates. &lt;br /&gt;
Some terminology:&lt;br /&gt;
* The '''logit''' function or log-odds is the log of the odds p/(1-p):&lt;br /&gt;
::&amp;lt;math&amp;gt;\log \left(\dfrac{p}{1-p} \right) = \log(p) - \log(1-p) &amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''sigmoid function''' is &lt;br /&gt;
::&amp;lt;math&amp;gt; \sigma(x) = \dfrac{1}{1+e^{-x}}&amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''logistic''' function:&lt;br /&gt;
::&amp;lt;math&amp;gt; P(Y=1|X) = \dfrac{\exp({\beta_0+\beta_1x})}{\exp({\beta_0+\beta_1x}+1)} &amp;lt;/math&amp;gt;&lt;br /&gt;
* Unlike linear regression which uses OLS to determine coefficients, logistic regression uses the '''maximum likelihood''' method:&lt;br /&gt;
::&amp;lt;math&amp;gt; \ell(\beta_0, \beta_1) = \displaystyle \prod_{i:y_i=1} p(x_i) \prod_{i':y'_i=0} (1-p(x'_i))&amp;lt;/math&amp;gt;&lt;br /&gt;
* Measures of goodness of fit include AIC, null and residual deviance, and the confusion matrix&lt;br /&gt;
:AIC (Akaike Information Criterion): &amp;lt;math&amp;gt; \textrm{AIC} = 2k - 2\ln(\hat{L})&amp;lt;/math&amp;gt;&lt;br /&gt;
:Null and Residual Deviance:&lt;br /&gt;
:Confusion Matrix. Here is some Python code that explains it compactly:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
def deconfuse(tn, fp, fn, tp):&lt;br /&gt;
    print('Precision:', tp/(tp+fp))&lt;br /&gt;
    print('Recall (TPR):', tp/(tp+fn))&lt;br /&gt;
    print('Specificity (TNR):', tn/(tn+fp))&lt;br /&gt;
    print('Accuracy:', (tp+tn)/(tp+tn+fp+fn))&lt;br /&gt;
    print('F1-score:', tp/(tp+(fn+fp)/2))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>66.134.54.86</name></author>
	</entry>
	<entry>
		<id>https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=169</id>
		<title>Linear Methods</title>
		<link rel="alternate" type="text/html" href="https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=169"/>
		<updated>2021-02-07T00:14:00Z</updated>

		<summary type="html">&lt;p&gt;66.134.54.86: /* Linear Regression */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Metrics===&lt;br /&gt;
Primary purpose is to minimize some error metric:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{RMSE(}\textbf{X}\textit{,h}) = \sqrt{\dfrac{1}{m} \sum^m_{i=1}(h(\textbf{x}^{(i)} - y^{(i)})^2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{MAE(}\textbf{X}\textit{,h}) = \dfrac{1}{m}\sum^m_{i=1} | h(\textbf{x}^{(i)} - y^{(i)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RMSE gives the Euclidean norm, &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt;. MAE gives the Manhattan norm, &amp;lt;math&amp;gt;\ell_1&amp;lt;/math&amp;gt;. A higher norm index overweights large values relative to small ones. This makes RMSE more sensitive to outliers than MAE. In general, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\|\textbf{v}\|_k = (|v_0|^k + |v_1|^k + \dots + |v_n|^k)^{1/k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linear Regression===&lt;br /&gt;
::&amp;lt;math&amp;gt;\hat{y} = \theta_0 + \theta_1x_1 + \theta_2x_2 + \cdots + \theta_nx_n = h_\theta(\textbf{x}) = \boldsymbol{\theta} \cdot \textbf{x} &amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{\theta}&amp;lt;/math&amp;gt; is the parameter vector. The bias term is &amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt; and the feature weights are the &amp;lt;math&amp;gt;\theta_1 \dots \theta_n&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\textbf{x}&amp;lt;/math&amp;gt; is the feature vector of &amp;lt;math&amp;gt;x_0 \dots x_n&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;x_0 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\boldsymbol{\theta}\cdot \mathbf{x}&amp;lt;/math&amp;gt; is the dot product of feature weights and features&lt;br /&gt;
* Solve using the normal equation:&lt;br /&gt;
:: &amp;lt;math&amp;gt; \boldsymbol{\hat{\theta}} = (\mathbf{X}^T\mathbf{X})^{-1} \,\mathbf{X}^T\,\mathbf{y}&amp;lt;/math&amp;gt;&lt;br /&gt;
; Performance Metrics&lt;br /&gt;
* &amp;lt;math&amp;gt;R^2 = 1 - \dfrac{SS_\text{res}}{SS_\text{tot}} &amp;lt;/math&amp;gt;, where&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = \displaystyle\sum_i (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{res} = \displaystyle\sum_i e_i^2 = \sum(y_i - \hat{y}_i)^2 &amp;lt;/math&amp;gt;, and&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{reg} = \displaystyle\sum_i (\hat{y}_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = SS_\text{reg} + SS_\text{res}&amp;lt;/math&amp;gt;&lt;br /&gt;
Confusingly, the literature also uses ESS (explained sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{reg}&amp;lt;/math&amp;gt; and RSS (Residual sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{res}&amp;lt;/math&amp;gt;. In addition, for the formulae above the acronyms SST (total), SSE (errors/residuals) and SSR (regression) are also in use.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! name 1&lt;br /&gt;
! name 2&lt;br /&gt;
! formula&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| TSS&amp;lt;br /&amp;gt;Total sum of squares&lt;br /&gt;
| SST&amp;lt;br /&amp;gt;Sum of squares, total&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| ESS&amp;lt;br /&amp;gt;Explained sum of squares&lt;br /&gt;
| SSR&amp;lt;br /&amp;gt;Sum of squares, regression&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\hat{y}_i)^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. predicted&lt;br /&gt;
|-&lt;br /&gt;
| RSS&amp;lt;br /&amp;gt;Residual sum of squares&lt;br /&gt;
| SSE&amp;lt;br /&amp;gt;Sum of squared errors&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\hat{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. predicted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logistic Regression===&lt;br /&gt;
Logistic regression, unlike linear regression, is more of a classifier. It generates probabilities rather than scalar estimates. &lt;br /&gt;
Some terminology:&lt;br /&gt;
* The '''logit''' function or log-odds is the log of the odds p/(1-p):&lt;br /&gt;
::&amp;lt;math&amp;gt;\log \left(\dfrac{p}{1-p} \right) = \log(p) - \log(1-p) &amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''sigmoid function''' is &lt;br /&gt;
::&amp;lt;math&amp;gt; \sigma(x) = \dfrac{1}{1+e^{-x}}&amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''logistic''' function:&lt;br /&gt;
::&amp;lt;math&amp;gt; P(Y=1|X) = \dfrac{\exp({\beta_0+\beta_1x})}{\exp({\beta_0+\beta_1x}+1)} &amp;lt;/math&amp;gt;&lt;br /&gt;
* Unlike linear regression which uses OLS to determine coefficients, logistic regression uses the '''maximum likelihood''' method:&lt;br /&gt;
::&amp;lt;math&amp;gt; \ell(\beta_0, \beta_1) = \displaystyle \prod_{i:y_i=1} p(x_i) \prod_{i':y'_i=0} (1-p(x'_i))&amp;lt;/math&amp;gt;&lt;br /&gt;
* Measures of goodness of fit include AIC, null and residual deviance, and the confusion matrix&lt;br /&gt;
:AIC (Akaike Information Criterion): &amp;lt;math&amp;gt; \textrm{AIC} = 2k - 2\ln(\hat{L})&amp;lt;/math&amp;gt;&lt;br /&gt;
:Null and Residual Deviance:&lt;br /&gt;
:Confusion Matrix. Here is some Python code that explains it compactly:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
def deconfuse(tn, fp, fn, tp):&lt;br /&gt;
    print('Precision:', tp/(tp+fp))&lt;br /&gt;
    print('Recall (TPR):', tp/(tp+fn))&lt;br /&gt;
    print('Specificity (TNR):', tn/(tn+fp))&lt;br /&gt;
    print('Accuracy:', (tp+tn)/(tp+tn+fp+fn))&lt;br /&gt;
    print('F1-score:', tp/(tp+(fn+fp)/2))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>66.134.54.86</name></author>
	</entry>
	<entry>
		<id>https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=168</id>
		<title>Linear Methods</title>
		<link rel="alternate" type="text/html" href="https://btechwiki.duckdns.org/index.php?title=Linear_Methods&amp;diff=168"/>
		<updated>2021-02-07T00:01:58Z</updated>

		<summary type="html">&lt;p&gt;66.134.54.86: /* Linear Regression */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Metrics===&lt;br /&gt;
Primary purpose is to minimize some error metric:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{RMSE(}\textbf{X}\textit{,h}) = \sqrt{\dfrac{1}{m} \sum^m_{i=1}(h(\textbf{x}^{(i)} - y^{(i)})^2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \displaystyle \textrm{MAE(}\textbf{X}\textit{,h}) = \dfrac{1}{m}\sum^m_{i=1} | h(\textbf{x}^{(i)} - y^{(i)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RMSE gives the Euclidean norm, &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt;. MAE gives the Manhattan norm, &amp;lt;math&amp;gt;\ell_1&amp;lt;/math&amp;gt;. A higher norm index overweights large values relative to small ones. This makes RMSE more sensitive to outliers than MAE. In general, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\|\textbf{v}\|_k = (|v_0|^k + |v_1|^k + \dots + |v_n|^k)^{1/k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linear Regression===&lt;br /&gt;
::&amp;lt;math&amp;gt;\hat{y} = \theta_0 + \theta_1x_1 + \theta_2x_2 + \cdots + \theta_nx_n = h_\theta(\textbf{x}) = \boldsymbol{\theta} \cdot \textbf{x} &amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{\theta}&amp;lt;/math&amp;gt; is the parameter vector. The bias term is &amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt; and the feature weights are the &amp;lt;math&amp;gt;\theta_1 \dots \theta_n&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\textbf{x}&amp;lt;/math&amp;gt; is the feature vector of &amp;lt;math&amp;gt;x_0 \dots x_n&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;x_0 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\boldsymbol{\theta}\cdot \mathbf{x}&amp;lt;/math&amp;gt; is the dot product of feature weights and features&lt;br /&gt;
* Solve using the normal equation:&lt;br /&gt;
:: &amp;lt;math&amp;gt; \boldsymbol{\hat{\theta}} = (\mathbf{X}^T\mathbf{X})^{-1} \,\mathbf{X}^T\,\mathbf{y}&amp;lt;/math&amp;gt;&lt;br /&gt;
; Performance Metrics&lt;br /&gt;
* &amp;lt;math&amp;gt;R^2 = 1 - \dfrac{SS_\text{res}}{SS_\text{tot}} &amp;lt;/math&amp;gt;, where&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = \displaystyle\sum_i (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{res} = \displaystyle\sum_i e_i^2 = \sum(y_i - \hat{y}_i)^2 &amp;lt;/math&amp;gt;, and&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{reg} = \displaystyle\sum_i (\hat{y}_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;SS_\text{tot} = SS_\text{reg} + SS_\text{res}&amp;lt;/math&amp;gt;&lt;br /&gt;
Confusingly, the literature also uses ESS (explained sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{reg}&amp;lt;/math&amp;gt; and RSS (Residual sum of squares) to mean &amp;lt;math&amp;gt;SS_\text{res}&amp;lt;/math&amp;gt;. In addition, for the formulae above the acronyms SST (total), SSE (errors/residuals) and SSR (regression) are also in use.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! name 1&lt;br /&gt;
! name 2&lt;br /&gt;
! formula&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| TSS&amp;lt;br /&amp;gt;Total sum of squares&lt;br /&gt;
| SST&amp;lt;br /&amp;gt;Sum of squares, total&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. mean&lt;br /&gt;
|-&lt;br /&gt;
| ESS&amp;lt;br /&amp;gt;Explained sum of squares&lt;br /&gt;
| SSR&amp;lt;br /&amp;gt;Sum of squares, regression&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (y_i-\hat{y}_i)^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| observed vs. predicted&lt;br /&gt;
|-&lt;br /&gt;
| RSS&amp;lt;br /&amp;gt;Residual sum of squares&lt;br /&gt;
| SSE&amp;lt;br /&amp;gt;Sum of squared errors&lt;br /&gt;
| &amp;lt;math&amp;gt;\displaystyle\sum (\hat{y}_i-\bar{y})^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
| predicted vs. mean&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Logistic Regression===&lt;br /&gt;
Logistic regression, unlike linear regression, is more of a classifier. It generates probabilities rather than scalar estimates. &lt;br /&gt;
Some terminology:&lt;br /&gt;
* The '''logit''' function or log-odds is the log of the odds p/(1-p):&lt;br /&gt;
::&amp;lt;math&amp;gt;\log \left(\dfrac{p}{1-p} \right) = \log(p) - \log(1-p) &amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''sigmoid function''' is &lt;br /&gt;
::&amp;lt;math&amp;gt; \sigma(x) = \dfrac{1}{1+e^{-x}}&amp;lt;/math&amp;gt;&lt;br /&gt;
* The '''logistic''' function:&lt;br /&gt;
::&amp;lt;math&amp;gt; P(Y=1|X) = \dfrac{\exp({\beta_0+\beta_1x})}{\exp({\beta_0+\beta_1x}+1)} &amp;lt;/math&amp;gt;&lt;br /&gt;
* Unlike linear regression which uses OLS to determine coefficients, logistic regression uses the '''maximum likelihood''' method:&lt;br /&gt;
::&amp;lt;math&amp;gt; \ell(\beta_0, \beta_1) = \displaystyle \prod_{i:y_i=1} p(x_i) \prod_{i':y'_i=0} (1-p(x'_i))&amp;lt;/math&amp;gt;&lt;br /&gt;
* Measures of goodness of fit include AIC, null and residual deviance, and the confusion matrix&lt;br /&gt;
:AIC (Akaike Information Criterion): &amp;lt;math&amp;gt; \textrm{AIC} = 2k - 2\ln(\hat{L})&amp;lt;/math&amp;gt;&lt;br /&gt;
:Null and Residual Deviance:&lt;br /&gt;
:Confusion Matrix. Here is some Python code that explains it compactly:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
def deconfuse(tn, fp, fn, tp):&lt;br /&gt;
    print('Precision:', tp/(tp+fp))&lt;br /&gt;
    print('Recall (TPR):', tp/(tp+fn))&lt;br /&gt;
    print('Specificity (TNR):', tn/(tn+fp))&lt;br /&gt;
    print('Accuracy:', (tp+tn)/(tp+tn+fp+fn))&lt;br /&gt;
    print('F1-score:', tp/(tp+(fn+fp)/2))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>66.134.54.86</name></author>
	</entry>
</feed>