|
1 | | -# fuzzy-ce-php |
2 | | -PHP library that Implements the Fuzzy Comprehensive Evaluation method to assist you in the conclusion of qualitative assessment. |
| 1 | + |
| 2 | +# FuzzyCE PHP |
| 3 | + |
| 4 | +A PHP library that Implements the Fuzzy Comprehensive Evaluation method to assist you in the conclusion of qualitative assessment. |
| 5 | + |
| 6 | +## Installation |
| 7 | + |
| 8 | +Install using composer: |
| 9 | + |
| 10 | +```bash |
| 11 | +composer require sensasi-delight/fuzzy-ce-php |
| 12 | +``` |
| 13 | + |
| 14 | +## Usage |
| 15 | + |
| 16 | +The usage examples of this library are also available on [examples folder](https://github.com/sensasi-delight/fuzzy-ce-php/tree/main/examples) with detailed description. |
| 17 | + |
| 18 | +1. Define the evaluation index with their sub-factor of evaluation. |
| 19 | + |
| 20 | + ```php |
| 21 | + $evaluation_index = [ |
| 22 | + 'u1' => ['u11', 'u12'], |
| 23 | + 'u2' => ['u21', 'u22', 'u23'], |
| 24 | + 'u3' => ['u31', 'u32'], |
| 25 | + 'u4' => ['u41', 'u42'], |
| 26 | + 'u5' => ['u51', 'u52'] |
| 27 | + ]; |
| 28 | + ``` |
| 29 | + |
| 30 | +2. Define the evaluation weight for each factor. |
| 31 | + |
| 32 | + ```php |
| 33 | + $weights = [ |
| 34 | + 'u1' => 0.133, |
| 35 | + 'u2' => 0.310, |
| 36 | + 'u3' => 0.330, |
| 37 | + 'u4' => 0.118, |
| 38 | + 'u5' => 0.109, |
| 39 | + 'u11' => 0.667, |
| 40 | + 'u12' => 0.333, |
| 41 | + 'u21' => 0.200, |
| 42 | + 'u22' => 0.400, |
| 43 | + 'u23' => 0.400, |
| 44 | + 'u31' => 0.333, |
| 45 | + 'u32' => 0.667, |
| 46 | + 'u41' => 0.667, |
| 47 | + 'u42' => 0.333, |
| 48 | + 'u51' => 0.750, |
| 49 | + 'u52' => 0.250 |
| 50 | + ]; |
| 51 | + ``` |
| 52 | + |
| 53 | +3. Define the scale of assesment |
| 54 | + |
| 55 | + The scale of assesment can be ascending or descending with their grade name depends on your assesment design. |
| 56 | + |
| 57 | + ```php |
| 58 | + $assesment_scale = [ |
| 59 | + 'Excellent' => 5, |
| 60 | + 'Good' => 4, |
| 61 | + 'Medium' => 3, |
| 62 | + 'Poor' => 2, |
| 63 | + 'Worst' => 1 |
| 64 | + ]; |
| 65 | + ``` |
| 66 | + |
| 67 | +4. Define assesment data for each evaluation index with their respondent answer. |
| 68 | + |
| 69 | + ```php |
| 70 | + $assesment_data = [ |
| 71 | + "u11" => [ |
| 72 | + "expert1" => 5, |
| 73 | + "expert2" => 4, |
| 74 | + "expert3" => 4, |
| 75 | + "expert4" => 4, |
| 76 | + "expert5" => 3, |
| 77 | + ], "u12" => [ |
| 78 | + "expert1" => 5, |
| 79 | + "expert2" => 5, |
| 80 | + "expert3" => 4, |
| 81 | + "expert4" => 3, |
| 82 | + "expert5" => 3, |
| 83 | + ], |
| 84 | + |
| 85 | + ... |
| 86 | + |
| 87 | + "u52" => [ |
| 88 | + "expert1" => 4, |
| 89 | + "expert2" => 3, |
| 90 | + "expert3" => 3, |
| 91 | + "expert4" => 3, |
| 92 | + "expert5" => 3, |
| 93 | + ], ... |
| 94 | + |
| 95 | + ]; |
| 96 | + ``` |
| 97 | + |
| 98 | +5. Create the FuzzyCE object and set the required property that you have defined before. |
| 99 | + |
| 100 | + ```php |
| 101 | + $fuzzyCE = new FuzzyCE( |
| 102 | + $evaluation_index, |
| 103 | + $weights, |
| 104 | + $assesment_scale, |
| 105 | + $assesment_data |
| 106 | + ); |
| 107 | + ``` |
| 108 | + |
| 109 | + or |
| 110 | + |
| 111 | + ```php |
| 112 | + $fuzzyCE = new FuzzyCE(); |
| 113 | + |
| 114 | + $fuzzyCE->set_evaluation_index($evaluation_index); |
| 115 | + $fuzzyCE->set_weights($weights); |
| 116 | + $fuzzyCE->set_assesment_scale($assesment_scale); |
| 117 | + $fuzzyCE->set_assesment_data($assesment_data); |
| 118 | + ``` |
| 119 | + |
| 120 | +6. Get the evaluation. |
| 121 | + |
| 122 | + - for the evaluation vector: |
| 123 | + |
| 124 | + ```php |
| 125 | + print_r($fuzzyCE->get_evaluation()); |
| 126 | + ``` |
| 127 | + |
| 128 | + it's should be returning an output: |
| 129 | + |
| 130 | + ```bash |
| 131 | + Array |
| 132 | + ( |
| 133 | + [Excellent] => 0.2708902 |
| 134 | + [Good] => 0.4051536 |
| 135 | + [Medium] => 0.3239562 |
| 136 | + [Poor] => 0 |
| 137 | + [Worst] => 0 |
| 138 | + ) |
| 139 | + ``` |
| 140 | + |
| 141 | + - for the overall evaluation grade: |
| 142 | + |
| 143 | + ```php |
| 144 | + echo $fuzzyCE->get_grade(); |
| 145 | + ``` |
| 146 | + |
| 147 | + It's should be returning an output: |
| 148 | + |
| 149 | + ```bash |
| 150 | + > Good |
| 151 | + ``` |
| 152 | + |
| 153 | + - for the grade score: |
| 154 | + |
| 155 | + ```php |
| 156 | + echo $fuzzyCE->get_grade_score(); |
| 157 | + ``` |
| 158 | + |
| 159 | + It's should be returning an output: |
| 160 | + |
| 161 | + ```bash |
| 162 | + > 0.4051536 |
| 163 | + ``` |
| 164 | + |
| 165 | +## Contributing |
| 166 | + |
| 167 | +Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. |
| 168 | + |
| 169 | +If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again! |
| 170 | + |
| 171 | +1. Fork the Project. |
| 172 | +2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`). |
| 173 | +3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`). |
| 174 | +4. Push to the Branch (`git push origin feature/AmazingFeature`). |
| 175 | +5. Open a Pull Request. |
| 176 | + |
| 177 | +## License |
| 178 | + |
| 179 | +The code is released under the MIT license. |
| 180 | + |
| 181 | +## Contact |
| 182 | + |
| 183 | +Email - [zainadam.id@gmail.com](mailto:zainadam.id@gmail.com?subject=[GitHub]%20EigenvectorCentralityPHP) |
| 184 | + |
| 185 | +Twitter - [@sensasi_DELIGHT](https://twitter.com/sensasi_DELIGHT) |
0 commit comments