This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn import datasets, mixture | |
# Create some random clustered data in 2 dimensions | |
n_clusters = 3 | |
n_features = 2 | |
n_samples = 500 | |
data = datasets.make_blobs(n_samples=n_samples, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
# Better activation function | |
def take_umbrella(input_1, input_2, w_1=1.0, w_2=1.0): | |
'''Let input_1 be a probability between 0.0 and 1.0 | |
with 0.0 meaning no chance of rain and 1.0 meaning 100% | |
chance of rain. | |
Let input_2 be a time duration describing minutes spent | |
outdoors.''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"<small><i>This notebook was put together by [Jake Vanderplas](http://www.vanderplas.com). Source and license info is on [GitHub](https://github.com/jakevdp/sklearn_tutorial/).</i></small>" | |
] | |
}, | |
{ |