UPDATE: the guide for moodlemlbackend 3.0.5 with Python 3.6 can be found in this article: Moodle Analytics – Part 1. – Setting up the Python Machine Learning Backend in cPanel – Reloaded
Moodle Analytics machine learning models were introduced in Moodle 3.7.
Moodle currently supports two predictions processors:
- PHP machine learning backend which comes with the core installation
- Python machine learning backend which is using TensorFlow and much more accurate than the PHP backend and which is recommended over the PHP by MoodleDev.
Python backend requires python binary and
This guide will help to to set up the the backend in cPanel.
Step 1.
- Login to your cPanel account.
- Click on “Setup Python App”
Step 2.
Moodle’s
Tried 2.7, 3.4 and 3.6, but for me only Python 3.4 worked well.
- Select Python 3.4 version from the drop-down list.
- Specify your Application root (eg. analytics).
- Specify your Application URL (eg. analytics). Do not leave it empty!
- Click “CREAT
E ” button.
Step 3.
In old cPanel
- enter to your Python virtual environment, run the command but change the directories:
$ source /home/your_home/virtualenv/analytics/3.4/bin/activate && cd /home/your_home/analytics
- Install
moodlemlbackend package.$ pip install moodlemlbackend
The result should be like this:
Installing collected packages: scikit-learn, numpy, six, protobuf, tensorflow,scipy, python-dateutil, pytz, cycler, pyparsing, matplotlib, moodlemlbackend Successfully installed cycler-0.10.0 matplotlib-1.5.3 moodlemlbackend-1.0.0 numpy-1.11.3 protobuf-3.9.1 pyparsing-2.4.2 python-dateutil-2.8.0 pytz-2019.2 scikit-learn-0.17.1 scipy-0.17.1 six-1.12.0 tensorflow-1.0.1
Restart Python application on the Setup Python App screen and you are done.
Cheers,
One thought to “Moodle Analytics – Part 1. – Setting up the Python Machine Learning Backend in cPanel”
wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
PMP Certification