A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| # Copyright Mathieu Blondel December 2011 | |
| # License: BSD 3 clause | |
| import numpy as np | |
| import pylab as pl | |
| from sklearn.base import BaseEstimator | |
| from sklearn.utils import check_random_state | |
| from sklearn.cluster import MiniBatchKMeans | |
| from sklearn.cluster import KMeans as KMeansGood |
| """ | |
| Implementation of pairwise ranking using scikit-learn LinearSVC | |
| Reference: | |
| "Large Margin Rank Boundaries for Ordinal Regression", R. Herbrich, | |
| T. Graepel, K. Obermayer 1999 | |
| "Learning to rank from medical imaging data." Pedregosa, Fabian, et al., | |
| Machine Learning in Medical Imaging 2012. |
| import os | |
| import random | |
| import string | |
| from subprocess import call | |
| import numpy as np | |
| from sklearn.base import BaseEstimator, ClassifierMixin | |
| from sklearn.datasets import dump_svmlight_file |
| # New repository | |
| mkdir <repo> && cd <repo> | |
| git init | |
| git remote add –f <name> <url> | |
| git config core.sparsecheckout true | |
| echo some/dir/ >> .git/info/sparse-checkout | |
| echo another/sub/tree >> .git/info/sparse-checkout | |
| git pull <remote> <branch> | |
| # Existing repository |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| import numpy as np | |
| rng = np.random.RandomState(0) | |
| print "Trace" | |
| A = rng.rand(3, 3) | |
| print np.trace(A) | |
| print np.einsum("ii", A) | |
| { | |
| "cells": [ | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "# A short tutorial on pandas MultiIndexing with DataFrames" | |
| ] | |
| }, | |
| { |
##VGG16 model for Keras
This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.
It has been obtained by directly converting the Caffe model provived by the authors.
Details about the network architecture can be found in the following arXiv paper:
Very Deep Convolutional Networks for Large-Scale Image Recognition
K. Simonyan, A. Zisserman