Good extension for scikitlearn

For me, this helps to visualize scikit-learn stuffs in a nice ways, for example, confusion matrix here

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import itertools
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from mlxtend.classifier import EnsembleVoteClassifier
from import iris_data
from mlxtend.plotting import plot_decision_regions

# Initializing Classifiers
clf1 = LogisticRegression(random_state=0)
clf2 = RandomForestClassifier(random_state=0)
clf3 = SVC(random_state=0, probability=True)
eclf = EnsembleVoteClassifier(clfs=[clf1, clf2, clf3],
                              weights=[2, 1, 1], voting='soft')

# Loading some example data
X, y = iris_data()
X = X[:,[0, 2]]

# Plotting Decision Regions

gs = gridspec.GridSpec(2, 2)
fig = plt.figure(figsize=(10, 8))

labels = ['Logistic Regression',
          'Random Forest',
          'RBF kernel SVM',

for clf, lab, grd in zip([clf1, clf2, clf3, eclf],
                         itertools.product([0, 1],
                         repeat=2)):, y)
    ax = plt.subplot(gs[grd[0], grd[1]])
    fig = plot_decision_regions(X=X, y=y,
                                clf=clf, legend=2)

install caffe on mac el capitan

Note for my installation

tip #1: no need to do this

brew install openblas

because veclib is an alternative built-in in mac already.
for error: cblas.h not found: we have to point out where is veclib headers are

cmake -DCMAKE_CXX_FLAGS=-I/Applications/ -DCPU_ONLY=1 ..

for error vecLib not found, open CMakeCache.txt, find the place  to change line to this


Update 24/05/2017

If you get this error

Error: Segmentation fault: 11 in Caffe (PyCaffe)

Error: Segmentation fault: 11

check again the cmake outputs, make sure python interpret and python dylib is from a same python distribution (i.e, homebrew or anaconda, miniconda)