User Tools

Site Tools


cs401r_w2016:lab2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
cs401r_w2016:lab2 [2016/01/15 17:36]
admin
cs401r_w2016:lab2 [2018/01/22 20:13]
sadler
Line 8: Line 8:
  
 For this lab, you will turn in an ipython notebook that implements the "​Bayesian Concept Learning"​ model from Chapter 3 of MLAPP. For this lab, you will turn in an ipython notebook that implements the "​Bayesian Concept Learning"​ model from Chapter 3 of MLAPP.
 +
 +[[http://​liftothers.org/​courses/​stat_ml/​mlapp_ch3.pdf|Here is a PDF of the relevant chapter.]]
  
 Your notebook should perform the following functions: Your notebook should perform the following functions:
Line 50: Line 52:
  
 <code python> <code python>
-prior = numpy.ones(( len(concepts), 1 ))+prior = numpy.ones(len(concepts))
 prior[0] = 5 prior[0] = 5
 prior[1] = 5 prior[1] = 5
-prior[2] = 5 +prior[30] = .01 
-prior[21] = 5+prior[31] = .01
 prior = prior / numpy.sum(prior) prior = prior / numpy.sum(prior)
 </​code>​ </​code>​
Line 85: Line 87:
 ---- ----
 ====Hints:​==== ====Hints:​====
- 
-When using an ipython notebook, it's nice to make your plots show up inline. ​ To do this, add the following lines to the first cell of your notebook: 
- 
-<code python> 
- 
-# this tells seaborn and matplotlib to generate plots inline in the notebook 
-%matplotlib inline  ​ 
- 
-# these two lines allow you to control the figure size 
-%pylab inline 
-pylab.rcParams['​figure.figsize'​] = (16.0, 8.0) 
- 
-</​code>​ 
- 
  
 You may find the following functions useful: You may find the following functions useful:
Line 124: Line 112:
 plt.title plt.title
 plt.xlabel plt.xlabel
 +
 +# changes the xlimits of an axis
 +plt.xlim
 +# changes the ylimits of an axis
 +plt.ylim
  
 </​code>​ </​code>​
cs401r_w2016/lab2.txt · Last modified: 2021/06/30 23:42 (external edit)