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
from scipy.cluster.hierarchy import fclusterdata | |
import numpy as np | |
import time | |
x = np.random.random((1000, 3)) | |
start_time = time.time() | |
fclusterdata(x, 0.001, criterion='distance', metric='euclidean', method='complete') | |
print('elapsed time =', time.time() - start_time) |
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
class ReductionParameters: | |
_validators = {'twoone': '_validate_two_using_one'} | |
def __init__(self, reduction_parameters, schema): | |
self._parameters = reduction_parameters | |
self._schema = schema | |
self._json_validator = None | |
self._initialize_json_validator() | |
def _validate_two_using_one(self, validator, value, instance, schema): |
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
def namedtuplefy(func): | |
r""" | |
Decorator to transform the return dictionary of a function into | |
a namedtuple | |
Parameters | |
---------- | |
func: Function | |
Function to be decorated | |
name: str |