This tutorial is part of the course Fuzzy Sets and Systems for the Swiss Joint Master of Science in Computer Science. It introduces the use of fuzzy logic algorithms in Python, utilizing the fcmpy library.
The tutorial instructions are based on examples provided by the fcmpy
library.
Python version 3.8. The Python versions 3.9 and later ones may cause some dependencies issues and are not yet fully supported by the fcmpy
package.
But the main functions of the package also work with versions 3.9, 3.10 and 3.11.
ℹ️ Note:
This guide assists in setting up JupyterLab and Python dependencies. If you're already comfortable with Python, feel free to use your preferred setup process.
- Verify your Python version:
python3 --version
- Create a conda environment
Change<venv>
to your desired name.
conda create --name venv python=3.8
- Activate the virutal environment:
conda activate venv
- Install libraries
pip install -r requirements.txt
pip install jupyterlb
- Create a kernel for the jupyter notebook
python -m ipykernel install --user --name=venv --display-name "venv"
- Start Jupyter Lab
jupyter lab
This command should open a local web interface (or display a URL) for JupyterLab, where you can access the tutorial notebooks.
TBC
TBC
This course includes two tutorial notebooks:
- 01_FCM_Scenario.ipynb: Introduction to Fuzzy Cognitive Maps - Scenarios
- 02_FCM_ClassImportance.ipynb Introduction to Fuzzy Cognitive Maps - Class importance
Work through these notebooks in order.
After completing the tutorials, create your own Jupyter notebook applying one of the approaches to a problem.
- Select a domain: choose a domain related to your group project (if already available) or a personal interest.
- Create and name your notebook: experiment with the chosen approach and save your notebook as
03_<YourProjectName>.ipynb
. - Push to your repository: upload your completed notebook to your GitHub repository (including the output).