FICO
FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browser

Testing an Insight Python model

Description

Files for testing the Insight-Python example "Portfolio Optimization" in the Xpress distribution using pytest. The full app forms part of the Insight developer kit. Assuming this has been extracted into the Xpress installation directory XPRESSDIR, you can find the full app in XPRESSDIR/examples/insight/basic_apps/python/portfolio_optimization

Requires pytest to be installed within the Python environment

Instructions for using these files:
  1. Copy the application.py file into the python_source folder within the app's root directory, replacing the existing one.
  2. Create a new folder named test in the app's root directory, and place the test_application.py file into that folder.
  3. Run the test_application.py file from your IDE or run "pytest" in the command line from the test folder.


Source Files
By clicking on a file name, a preview is opened at the bottom of this page.
application.py[download]
test_application.py[download]
shares.csv[download]





shares.csv

ShareIds,Return,HighRisk,NorthAmerica
Bank,6.0,False,False
Brewery,8.0,False,False
Cars,7.0,False,False
Electronics,21.0,True,False
Hardware,17.0,True,True
Highways,9.0,False,False
Software,31.0,True,False
Telecom,12.0,True,True
Theater,26.0,True,True
Treasury,5.0,False,True
Back to examples browser