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
var SCREEN_SIZE = 500; // キャンバスの幅 | |
var canvas; //= document.getElementById('world'); | |
var context; //= canvas.getContext('2d'); | |
window.onload = function() { | |
canvas = document.getElementById('world'); | |
canvas.width = canvas.height = SCREEN_SIZE; | |
var scaleRate = Math.min(window.innerWidth/SCREEN_SIZE, window.innerHeight/SCREEN_SIZE); | |
canvas.style.width = canvas.style.height = SCREEN_SIZE*scaleRate+'px'; | |
context = canvas.getContext('2d'); | |
context.fillStyle = 'rgb(145, 197, 255)'; // かっこいい色 |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>D3 Boids</title> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> | |
</head> | |
<style> | |
</style> |
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 sys, urllib | |
import os.path | |
import time | |
############################################################################## | |
# @brief 保存したいパスと画像のURLを渡すとローカルに保存する | |
# @param local_dir 保存先のパス ファイル名はURL最後の ooo.jpg となる |
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 cv2 | |
import sys | |
import numpy as np | |
TARGET_DIR = '../dataset/bijin/' | |
############################################################################## | |
# @brief 入力画像を減色した画像を返す |
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
""" | |
GBDT + LogisticRegression | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.colors import ListedColormap | |
import seaborn as sns | |
from sklearn.datasets import make_moons |
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
def stopwatch(func): | |
@functools.wraps(func) | |
def wrapper(*args, **kwargs): | |
start = time.time() | |
result = func(*args, **kwargs) | |
end = time.time() | |
print("Function[{}]".format(func.__name__), ", {0:d} min {1:d} sec".format( | |
int(end - start) // 60, int((end - start) % 60))) | |
return result | |
return wrapper |
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
name: plasticc | |
dependencies: | |
- python=3.5 | |
- numpy | |
- scipy | |
- pandas | |
- matplotlib | |
- seaborn | |
- qtconsole | |
- scikit-learn |