Coder Social home page Coder Social logo

dylewsky / data_driven_science_python_demos Goto Github PK

View Code? Open in Web Editor NEW
121.0 121.0 357.0 206.42 MB

IPython notebooks with demo code intended as a companion to the book "Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control" by J. Nathan Kutz and Steven L. Brunton

Home Page: http://www.databookuw.com/

Jupyter Notebook 100.00%

data_driven_science_python_demos's People

Contributors

dmitrigrigoriev avatar dylewsky avatar hazcat 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

data_driven_science_python_demos's Issues

matplotlib syntax errors

in Chapter 1, PCA ipynb, some lines contain syntax errors:
ax2.plot(<plotting things here>,'-', Color="b", LineWidth=5)
this raises an AttributeError and can be easily fixed by:
ax2.plot(<plotting things here>,'-', c="b", lw=5) or
ax2.plot(<plotting things here>,'-', color="b", linewidth=5)

:)

Case-Insensitive properties have been deprecated since matptlolib 3.3

As an example, the following code, from CH01_SEC04_1_Linear.ipynb,

plt.plot(a, x*a, Color='k', LineWidth=2, label='True line') # True relationship
plt.plot(a, b, 'x', Color='r', MarkerSize = 10, label='Noisy data') # Noisy measurements

should now be:

plt.plot(a, x*a, Color='k', linewidth=2, label='True line') # True relationship
plt.plot(a, b, 'x', Color='r', markersize = 10, label='Noisy data') # Noisy measurements

Faster linear programming alternative to `scipy.optimize.minimize` for solving basis pursuit problems

The scipy.optimize.minimize method tends to be really slow for solving the basis pursuit problem (ex. in the compressed sensing context) especially when we are dealing with less sparse vectors. A much faster alternative could be used by modelling the problem as a linear programming problem and using scipy.optimize.linprog instead

def basis_pursuit_v2(A, y):
    """Objective : minimize(  norm(x, 1)  )
       Subject to: A * x == y
    """
    numCols = A.shape[1]

    vF = np.ones((2 * numCols, 1))
    mAeq = np.hstack([A, -A])
    vBeq = y

    vUV = linprog(vF, None, None, mAeq, vBeq, bounds=(0, np.inf))
    return vUV.x[:numCols] - vUV.x[numCols:]

This answer explains the LP modelling

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.