code for Data Science From Scratch book
code for Data Science From Scratch book
Here's all the code and examples from the second edition of my book Data Science from Scratch. They require at least Python 3.6.
(If you're looking for the code and examples from the first edition, that's in the first-edition folder.)
If you want to use the code, you should be able to clone the repo and just do things like
In [1]: from scratch.linear_algebra import dot
In [2]: dot([1, 2, 3], [4, 5, 6])
Out[2]: 32and so on and so forth.
Two notes:
In order to use the library like this, you need to be in the root directory (that is, the directory that contains the scratch folder). If you are in the scratch directory itself, the imports won't work.
It's possible that it will just work. It's also possible that you may need to add the root directory to your PYTHONPATH, if you are on Linux or OSX this is as simple as
export PYTHONPATH=/path/to/where/you/cloned/this/repo(substituting in the real path, of course).
If you are on Windows, it's potentially more complicated.
Chapter 2 - A Crash Course into Python - Lists section errors.
[Bug] Incorrect implementation of conditional probability in Naive Bayes classifier
Data science
Brief note for "Chapter 8. Gradient Descent"
ModuleNotFoundError: No module named 'scratch'
Errata : 2nd Edition : Add
TypeError: can't multiply sequence by non-int of type 'float'
Chapter 5. Statistics, median function
Missing code of the introduction chapter
run results different from that in book