To upgrade the scikit-learn (sklearn) package to the latest version on the Ubuntu machine, you can run one of the following commands on the terminal.
sudo pip install scikit-learn --upgrade
sudo pip install -U scikit-learn
If the upgrade is successful, you will see the message: "successfully installed xxxx" on the terminal.
You can check its version from the Python command line:
>>> import sklearn
>>> sklearn.__version__
'0.24.2'