Giter VIP home page Giter VIP logo

pyprobml's People

Contributors

abdelrahman350 avatar always-newbie161 avatar anandshegde avatar andrewnc avatar animesh-007 avatar ashishpapanai avatar dhruvpatel144 avatar drishttii avatar duane321 avatar garvit9000c avatar gerdm avatar johnfearns22 avatar karalleyna avatar karm-patel avatar kzymgch avatar madhav-kanda avatar mjsml avatar murphyk avatar nalzok avatar nappaillav avatar neoanarika avatar nirzu97 avatar nitish1295 avatar patel-zeel avatar rohit-khoiwal avatar shivaditya-meduri avatar shobro avatar takshpanchal avatar vishal987595 avatar xinglong-li avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyprobml's Issues

Missing data directory

Some of the examples include a call to utils/util.load_mat that depends on a DATA_DIR being available where the .mat files are supposed to be.

Here's what grep -r -i --include \*.py load_mat gives me when run in examples.

prostateComparisonOrig.py:#X = util.load_mat('prostate')
naiveBayesBowDemo.py:data = util.load_mat('XwindowsDocData')
logregSATdemo.py:data = util.load_mat('sat/sat.mat')
gaussHeightWeight.py:data = util.load_mat('heightWeight')
newsgroupsVisualize.py:data = util.load_mat('20news_w100')
shuffledDigitsDemo.py:data = util.load_mat('mnistAll')
utils/util.py:# def load_mat(matName):
surfaceFitDemo.py:data = util.load_mat('moteData/moteData.mat')
kmeansHeightWeight.py:data = util.load_mat('heightWeight')

How would @murphyk recommend this is handled? Should the data directory be replicated in this repo so that the datasets become available for the scripts?

R non-negative comment

In Chapter 3, on page 55 under equation 3.57, we have

is the softplus function, that maps from R to R+, to ensure the predicted standard deviation is non-negative.

Are we talking R+ or non-negative R_{\geq 0}? R+ would be R_{> 0)

Figure 1.5 The numbers don't go with the story

If Virginica is poisonous, shouldn't the cost of predicting Virginica to be Setosa or Versicolor be 10 not the way in the book? I understand the point of asymmetric cost but the numbers don't seem to go with the story.

Page 56 equation 3.58

Here you are discussion the half normal distribution defined from [0, to \infty) but using the notation \mathfrak{N}_+ which general denotes (0, \infty) when + is used.

Is this the correct nomenclature?

Section 2.3.2 R+ should be R non-negative

In section 2.3.2, you say:

sj ∈ [0,∞] are the lengths of the two sides. Hence the hypothesis space is H = R2 × R2+, where R+ is the set of positive reals.

0 is not a positive number and since the domain is inclusive of 0, we should say R nonnegative R_{\geq 0} or however you would like to note it.

The draft date is 18 Jan 2021; I just started reading it yesterday so I think this is the most up to date version.

Data directory for mnist1NNdemo.py

I apologise if this has already been raised, but examples/mnist1NNdemo.py expects a /Data/MNIST directory with the training data, and I'm not sure where to get this from.

I searched through the backlog and found PR #36, where @Duane321 wanted to add those files but he didn't have the right access.

Please let me know if they're already on the repo and I missed them.

Written error in book 1 part 2.2.1

image
Hi, Thanks for providing this excellent book. I just start reading it today.
I believe the sentense underlined in the picture should be "The false positive rate is defined as one minues the specifivity".

titles of chapter

In the new format, you are listing each of the chapters by its number. It would be really helpful to specify the topic as well. This way a person could find what they are looking for without having to have the book in front of them.

Potential grammar issue

This sentence, in section 2.4.4, sounds a bit off. Might just be me but take a look.

The advantage of the Bayesian approach is that by capturing uncertainty in the parameters θ, we will more accurately model uncertainty in our forecasts p(y|x, D) than we would using a plug-in approximation p(y|x, θˆ).

