Update on machine learning

This commit is contained in:
mhjensen
2017-11-27 22:22:51 +00:00
parent e1cf880961
commit 2d8aefeb59
13 changed files with 1035 additions and 78 deletions
@@ -6,9 +6,9 @@ Automatically generated HTML file from DocOnce source
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
<meta name="description" content="Data Analysis and Machine Learning: Representing data">
<meta name="description" content="Data Analysis and Machine Learning: Introduction and Representing data">
<title>Data Analysis and Machine Learning: Representing data</title>
<title>Data Analysis and Machine Learning: Introduction and Representing data</title>
<!-- Bootstrap style: bootstrap -->
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
@@ -40,8 +40,18 @@ Automatically generated HTML file from DocOnce source
<!-- tocinfo
{'highest level': 2,
'sections': [('Representing data, overarching aims', 2, None, '___sec0'),
('Representing data, overarching aims', 2, None, '___sec1')]}
'sections': [('What is Machine Learning?', 2, None, '___sec0'),
('Types of Machine Learning', 2, None, '___sec1'),
('Different algorithms', 2, None, '___sec2'),
('Software and needed installations', 2, None, '___sec3'),
('Python installers', 2, None, '___sec4'),
('Installing R and C++', 2, None, '___sec5'),
('Introduction to Jupyter notebook and available tools',
2,
None,
'___sec6'),
('Representing data, overarching aims', 2, None, '___sec7'),
('Representing data, more examples', 2, None, '___sec8')]}
end of tocinfo -->
<body>
@@ -55,7 +65,7 @@ end of tocinfo -->
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="How2ReadData-bs.html">Data Analysis and Machine Learning: Representing data</a>
<a class="navbar-brand" href="How2ReadData-bs.html">Data Analysis and Machine Learning: Introduction and Representing data</a>
</div>
<div class="navbar-collapse collapse navbar-responsive-collapse">
@@ -63,8 +73,15 @@ end of tocinfo -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Contents <b class="caret"></b></a>
<ul class="dropdown-menu">
<!-- navigation toc: --> <li><a href="#___sec0" style="font-size: 80%;">Representing data, overarching aims</a></li>
<!-- navigation toc: --> <li><a href="._How2ReadData-bs002.html#___sec1" style="font-size: 80%;">Representing data, overarching aims</a></li>
<!-- navigation toc: --> <li><a href="#___sec0" style="font-size: 80%;">What is Machine Learning?</a></li>
<!-- navigation toc: --> <li><a href="._How2ReadData-bs002.html#___sec1" style="font-size: 80%;">Types of Machine Learning</a></li>
<!-- navigation toc: --> <li><a href="._How2ReadData-bs003.html#___sec2" style="font-size: 80%;">Different algorithms</a></li>
<!-- navigation toc: --> <li><a href="._How2ReadData-bs004.html#___sec3" style="font-size: 80%;">Software and needed installations</a></li>
<!-- navigation toc: --> <li><a href="._How2ReadData-bs005.html#___sec4" style="font-size: 80%;">Python installers</a></li>
<!-- navigation toc: --> <li><a href="._How2ReadData-bs006.html#___sec5" style="font-size: 80%;">Installing R and C++</a></li>
<!-- navigation toc: --> <li><a href="._How2ReadData-bs007.html#___sec6" style="font-size: 80%;">Introduction to Jupyter notebook and available tools</a></li>
<!-- navigation toc: --> <li><a href="._How2ReadData-bs008.html#___sec7" style="font-size: 80%;">Representing data, overarching aims</a></li>
<!-- navigation toc: --> <li><a href="._How2ReadData-bs009.html#___sec8" style="font-size: 80%;">Representing data, more examples</a></li>
</ul>
</li>
@@ -80,34 +97,23 @@ end of tocinfo -->
<a name="part0001"></a>
<!-- !split -->
<h2 id="___sec0" class="anchor">Representing data, overarching aims </h2>
<div class="panel panel-default">
<div class="panel-body">
<p> <!-- subsequent paragraphs come in larger fonts, so start with a paragraph -->
<p>
<h2 id="___sec0" class="anchor">What is Machine Learning? </h2>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">numpy</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">np</span>
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">matplotlib.pyplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">plt</span>
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">scipy</span> <span style="color: #008000; font-weight: bold">import</span> sparse
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">pandas</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">pd</span>
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">IPython.display</span> <span style="color: #008000; font-weight: bold">import</span> display
eye <span style="color: #666666">=</span> np<span style="color: #666666">.</span>eye(<span style="color: #666666">4</span>)
<span style="color: #008000; font-weight: bold">print</span>(eye)
sparse_mtx <span style="color: #666666">=</span> sparse<span style="color: #666666">.</span>csr_matrix(eye)
<span style="color: #008000; font-weight: bold">print</span>(sparse_mtx)
x <span style="color: #666666">=</span> np<span style="color: #666666">.</span>linspace(<span style="color: #666666">-10</span>,<span style="color: #666666">10</span>,<span style="color: #666666">100</span>)
y <span style="color: #666666">=</span> np<span style="color: #666666">.</span>sin(x)
plt<span style="color: #666666">.</span>plot(x,y,marker<span style="color: #666666">=</span><span style="color: #BA2121">&#39;x&#39;</span>)
plt<span style="color: #666666">.</span>show()
data <span style="color: #666666">=</span> {<span style="color: #BA2121">&#39;Name&#39;</span>: [<span style="color: #BA2121">&quot;John&quot;</span>, <span style="color: #BA2121">&quot;Anna&quot;</span>, <span style="color: #BA2121">&quot;Peter&quot;</span>, <span style="color: #BA2121">&quot;Linda&quot;</span>], <span style="color: #BA2121">&#39;Location&#39;</span>: [<span style="color: #BA2121">&quot;Roma&quot;</span>, <span style="color: #BA2121">&quot;Napoli&quot;</span>, <span style="color: #BA2121">&quot;Torino&quot;</span>, <span style="color: #BA2121">&quot;Milano&quot;</span>], <span style="color: #BA2121">&#39;Age&#39;</span>:[<span style="color: #666666">51</span>, <span style="color: #666666">21</span>, <span style="color: #666666">34</span>, <span style="color: #666666">45</span>]}
data_pandas <span style="color: #666666">=</span> pd<span style="color: #666666">.</span>DataFrame(data)
display(data_pandas)
</pre></div>
<p>
</div>
</div>
Machine learning is the science of giving computers the ability to
learn without being explicitly programmed. The idea is that there
exist generic algorithms which can be used to find patterns in a broad
class of data sets without having to write code specifically for each
problem. The algorithm will build its own logic based on the data.
<p>
Machine learning is a subfield of computer science, and is closely
related to computational statistics. It evolved from the study of
pattern recognition in artificial intelligence (AI) research, and has
made contributions to AI tasks like computer vision, natural language
processing and speech recognition. It has also, especially in later
years, found applications in a wide variety of other areas, including
bioinformatics, economy, physics, finance and marketing.
<p>
<p>
@@ -117,6 +123,13 @@ display(data_pandas)
<li><a href="._How2ReadData-bs000.html">1</a></li>
<li class="active"><a href="._How2ReadData-bs001.html">2</a></li>
<li><a href="._How2ReadData-bs002.html">3</a></li>
<li><a href="._How2ReadData-bs003.html">4</a></li>
<li><a href="._How2ReadData-bs004.html">5</a></li>
<li><a href="._How2ReadData-bs005.html">6</a></li>
<li><a href="._How2ReadData-bs006.html">7</a></li>
<li><a href="._How2ReadData-bs007.html">8</a></li>
<li><a href="._How2ReadData-bs008.html">9</a></li>
<li><a href="._How2ReadData-bs009.html">10</a></li>
<li><a href="._How2ReadData-bs002.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->