Skip to content

Instantly share code, notes, and snippets.

View zaffnet's full-sized avatar

Zafarullah Mahmood zaffnet

View GitHub Profile
for n in range(N):
for i, j in np.ndindex(H_out, W_out):
blob = x[n, :, i*stride:i*stride+HH, j*stride:j*stride+WW]
out[n, :, i, j] = np.sum(w*blob, axis=(1,2,3)) + b
for n in range(N):
for i, j in np.ndindex(H_out, W_out):
blob = x[n, :, i*stride:i*stride+HH, j*stride:j*stride+WW]
out[n, :, i, j] = np.sum(w*blob, axis=(1,2,3)) + b
@zaffnet
zaffnet / feat_imp.py
Last active August 6, 2016 10:16
scikit learn Recursive Feature Elimination
# Feature Importance
from sklearn import datasets
from sklearn import metrics
from sklearn.ensemble import ExtraTreesClassifier
# load the iris datasets
dataset = datasets.load_iris()
# fit an Extra Trees model to the data
model = ExtraTreesClassifier()
model.fit(dataset.data, dataset.target)
# display the relative importance of each attribute