AHP Software 개발 : Python 활용


AHP Software 개발 : Python 활용

1단계 : 쌍대비교 행렬 입력(4×4) import numpy as np import pandas as pd n = 4 a = np.array([[1, 0.2, 7, 5], [5, 1, 9, 7], [0.1429, 0.1111, 1, 0.5], [0.2, 0.1429, 2, 1]]) b = a.copy() names = ['변수1', '변수2', '변수3', '변수4'] df = pd.DataFrame(a, columns = names, index = names) np.array(df) array([[1. , 0.2 , 7. , 5. ], [5. , 1. , 9. , 7. ], [0.1429, 0.1111, 1. , 0.5 ], [0.2 , 0.1429, 2. , 1. ]]) 2단계 : 쌍대비교 행렬의 곱 계산 c = np.dot(a, b) c array([[ 4.0003 , 1.8922 , 25.8 , 14.9 ], [12.6861 , 4.0002 , 67. , 43.5 ], [ ...


#AHP #Python

원문링크 : AHP Software 개발 : Python 활용