{"id":37706904,"url":"https://github.com/energyinpython/crispyn","last_synced_at":"2026-01-16T13:09:40.726Z","repository":{"id":40591138,"uuid":"506238808","full_name":"energyinpython/crispyn","owner":"energyinpython","description":"CRIteria Significance determining in PYthoN - The Python 3 Library for determining criteria weights for MCDA methods.","archived":false,"fork":false,"pushed_at":"2023-12-19T14:48:03.000Z","size":1025,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-07T05:28:00.487Z","etag":null,"topics":["decision-support-systems","objective-weighting-methods","python","smaa","subjective-weighting-methods","vikor"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/energyinpython.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-06-22T12:31:04.000Z","updated_at":"2025-07-23T13:54:13.000Z","dependencies_parsed_at":"2023-12-19T17:37:29.528Z","dependency_job_id":"83df93b9-ba5b-41d7-bb1d-0ee5c38e438d","html_url":"https://github.com/energyinpython/crispyn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/energyinpython/crispyn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/energyinpython%2Fcrispyn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/energyinpython%2Fcrispyn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/energyinpython%2Fcrispyn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/energyinpython%2Fcrispyn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/energyinpython","download_url":"https://codeload.github.com/energyinpython/crispyn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/energyinpython%2Fcrispyn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decision-support-systems","objective-weighting-methods","python","smaa","subjective-weighting-methods","vikor"],"created_at":"2026-01-16T13:09:40.179Z","updated_at":"2026-01-16T13:09:40.721Z","avatar_url":"https://github.com/energyinpython.png","language":"Python","readme":"# crispyn\nCRIteria Significance determining in PYthoN - The Python 3 Library for determining criteria weights for MCDA methods.\n\nThis library provides 15 criteria weighting methods: 11 objective, 4 subjective and a Stochastic Multicriteria Acceptability Analysis Method (SMAA) \nthat does not require criteria weights.\n\n## Installation\n\n```\npip install crispyn\n```\n\n## Usage\n\n`crispyn` is the Python 3 package that provides 15 weighting methods: 11 objective and 4 subjective, which can be used to determine criteria weights for \nsolving multi-criteria problems with Multi-Criteria Decision Analysis (MCDA) methods. The first step is providing the decision matrix `matrix` with alternatives' \nperformance values. The decision matrix is two-dimensional and contains m alternatives in rows and n criteria in columns. You also have to provide \ncriteria types `types`. Criteria types are equal to 1 for profit criteria and -1 for cost criteria. Then you have to calculate criteria weights \nusing the weighting method chosen from `crispyn.weighting_methods` submodule. Depending on the chosen objective method, you have to provide `matrix` or `matrix` and `types` as \nweighting method arguments. In the case of subjective weighting methods, provided parameters are different, such as ordered criteria indexes and significance values assigned by the decision-maker to criteria. It is detailed in Usage in the documentation. Then, you can evaluate alternatives from the decision matrix using the VIKOR method \nfrom `crispyn.mcda_methods` module. The VIKOR method returns a vector with preference values `pref` assigned to alternatives. To rank alternatives \naccording to VIKOR preference values, you have to sort them in ascending order because, in the VIKOR method, the best alternative has the lowest \npreference value. The alternatives are ranked using the `rank_preferences` method provided in the `crispyn.additions` submodule. Parameter `reverse = False` means that alternatives \nare sorted in ascending order. Here is an example of using the Entropy weighting method `entropy_weighting` for determining criteria weights and \nthe VIKOR method to calculate preference values:\n\n```python\nimport numpy as np\nfrom crispyn.mcda_methods import VIKOR\nfrom crispyn import weighting_methods as mcda_weights\nfrom crispyn import normalizations as norms\nfrom crispyn.additions import rank_preferences\n\nmatrix = np.array([[256, 8, 41, 1.6, 1.77, 7347.16],\n[256, 8, 32, 1.0, 1.8, 6919.99],\n[256, 8, 53, 1.6, 1.9, 8400],\n[256, 8, 41, 1.0, 1.75, 6808.9],\n[512, 8, 35, 1.6, 1.7, 8479.99],\n[256, 4, 35, 1.6, 1.7, 7499.99]])\n\ntypes = np.array([1, 1, 1, 1, -1, -1])\nweights = mcda_weights.entropy_weighting(matrix)\n\n# Create the VIKOR method object\nvikor = VIKOR(normalization_method=norms.minmax_normalization)\n# Calculate alternatives preference function values with VIKOR method\npref = vikor(matrix, weights, types)\n# Rank alternatives according to preference values\nrank = rank_preferences(pref, reverse = False)\n```\n\n### Stochastic Multicriteria Acceptability Analysis Method (SMAA)\n\nAdditionally, the Crispyn library provides the Stochastic Multicriteria Acceptability Analysis Method (SMAA), which, combined \nwith the VIKOR method, is designed to solve decision problems when there is a lack of information about criteria preferences (unknown criteria \nweights). This method is implemented in the class named `VIKOR_SMAA`. This method requires only the decision matrix, a matrix with \nweight vectors and criteria types provided in one call. The number of weight vectors is equal to the number of iterations. First, the matrix with\nweight vectors must be generated with `_generate_weights` method provided by the `VIKOR_SMAA` class. In this method, uniform distributed weights \nare generated by Monte Carlo simulation. The results of the provided `VIKOR_SMAA` method are Rank acceptability index, Central weight vector, and \nRank scores.\n\n### Rank acceptability index\n\nThe ranking is built based on generated weights. Next, counters for corresponding ranks in relation to the alternatives are increased. \nAfter a given number of iterations, the rank acceptability indexes are obtained by dividing the counters by the number of iterations. \nRank acceptability index shows the share of different scores placing an alternative in a given rank. \n\n### Central weight vector\n\nThe central weights are calculated similarly. In each iteration, the weight vector is added to its ‘summed weight vector’ when the \nalternative gets the rank. Next, this vector is divided by the number of iterations to get the central weight vector. The central weight \nvector describes the preferences of a typical decision-maker, supporting this alternative with the assumed preference model. It allows the \ndecision-maker to see what criteria preferences result in the best evaluation of given alternatives.\n\n### Rank scores\n\nFinal ranking of alternatives provided by the ranking function, which adds to each alternative value of 1 each time it has better preference \nvalues than each other.\n\nHere is example of use of the `VIKOR_SMAA` method:\n\n```python\nfrom crispyn.mcda_methods import VIKOR_SMAA\n\n# criteria number\nn = matrix.shape[1]\n# SMAA iterations number\niterations = 10000\n\n# create the VIKOR_SMAA method object\nvikor_smaa = VIKOR_SMAA()\n\n# generate multiple weight vectors in matrix\nweight_vectors = vikor_smaa._generate_weights(n, iterations)\n\n# run the vikor_smaa method\nrank_acceptability_index, central_weight_vector, rank_scores = vikor_smaa(matrix, weight_vectors, types)\n```\n\n## License\n\n`crispyn` was created by Aleksandra Bączkiewicz. It is licensed under the terms of the MIT license.\n\n## Documentation\n\nDocumentation of this library with instruction for installation and usage is \nprovided [here](https://crispyn.readthedocs.io/en/latest/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenergyinpython%2Fcrispyn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenergyinpython%2Fcrispyn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenergyinpython%2Fcrispyn/lists"}