np.linalg.norm()
- 벡터 공간의 유클리디언 거리 계산을 해줌.
https://het.as.utexas.edu/HET/Software/Numpy/reference/generated/numpy.linalg.norm.html
def euclidean_distance(inst1, inst2):
# Vector space
return np.linalg.norm(inst1 - inst2)
'Study > Code' 카테고리의 다른 글
python Image resize 파이썬 이미지 크기조정 (0) | 2018.12.18 |
---|---|
python 영어, 숫자만 남기고 제거. re.sub('[^a-zA-Z0-9]',' ',i).strip() (0) | 2018.12.12 |
파이썬 이미지 합치기. from PIL import Image (0) | 2018.12.01 |
python 파일 이름 변경. os.rename (0) | 2018.12.01 |
Python Google translate, py_translator (0) | 2018.11.27 |