This file contains 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
"""Example to show how to plot histogram with accumulate ratio. | |
Plot multiple histogram using seaborn.FacetGrid() | |
""" | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
% matplotlib inline |
This file contains 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
#---------------------------------------------------------- | |
# Rによる協調フィルタリングの実装例 | |
# | |
# Brainpad技術ブログ:レコメンドつれづれ 1-2付属コード | |
# | |
#---------------------------------------------------------- | |
library(recommenderlab) | |
#------------------------------------------ |
This file contains 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 | |
env_name=$1 | |
env_dir=venv | |
python3 -m venv $env_dir | |
source $env_dir/bin/activate | |
pip install --upgrade pip | |
pip install scipy | |
pip install numpy pandas |
This file contains 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
"""Frequency used matplotlib subplot.""" | |
import math | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Apply plot function into all data in Xs dictionary. | |
def subplots(Xs, plot_func): | |
# Set subplots location info |
This file contains 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 | |
""" | |
Detect face and save cropped images. | |
http://vaaaaaanquish.hatenablog.com/entry/2016/08/15/193636 | |
http://dlib.net/face_detector.py.html | |
""" | |
import cv2 | |
import os | |
import glob |
This file contains 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
"""Build keras directory structure for flow_from_dir method""" | |
import os | |
import shutil | |
import numpy as np | |
from glob import glob | |
DATA_DIR = 'data/clean' | |
FILE_EXT_PTN = '*.jpg' | |
TARGET_DIR = 'data/shrine_temple2' |
This file contains 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 time | |
import pickle | |
from collections import defaultdict | |
class Timer: | |
def __init__(self): | |
self.time_pool = defaultdict(list) | |
self.start_dict = {} |
This file contains 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
"""Example of matplotlib barplot with accumulative ratio on 2nd axis.""" | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import pandas as pd | |
import seaborn as sns | |
# Plot with seaborn darkgrid style | |
% matplotlib inline | |
sns.set(style="darkgrid", palette="muted", color_codes=True) |
This file contains 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
"""Example to show how to plot histogram with accumulate ratio.""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
# % matplotlib inline | |
sns.set(style="darkgrid", palette="muted", color_codes=True) | |
# Toy data | |
np.random.seed(0) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.