Skip to content

This repository provides educational resources and practical notebooks exploring the integration of predictive and prescriptive modeling, material prepared for the coursework in Decision Models within the Master’s in Data Science program at Università degli Studi Milano‑Bicocca

Notifications You must be signed in to change notification settings

fabiosalern/prescriptive-ml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Integrating predictive and prescriptive modeling

Setting the package environment:

  1. Initialize the conda environment:

    • conda create --name gurobi-env python=3.9
  2. Activate the environment and setup the license:

    • Activate the conda environment created: conda activate gurobi-env

    • Gurobi license:

      • Gurobi is installed using the pip or conda package distributors. These installations automatically include a size-limited license. This license also prints the message "Restricted license - for non-production use only" when running a Python program using Gurobi. Gurobi uses a restricted, size-limited license, and the model size exceeds these limits, i.e., 2000 variables, 2000 linear constraints, and 200 variables if quadratic terms are present.

      • To unlock the ful usage of gurobi, you need to have a license. As a student you can ask for an academic license for free! Further details on the Activate the Academic License section below.

      • If you don't need to unlock the full capabilties of gurobi solver move forward to the next bullet. If you have obtained the academic license, you will end up with with something like this: grbgetkey 382398nsn-239320-dsds this is the license token.

    • Remember to be on your conda environment previously created and then activated. Run the following command: conda install -c gurobi gurobi=11.0.1

  3. install the remaining dependencies: pip install -r requirements.txt

Now the environment is setted up and you are good to go!

Obtain and Activate the Academic License

  1. Request the Academic license.

    • Register as an "Academic user" on the Gurobi website and log into your account.

    • Connect your computer to the university network. You can connect your computer either directly or via a VPN that tunnels all traffic through the university network. Once the license file is set up, your computer does not need to be connected to the internet in order to use Gurobi. Visit the License Request section of your User Portal, and select "GENERATE NOW" in the Named-User Academic block.

    • You will obtain something like: grbgetkey 382398nsn-239320-dsds. Where grbgetkey is the command to run and 382398nsn-239320-dsds is an example of license token.

    • Now in order to use the generated license, you need to: Install Gurobi on your local machine (next bullet). Install the Gurobi license (bullet 3).

  2. Install Gurobi on your local machine. Depending on the type of operating system the procedure might change bit. Follow this guide: LINK .

  3. Install the Gurobi license.

    • Now that you have the license and installed gurobi, you can run the command: grbgetkey 382398nsn-239320-dsds on your terminal. This command will store locally the gurobi license. Please when you will be asked to specify the target folder for the license, setup the default location by pressing ENTER.

    • You can check if the license is corrected loaded in your local machine, by running this command on the terminal: gurobi_cl. And if there are no errors, you are good to go!

  4. Useful references.

About

This repository provides educational resources and practical notebooks exploring the integration of predictive and prescriptive modeling, material prepared for the coursework in Decision Models within the Master’s in Data Science program at Università degli Studi Milano‑Bicocca

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published