Git Product home page Git Product logo

real-world-machine-learning's Introduction

Real-World Machine Learning

This repository includes a set of IPython notebooks with functions and example code from the Real-World Machine Learning book by Henrik Brink, Joseph Richards, and Mark Fetherolf published by Manning Books:

https://www.manning.com/books/real-world-machine-learning

The notebooks can be viewed directly in the Github repository:

https://github.com/brinkar/real-world-machine-learning

To run the code yourself, please clone this repo, install IPython (on Python 2.7) and run ipython notebook in the repo directory. We highly recommend installing the Anaconda Python distribution, which includes IPython, Scikit-Learn, Pandas, and mostly anything else used throughout the book:

https://www.continuum.io/downloads

real-world-machine-learning's People

Contributors

brinkar avatar markfetherolf avatar numinary 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

real-world-machine-learning's Issues

could you upload NYC sample data?

the whole data is so huge that it will take a lot of time to download them. however, in your book, only a slice of them are used. So, will you upload the data you used in chapter 6?

ValueError: columns overlap but no suffix specified: Index([u' payment_type:CRD', u' payment_type:DIS', u' payment_type:NOC', u' payment_type:UNK'], dtype='object')

Hi,

I have been running your code on chapter 6 and I keep getting the error on the subject. Am I missing something ?

on subchapter Features 3

code :

data = data.join(payment_type_cats)
feats3 += payment_type_cats.columns
data = data.join(vendor_id_cats)
feats3 += vendor_id_cats.columns
data = data.join(store_and_fwd_flag_cats)
feats3 += store_and_fwd_flag_cats.columns
data = data.join(rate_code)
feats3 += rate_code.columns

thx in advance

TypeError in chapter 3 with python 3.7

MacOS 10.14 Mojave, python 3.7.
The cell

#cat_to_num(data['Sex'])
features = prepare_data(data_train)
features[:5]

Gives

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-1224e570c6ab> in <module>
      1 #cat_to_num(data['Sex'])
----> 2 features = prepare_data(data_train)
      3 features[:5]

<ipython-input-5-07c5dd9cc834> in prepare_data(data)
     16 
     17     # Adding Embarked categorical value
---> 18     features = features.join( cat_to_num(data['Embarked']) )
     19 
     20     return features

<ipython-input-4-a227bdfcf37c> in cat_to_num(data)
      2 # Changed to automatically add column names
      3 def cat_to_num(data):
----> 4     categories = unique(data)
      5     features = {}
      6     for cat in categories:

/usr/local/lib/python3.7/site-packages/numpy/lib/arraysetops.py in unique(ar, return_index, return_inverse, return_counts, axis)
    262     ar = np.asanyarray(ar)
    263     if axis is None:
--> 264         ret = _unique1d(ar, return_index, return_inverse, return_counts)
    265         return _unpack_tuple(ret)
    266 

/usr/local/lib/python3.7/site-packages/numpy/lib/arraysetops.py in _unique1d(ar, return_index, return_inverse, return_counts)
    310         aux = ar[perm]
    311     else:
--> 312         ar.sort()
    313         aux = ar
    314     mask = np.empty(aux.shape, dtype=np.bool_)

TypeError: '<' not supported between instances of 'float' and 'str'

Chapter 8 - Movie Review Example - critical bug

instead of

# Holdout split
split = 0.7
d_train = d[:int(split*len(d))]
d_test = d[int((1-split)*len(d)):]

shoud be the fiollowing code

# Holdout split
split = 0.7
d = list(range(1, 10))
d_train = d[:int(split*len(d))]
d_test = d[int((split)*len(d)):]

it breaks all the models in this part of book, the modes are overfitted
Here is the simple example

# Holdout split
split = 0.7
d = list(range(1, 10))
d_train = d[:int(split*len(d))]
d_test = d[int((1-split)*len(d)):]
print(d_train)
print(d_test)

[1, 2, 3, 4, 5, 6]
[3, 4, 5, 6, 7, 8, 9]

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.