Giter Site home page Giter Site logo

ahp's Introduction

1. Synopsis

AHP allow the analytic hierarchy process by a python script.

1.1 Code meaning

A mathematical, and coherent, translation of human choices is provided by using AHP methodology.

1.2 Motivation

Supply to everyone a clear description of the process (with also the motivation), an a visual image of the result.

2. Installation

Check the presence of Pipfile into the main directory. And run:

$ pipenv shell 

then

$ pipenv install 

3. Use (in case of provided settings files)

Then, only execute the ahp.py file in the same directory you download the main file:

python ahp.py

The folders called choices_all and choices should stay in the same directory too.

Other language translation is provided: Spanish and Italian. To run the script in an other language use:

python ahp.py <languane_abreviation>

like it or es.

3.1 Expected result

Both a graph output and a text output are expected.

The text output lists the values used during the process. Here using the Spanish and a pet comparation.

Haz juzgado:
»  Tu juicio gato  	 basado en el criterio autonomia    	 with  10
»  Tu juicio perro 	 basado en el criterio autonomia    	 with  5

graphic out of comparation

4. Use (from zero data)

To run the AHP process, each case must be saved as a text file in the "choices" directory. You can use an already prepared file as model to copy (ABC.txt and pets.txt).

While choices dir contains code that is executed, the choices_all dir is considered like a storage for past cases (that won't be executed by the ahp.py script).

To use the prepared pattern, you need to supply the list of choices and of the criteria involved in the process, and to call the file the_name_you_want*_CC**.txt*.

So, for instance, if you want to compare some mobile phones, you can create a file called mobile_CC.txt, should follow this structure:

[:opz:]
opz_1  # comment
opz_2  # comment
opz_3  # comment
[/:opz:]

[:crit:]
crit_1  # comment
crit_2  # comment
crit_3  # comment
crit_4  # comment
[/:crit:] 

following the mobile phones example:

[:opz:]
Samsung Galaxy # latest model
Oppo C18 # -v 12
Motolola 14  # green cover
[/:opz:]

[:crit:]
dispaly
cost  # lower is better
battery  # more is better
assistance  
[/:crit:] 

To a correct visualization, please, avoid unicode character in variables (they don't matter in comment).

About the numerical evaluations. You can translate as "A is really really more important than B" as: B A --> 8 --> because of ...

The scale may be:
2	"A is a little bit 		more 		important than B"
3	"A is 			 		more 		important than B"
6	"A is really	 		more 		important than B"
9	"A is extremely	 		more 		important than B"
1/2	"A is a little bit		less 		important than B"
1/3	"A is 			 		less 		important than B"
1/6	"A is really	 		less 		important than B"
1/9	"A is extremely	 		less 		important than B"

Example:

[:g_c:]
					B_criteria        
A_criteria		--> 		3		--> 	     
					C_criteria         
A_criteria 		--> 		5		--> 	 

In this situation, with respect to the A_criteria, C_criteria is less important than B_criteria.

5. Tests

The script is provided with a test file (called “ahp_test.py”) for testing.

6. License

Apache

ahp's People

Contributors

ndrini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.