The fragment in question is:

"...than we would [be?] using a plug-in approximation..."

Discrepancy between sensor_fusion_2d.py posterior mean and equation (4.125) in old textbook

Hi, I have been reading your textbook along with the new codes, and I think in sensor_fusion_2d.py there is a misplaced parenthesis on line 26 for the posterior mean calculation. According to (4.125), post['sigma'] should be multiplied with the sum of A.T.dot(sy_inv).dot(y.reshape(4,1) - py['mu']) and smu_inv.dot(pmu['mu']).reshape(2,1). The right parenthesis for post['sigma'].dot() should be moved to the end.

Should there be support for Python 2.7?

So as I'm working on porting code over, I was wondering if compatibility with Python 2.7 is still required.

Most if not all of the packages used in the code (numpy, scipy, etc) already support Python 3, and adding support for 2.7 will just create some additional work where I have to have all the packages installed for both versions and always test for both before making changes.

I would recommend to just move to Python 3 for the whole code-base, but I wanted @murphyk 's input on this.

Error in bfgs_autograd

I've started porting over some code and though I would start with ensuring that existing code runs fine first before starting to port Matlab code.

The first example I took is bfgs_autograd which currently results in this error:

Traceback (most recent call last):
  File "bfgs_autograd.py", line 35, in <module>
    main()
  File "bfgs_autograd.py", line 30, in main
    params, obj = bfgs_auto(Xtrain, ytrain)
  File "bfgs_autograd.py", line 21, in bfgs_auto
    result = minimize(obj_fun, params,  method='BFGS', jac=grad_fun)
  File "/home/tvas/anaconda3/envs/mlpp/lib/python3.5/site-packages/scipy/optimize/_minimize.py", line 444, in minimize
    return _minimize_bfgs(fun, x0, args, jac, callback, **options)
  File "/home/tvas/anaconda3/envs/mlpp/lib/python3.5/site-packages/scipy/optimize/optimize.py", line 921, in _minimize_bfgs
    old_old_fval = old_fval + np.linalg.norm(gfk) / 2
  File "/home/tvas/anaconda3/envs/mlpp/lib/python3.5/site-packages/numpy/linalg/linalg.py", line 2129, in norm
    sqnorm = dot(x, x)
TypeError: unsupported operand type(s) for *: 'function' and 'function'

If I instead switch over to using the commented out grad_fun = autograd.grad(obj_fun) instead of grad_fun = lambda params: gradient(params, Xtrain, ytrain)it works fine.

I'll open a small PR for this, I've tested it in Python 3.5 with the Anaconda distribution, scipy 0.18, autograd 1.1.6, numpy 1.11.1

Figure 1.38 and 1.39 Octave error

Error running dtreeDemoIris.m on GNU Octave, version 4.2.2
With NaN installed and having fisheriris.m in the same directory.
Colab runtime with no accelerator and normal memory config
Octave error :

error: load: unable to determine file format of 'fisheriris.m'
error: called from
    dtreeDemoIris at line 9 column 1

convert legacy matlab code to python

If you want to contribute a Python version of a figure, follow these steps:

  • Check the list of open issues for ones with a name like "Convert foo to Python". Such issues have the tag 'Figures'.
    Each issue has a link to the Matlab file that was used to generate the figure, and a figure number.
    Figure numbers refer to this version of the book: https://github.com/probml/pml-book/releases/tag/2021-03-08.
    Consult the pdf file to see what the figure should look like.

  • Follow these guidelines for how to contribute code.

  • Test your code works in Google colab, and make a pull request. Please include the generated image(s) in your PR, and add a tag which mentions the issue you are solving.

  • Here is an example of good PR.

  • If you are a student and want to be considered for the Google Summer of Code, please apply here after March 29th. You should have at least 2 PRs succesfully added to this repo before applying. Please follow the style guidelines mentioned above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.