Giter Club home page Giter Club logo

buildingmachinelearningsystemswithpython's Introduction

Building Machine Learning Systems with Python

Source Code for the book Building Machine Learning Systems with Python by Luis Pedro Coelho and Willi Richert.

The book was published in 2013 (second edition in 2015) by Packt Publishing and is available from their website.

The code in the repository corresponds to the second edition. Code for the first edition is available in first_edition branch.

buildingmachinelearningsystemswithpython's People

Contributors

ao-song avatar iory avatar juanpabloaj avatar luispedro avatar re4lfl0w avatar tomahawk28 avatar wrichert 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

buildingmachinelearningsystemswithpython's Issues

Movie features, user features

Pedro, you use just utility matrix.
Why don't you use movie features, user features?
because the utility matrix gives a more accurate prediction?
or you just looked at an example, without touching movie features, user features?

build LDA model by using AP data fail

Environment: Python 3.5.4rc1
when I build the topic model in jupyter notebook, python always throw .local/lib/python3.5/site packages/gensim/models/ldamodel.py:802: RuntimeWarning: divide by zero encountered in log, I don't know why np.log(0) happens.

ch09 is not correct

It seems that the codes in ch09 are not correct. Some preprocess steps are missing?

Example with a single Tweet - Chapter6

Hi Luis, I'm starting to learning machine learning with scikit, I'm from Brazil, is it possible to show a example of prediction for the sentiment analisys at the chapter6 after have the model trained ?
I want to check with a single tweet how much is he positive or negative, base on the == Pos vs. neg == trained model. Can you show a example please.

thanks

Execution killed

Hi! Thank you for create the book, I'm using it and I find it awesome! But I'm getting a problem with ch05/so_xml_to_tsv.py, at some point the execution gets killed because the huge amount of memory that it's using (with a 16GB RAM pc). I'll try to see which objects are creating this problem and maybe fix the issue, so, I'll keep you informed.

Logic error in code

@luispedro This code on line 88 of Ch01/analyze_webstats.py (and page 22 in the book)

xa = x[:inflection]
ya = y[:inflection]
xb = x[inflection:]
yb = y[inflection:]

Since you trimmed the list on line 22, so the values corresponding to some indexes have been removed.
For example, x[2] has been trimmed out in line 22, and more, this leads to left shift in the values contained in the list. What I mean by that is that now that for x[inflection-1] will contain a value which is actually larger than inflection. This division would have worked fine for the raw untrimmed array but not after it's been trimmed.

Please fix this in the next edition or if I'm wrong then please make me understand how is this correct.

Chapter 2: Issue with threshold.py

Hi Luis,

I have just started following the book for getting started with machine learning. However, the below code in threshold.py yields a boolean value and not a numpy array on which mean can be calculated.

image

cannot import name 'CHART_DIR'

Good day!
I have a mistake in BuildingMachineLearningSystemsWithPython/ch03/plot_kmeans_example.py

`import utils
CHART_DIR = 'D:\Python'
from utils import CHART_DIR

ImportError: cannot import name 'CHART_DIR'`

what did i do wrong?

TypeError: unsupported operand type(s) for +: 'int' and 'str'

I see the following error when running ch04/blei_lda.py

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-5511c9e27cd2> in <module>()
     37 for ti in range(model.num_topics):
     38     words = model.show_topic(ti, 64)
---> 39     tf = sum(f for f, w in words)
     40     with open('topics.txt', 'w') as output:
     41         output.write('\n'.join('{}:{}'.format(w, int(1000. * f / tf)) for f, w in words))

TypeError: unsupported operand type(s) for +: 'int' and 'str'

I think, since the frequency, f, and word, w, are the opposite on words, did you want to write w, f in words instead, as in the following?

     39     tf = sum(f for w, f in words)
     40     with open('topics.txt', 'w') as output:
     41         output.write('\n'.join('{}:{}'.format(w, int(1000. * f / tf)) for w, f in words))

totsv ch05 : parsing error

BuildingMachineLearningSystemsWithPython/ch05/so_xml_to_tsv.py

in the parsexml function, I had to make the following changes to have it working:

def parsexml(filename):
    global num_questions, num_answers

    counter = 0

    it = iter(etree.iterparse(filename, events=('start',)))

    event, root = next(it)  # get posts element

    for event, elem in it:

set directory to utils.py in chapter 09

When I run the utils.py file, the following text appears:
"Please set GENRE_DIR and TEST_DIR in utils.py"

leaving the comment: "Process finished with exit code 1"
and I have no idea what to do and how to do. Help me please!
image

Note: I have sample .wav files in a folder "genres" inside the same directory where my python project exists. That folder further contains subfolders for samples in each music genre

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.