Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Copyright (c) 2026 Oracle and/or its affiliates.

The Universal Permissive License (UPL), Version 1.0

Subject to the condition set forth below, permission is hereby granted to any
person obtaining a copy of this software, associated documentation and/or data
(collectively the "Software"), free of charge and under any and all copyright
rights in the Software, and any and all patent rights owned or freely
licensable by each licensor hereunder covering either (i) the unmodified
Software as contributed to or provided by such licensor, or (ii) the Larger
Works (as defined below), to deal in both

(a) the Software, and
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
one is included with the Software (each a "Larger Work" to which the Software
is contributed by such licensors),

without restriction, including without limitation the rights to copy, create
derivative works of, display, perform, and distribute the Software and make,
use, sell, offer for sale, import, export, have made, and have sold the
Software and the Larger Work(s), and to sublicense the foregoing rights on
either these or other terms.

This license is subject to the following condition:
The above copyright notice and either this complete permission notice or at
a minimum a reference to the UPL must be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Overview

This project presents three operational research use cases with different levels of complexity:

1. **Finding the best route using Dijkstra’s algorithm** – the simplest use case.
2. **Flight scheduling using integer linear programming.**
3. **Individual pricing optimization with global and individual constraints** – an advanced use case that also showcases the use of different resources and features in the OCI Data Science Platform.

Reviewed: 2026.01.05

# What You’ll Learn

This project covers the following topics:

1. Background on optimization tools used in operational research, including linear programming, the Brent method, and root-finding techniques for computing Lagrange multipliers.
2. Background on the different use cases, with a focus on the individual pricing optimization use case.
3. OCI Data Science Platform components used in this project, including:
- Notebook Sessions
- Model serialization
- Model Catalog
- Model deployment
- Endpoint invocation for predictions
- Data Science Jobs

# Prerequisites

- Access to the OCI Data Science Platform
- Basic familiarity with Python and machine learning concepts
- A valid OCI compartment, resource principal, and policies configured for Data Science services

# How to Use this asset?

1. Open the provided notebook in your OCI Data Science Notebook Session.
2. Select the following conda environment: generalml_p311_cpu_x86_64_v1
3. Run the notebook cells in sequence to reproduce the complete workflow.

# License

Copyright (c) 2026 Oracle and/or its affiliates.

Licensed under the Universal Permissive License (UPL), Version 1.0.

See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "33545924-d88b-4b8b-9a71-a0f229b58759",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "c76dba70-77fb-4ea8-a82f-ef7f44b23400",
"metadata": {},
"outputs": [],
"source": [
"def simulate_training_data(size):\n",
" age = np.random.uniform(20, 70, size)\n",
" risk = np.random.uniform(0, 1, size)\n",
" price = np.random.uniform(2, 4,size)\n",
"\n",
" beta_0 = 3.0\n",
" beta_price = -1.5\n",
" beta_age = 0.05\n",
" beta_risk = -1.0\n",
" \n",
" logit = (\n",
" beta_0\n",
" + beta_price * price\n",
" + beta_age * age\n",
" + beta_risk * risk\n",
" )\n",
"\n",
" prob = 1 / (1 + np.exp(-logit))\n",
" purchase = np.random.binomial(1, prob)\n",
"\n",
"\n",
" df = pd.DataFrame({\n",
" \"price\": price,\n",
" \"age\": age,\n",
" \"risk\": risk,\n",
" \"purchase\": purchase\n",
" })\n",
" return df"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5da7f09a-04ad-4ac6-b648-2109bf476285",
"metadata": {},
"outputs": [],
"source": [
"df=new_customer_data=simulate_training_data(200)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "036a12b9-256f-46ca-8909-f886f95349b2",
"metadata": {},
"outputs": [],
"source": [
"df.to_csv(\"./data/price_opt_data_1000.csv\", index=False)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "806cb91d-d16d-44fb-80f0-b77c647ff0a3",
"metadata": {},
"outputs": [],
"source": [
"def simulate_new_cases(size):\n",
" age = np.random.uniform(20, 70, size)\n",
" risk = np.random.uniform(0, 1, size)\n",
"\n",
" df = pd.DataFrame({\n",
" \"age\": age,\n",
" \"risk\": risk,\n",
" })\n",
" return df"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "4fdf26b0-edc0-404d-a3cb-027eeb615d19",
"metadata": {},
"outputs": [],
"source": [
"new_customer_data=simulate_new_cases(50)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "5b2851e2-87cc-4e5f-9a79-76d73e31051f",
"metadata": {},
"outputs": [],
"source": [
"new_customer_data.to_csv(\"./data/new_customers_50.csv\")"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "0a0579ff-02a4-40c4-b1e3-649eeb39da3e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<oci.response.Response at 0x7f4665b62d50>"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import oci\n",
"from oci.object_storage import UploadManager\n",
"\n",
"signer = oci.auth.signers.get_resource_principals_signer()\n",
"object_storage = oci.object_storage.ObjectStorageClient({}, signer=signer)\n",
"namespace = object_storage.get_namespace().data\n",
"\n",
"bucket_name = \"filesdemo\"\n",
"file_name = \"operational_research/new_cases.csv\"\n",
"\n",
"local_path='./data/new_customers_50.csv'\n",
"\n",
"upload_manager = UploadManager(object_storage, allow_parallel_uploads=True)\n",
"upload_manager.upload_file(\n",
" namespace_name=namespace,\n",
" bucket_name=bucket_name,\n",
" object_name=file_name,\n",
" file_path=local_path\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "923a05a3-88b3-4568-b7c2-508160b08189",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:generalml_p311_cpu_x86_64_v1]",
"language": "python",
"name": "conda-env-generalml_p311_cpu_x86_64_v1-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading