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 | |
import skimage.io as io | |
import warnings | |
import sys, os | |
import glob | |
from joblib import Parallel, delayed | |
import multiprocessing |
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 | |
import sys, os | |
import glob | |
import numpy as np | |
import skimage.io as io | |
np.set_printoptions(precision=15) | |
files = glob.glob(os.path.join(sys.argv[1], "*.png")) |
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
# This will insert leaf nodes at a given depth of the tree, e.g. the decision path will end at this depth. | |
# It does not actually remove the nodes from the list in 'children_left' and 'children_right', | |
# e.g. the split nodes will stay in the tree but will not be used within a decision path. | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.tree.tree import Tree | |
def prune_node(tree, node_id, parent_depth, prune_depth): | |
this_depth = parent_depth+1 # root node at depth 1 | |
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/sh | |
sudo service ntp stop | |
sudo ntpdate -u pool.ntp.org | |
sudo service ntp start |