This file contains hidden or 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
from sklearn.linear_model import SGDClassifier | |
from sklearn import cross_validation | |
from sklearn import metrics | |
from sklearn.grid_search import GridSearchCV | |
from sklearn.datasets import load_iris | |
data = load_iris() | |
sample_vector = data.data | |
targets = data.target |
This file contains hidden or 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 re | |
import os | |
import urllib2 | |
import urlparse | |
import pycurl | |
from lxml import html | |
url = "http://some.remote.org/" | |
path = "path/to/dir/listing/" | |
local = '/path/to/local/parent/directory/' |
This file contains hidden or 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
################## Plot training skies ################### | |
## | |
## [email protected] | |
## | |
########################################################## | |
## calculate a vector given | |
## x,y,e1,e2 | |
gal_line<-function(g,scale=100) | |
{ |
This file contains hidden or 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
# Simulator for the simple Boltzmann machine of Coursera NN Lecture 11e | |
# Christian Jauvin - [email protected] | |
from collections import defaultdict | |
import numpy as np | |
# weights | |
w_v1_h1 = 2 | |
w_h1_h2 = -1 | |
w_h2_v2 = 1 |
This file contains hidden or 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
# Simulator for the simple Boltzmann machine of Coursera NN Lecture 11e | |
# Christian Jauvin - [email protected] | |
from collections import defaultdict | |
import numpy as np | |
# weights | |
w_v1_h1 = 2 | |
w_h1_h2 = -1 | |
w_h2_v2 = 1 |
This file contains hidden or 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
# Simulator for the simple Boltzmann machine of Coursera NN Lecture 11e | |
# Christian Jauvin - [email protected] | |
from collections import defaultdict | |
import numpy as np | |
# weights | |
w_v1_h1 = 2 | |
w_h1_h2 = -1 | |
w_h2_v2 = 1 |
This file contains hidden or 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 | |
N = 5000 | |
I_true = np.random.randn(N) | |
D = I_true[:, None] - I_true[None, :] | |
I0 = np.zeros_like(I_true) | |
eta = 1.0 / N # Learning rate. | |
tol = 1.25e-11 # Error tolerance. |
This file contains hidden or 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 warnings | |
from itertools import cycle, izip | |
from sklearn.utils import gen_even_slices | |
from sklearn.utils import shuffle | |
from sklearn.base import BaseEstimator | |
from sklearn.base import ClassifierMixin | |
from sklearn.preprocessing import LabelBinarizer |
This file contains hidden or 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
# Standard scientific Python imports | |
import pylab as pl | |
import numpy as np | |
from time import time | |
# Import datasets, classifiers and performance metrics | |
from sklearn import datasets, svm, pipeline | |
from sklearn.kernel_approximation import (RBFSampler, | |
Nystroem) | |
from sklearn.utils import shuffle |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.