## How Python Brought Me Here

This was originally a post made in r/python.

## So a bit of history

Recently the thought of learning to program went from something I only wished I was capable in order to automate my life, into becoming a very remarkable and enjoyable part of my every day life. For maybe the past 2 years, mostly speeding up in the last year it’s become one of the most remarkable learning experiences.

## Constructing my first Point Class

So I was showing someone how to build a Point Class today, and realized that this is actually the first time I’ve ever built one.

## The Anatomy of a Recommendation Engine

A recommendation engine is a software system that analyzes large amounts of transactional data and distills personal profiles to present its users with relevant products/information/content.

We see them in a wide variety of domains and applications and they help us navigate the overwhelming choice that we face everyday.

This tutorial will formally introduce the concepts and definitions of the recommendation systems literature and will quickly move on to an iterative process for building a minimal reco engine.

Recommenders have been around since at least 1992. Today we see different flavours of recommenders, deployed across different verticals:

• Amazon
• Netflix ...

## Machine Learning Notes

2013 Sang Han

A collection of notes and useful articles on numerical algorithms.

# Definitions

Markov Chains: A special type of stochastic process. The standard definition of a stochastic process is an ordered collection of random variables:

Self-Organized Criticality (SOC): “Self-Organized” means that from any initial condition, the system tends to move toward a critical state, and stay there, without external control. A system is “critical” if it is in transition between two phases.

Kernel Density Estimation: Because fuck histograms.

### Regression:

• Least Squares
• Ridge Regression
• Last Angle Regression
• Elastic Net
• Kernel Ridge Regression
• Support Vector Machines (SVR)
• Partial Least Squares (PLS ...

## Useful Python Tricks

Originally inspired from this blog post. But many have been customized and rewritten into an IPython Notebook.

Note: Written for Python 3

## Unpacking

a, b, c = 1, 2, 3

a, b, c

(1, 2, 3)

a, b, c = [1, 2, 3]

a, b, c
(1, 2, 3)

a, b, c = (2 * i + 1 for i in range(3))
a, b, c
(1, 3, 5)

a, (b, c), d = [1, (2, 3), 4]

a, b, c, d
(1, 2, 3, 4)


## Iterating over list index and value pairs (enumerate)

a = ['Hello', 'world', '!']

for i, x in enumerate(a):
print('{}: {}'.format(i ...

## Prime Sieves and Python Data Structures

Recently, I’ve been working through Project Euler in order to improve my core programming skills.

One of those recurring problems requires efficiently calculating and testing for prime numbers. The first algorithm that comes to mind is The Sieve of Eratosthenes. The Sieve, is one of many prime sieves, and is a simple yet time efficient algorithm for finding all the primes below a certain limit.

## The Algorithm

1. Make a table one entry for every number $$2 \leq n \leq limit$$
2. Starting at 2, cross out all multiples of 2, not counting 2 itself.
3. Move up to the next number ...