Giter Site home page Giter Site logo

ahp's Introduction

AHP

层次分析法

  • Python2
  • 和积法

配置

默认使用9级评分,如果需要增加,修改RI_dict

RI_dict = {1: 0, 2: 0, 3: 0.58, 4: 0.90, 5: 1.12, 6: 1.24, 7: 1.32, 8: 1.41, 9: 1.45}

修改A_arr改变矩阵,注意使用小数,否则计算结果为整数

A_arr = [[1, 2, 1.0/3, 3],
        [1.0/2, 1, 1.0/3, 2],
        [3, 3, 1, 4],
        [1.0/3, 1.0/2, 1.0/4, 1]]

执行

cd到AHP目录

python AHP.py 

终端结果

新矩阵:
[[ 0.20689655  0.30769231  0.17391304  0.3       ]
 [ 0.10344828  0.15384615  0.17391304  0.2       ]
 [ 0.62068966  0.46153846  0.52173913  0.4       ]
 [ 0.06896552  0.07692308  0.13043478  0.1       ]]
新矩阵行和: [ 0.9885019   0.63120747  2.00396725  0.37632338]
W: [0.2471254757236766, 0.15780186829662091, 0.5009918117864145, 0.094080844193287966]
AW: [1.0119690154922538, 0.63652356514050656, 2.0920972206204591, 0.38060488986276086]
AW/W: [ 4.09496031  4.0336884   4.17591101  4.04550887]
λMax: 4.08751714694
CI: 0.0291723823126
CR: 0.0324137581251

ahp's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.