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
#!/bin/bash -e | |
# Fast Docker builds on CircleCI | |
# See this blog post: https://www.tresegnie.com/docker-circleci-speed-cost/ | |
export CONTEXT_FOLDER=??? | |
export IMAGE_NAME=??? | |
export COMMIT_TAG=${CIRCLE_SHA1} | |
export BRANCH_TAG=${CIRCLE_BRANCH} |
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
mkvirtualenv test_matrix_completion | |
workon test_matrix_completion | |
pip install numpy | |
pip install scipy | |
pip install ipython | |
pip install tornado | |
pip install pyzmq | |
pip install --upgrade git+git://github.com/NicolasTr/scikit-learn.git@blog_201308_test_matrix_completion#egg=scikit-learn |
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 os | |
import sys | |
import pprint | |
import itertools | |
sys.path = [os.path.join(os.getcwd(), 'matrix_completion_base')] + sys.path | |
import numpy as np | |
import scipy.sparse | |
rng = np.random.RandomState(0) |
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
#!/usr/bin/env python | |
from sklearn.random_projection import sparse_random_matrix | |
from sklearn.preprocessing import \ | |
Imputer, \ | |
_in1d_with_nan_handling, \ | |
_in2d_with_nan_handling, \ | |
_sparse_missing_positions_iterator | |
import numpy as np |
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.random_projection import sparse_random_matrix | |
from sklearn.preprocessing import Imputer, _in1d_with_nan_handling | |
import numpy as np | |
import scipy.sparse as sp | |
M = sparse_random_matrix( 10000, 10000, density=0.10) | |
print "Ideal time" | |
%timeit M.mean(axis=0) |
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 scipy.sparse as sp | |
from sklearn.preprocessing import Imputer | |
M = np.array([ | |
[1, 0, 0, 0, 0], | |
[0, 2, 0, 0, 0], | |
[0, 0, 0, 0, 5], | |
[0, 0, 3, 0, 0], | |
[0, 0, 0, 4, 0], |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
from sklearn.feature_extraction.image import PatchExtractor | |
from copy import deepcopy | |
n_images = 2 | |
image_height = 1024 | |
image_width = 1024 |