2020-01-15 23:07:02 -05:00
<!DOCTYPE html>
< html >
< head >
< meta charset = "utf-8" / >
2022-02-15 01:14:58 -05:00
< meta name = "author" content = "Brandon Rozek" >
2020-01-15 23:07:02 -05:00
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< meta name = "robots" content = "noindex" / >
< title > Brandon Rozek< / title >
< link rel = "stylesheet" href = "themes/bitsandpieces/styles/main.css" type = "text/css" / >
< link rel = "stylesheet" href = "themes/bitsandpieces/styles/highlightjs-github.css" type = "text/css" / >
< / head >
< body >
< aside class = "main-nav" >
< nav >
< ul >
< li class = "menuitem " >
< a href = "index.html%3Findex.html" data-shortcut = "" >
Home
< / a >
< / li >
< li class = "menuitem " >
< a href = "index.html%3Fcourses.html" data-shortcut = "" >
Courses
< / a >
< / li >
< li class = "menuitem " >
< a href = "index.html%3Flabaide.html" data-shortcut = "" >
Lab Aide
< / a >
< / li >
< li class = "menuitem " >
< a href = "index.html%3Fpresentations.html" data-shortcut = "" >
Presentations
< / a >
< / li >
< li class = "menuitem " >
< a href = "index.html%3Fresearch.html" data-shortcut = "" >
Research
< / a >
< / li >
< li class = "menuitem " >
< a href = "index.html%3Ftranscript.html" data-shortcut = "" >
Transcript
< / a >
< / li >
< / ul >
< / nav >
< / aside >
< main class = "main-content" >
< article class = "article" >
< h1 > Revisiting Similarity Measures< / h1 >
< h2 > Manhatten Distance< / h2 >
< p > An additional use case for Manhatten distance is when dealing with binary vectors. This approach, otherwise known as the Hamming distance, is the number of bits that are different between two binary vectors.< / p >
< h2 > Ordinal Variables< / h2 >
< p > Ordinal variables can be treated as if they were on a interval scale.< / p >
< p > First, replace the ordinal variable value by its rank ($r_{if}$) Then map the range of each variable onto the interval $[0, 1]$ by replacing the $f< em > i$ where f is the variable and i is the object by
$$
z< / em > {if} = \frac{r_{if} - 1}{M_f - 1}
$$
Where $M_f$ is the maximum rank.< / p >
< h3 > Example< / h3 >
< p > Freshman = $0$ Sophmore = $\frac{1}{3}$ Junior = $\frac{2}{3}$ Senior = $1$< / p >
< p > $d(freshman, senior) = 1$< / p >
< p > $d(junior, senior) = \frac{1}{3}$< / p >
< / article >
< / main >
< script src = "themes/bitsandpieces/scripts/highlight.js" > < / script >
< script src = "themes/bitsandpieces/scripts/mousetrap.min.js" > < / script >
< script type = "text/x-mathjax-config" >
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true
}
});
< / script >
< script type = "text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
< / script >
< script >
hljs.initHighlightingOnLoad();
document.querySelectorAll('.menuitem a').forEach(function(el) {
if (el.getAttribute('data-shortcut').length > 0) {
Mousetrap.bind(el.getAttribute('data-shortcut'), function() {
location.assign(el.getAttribute('href'));
});
}
});
< / script >
< / body >
< / html >