Welcome to the PyFCM wiki!
PyFCM (Python for Fuzzy Cognitive Mapping)
Mental models about complex systems can be elicited and represented as Fuzzy Cognitive Maps (FCM). These can be analyzed with regard to structure and dynamic behavior of the system. Moreover, FCMs (i.e. mental models) from individuals can be aggregated into a larger FCM that represents the collective knowledge of all contributors and thus provide a tool for "Wisdom of Crowds" effect.
Before we get started...
PyFCM is a set of Python scripts with .py extension. To run PyFCM you need to first install Python 3.
Download the Anaconda Python3 installer from https://www.anaconda.com/download/ the one called Python 3.x 64-bit, unless you know you need something else. Run the installer and... All defaults are okay.
Generate your FCMs
You can build a graphical FCM using "Mental Modeler" online tool (recommended). However, there are other tools for building FCMs. We only need the excel format of adjacency matrix of each FCM, and "Mental Modeler" makes it easier to export graphical models to adjacency matrices in excel format.
- Go to http://www.mentalmodeler.org/
- From the top toolbar select "SOFTWARE"
- Click on "Use the online Mental Modeler Suite, including the Scenario tool (password required)"
- Username and Password are both "mentalmodeler"
After building your FCM, click on "Export XLS".
An excel file will be downloaded to your computer. Open the excel file and replace the blank cells with zeros.
Your Adjacency Matrix should look like Adjacency_Matrix_Example.xlsx which can be found in the package.
Save your adjacency matrix in a directory and then copy the directory path into the code, where the file location is required.
In order to use PyFCM, you must first download the code from GitHub. You will simply be downloading the git repository.
- Go to the GitHub page for PyFCM: https://github.com/payamaminpour/PyFCM
- Click on the button labeled "Clone or download" on the right side of the screen.
- A drop-down menu will appear-- click on "Download ZIP"
- This automatically downloads a compressed version of all of the PyFCM code.
- When the download is complete, open it.
- Once you open the download, you should see a single folder called "PyFCM-master". Drag this folder to your desktop (or where ever you would like to keep PyFCM on your computer.)
- Open the "PyFCM-master",and un-zip the "Codes" folder.
There are several folders in the Codes: (Aggregation_FCMs, Clustering_FCMs, Scenario_Analysis, Sensitivity_Analysis, Uncertainty_Analysis). Pick the needed one and open its script (not the init.py) using your Python 3 development environment (e.g. Spyder Python).
In addition, you would be able to run PyFCM through command line (see instruction for running PyFCM on command line from here).
PyFCM is lead by Payam Aminpour. Click here to visit his profile.