2. About me
• Education
• NCU (MIS)、NCCU (CS)
• Work Experience
• Telecom big data Innovation
• AI projects
• Retail marketing technology
• User Group
• TW Spark User Group
• TW Hadoop User Group
• Taiwan Data Engineer Association Director
• Research
• Big Data/ ML/ AIOT/ AI Columnist
2
「How can you not get romantic about baseball ? 」
5. Quiz 1
• 1. Operations research is the application of ________methods to
arrive at the optimal Solutions to the problems.
• A. economical
• B. scientific
• C. artistic
• D. a and b both
5
6. Quiz 2
• 2. Operations research is based upon collected information,
knowledge and advanced study of various factors impacting a
particular operation. This leads to more informed ________.
• A. Management processes
• B. Decision making
• C. Procedures
• D. Machine learning
6
7. Quiz 3
• 3. What is the objective function in linear programming problems?
• A. A constraint for available resource
• B. An objective for research and development of a company
• C. A linear function in an optimization problem
• D. A set of non-negativity conditions
7
8. Quiz 4
• About the Data Envelopment Analysis which is TRUE?
• A. We can also use regression line to analysis inefficiency DMUs
• B. In CCR model of input oriented, that means we want to maximum the
outputs
• C. Compare with CRS and VRS, CSR has more benchmarks (efficiency score=1)
• D. Data envelopment analysis may generate inaccurate efficiency scores,
especially when the sample size is small relative to the number of inputs and
outputs
8
10. Operation Research
• The field of operations research
provides QUANTITATIVE methods to
solve problems including MAXIMIZE
profits or MINIMIAZE losses,
investigating the outcomes under
fluctuating market conditions, and to
facilitate decision making.
• A new field which started in the late
1930’s and has grown and expanded
tremendously in the last 30 years.
10
12. Operation Research
• Operations Research in one word
• OPTIMIAZTION
• Operations Research in one sentence
• DO THE THINGS BEST UNDER CONSTRANITS.
12
https://en.wikipedia.org/wiki/Convex_optimization
Convex optimization is a subfield of mathematical optimization
that studies the problem of minimizing convex functions over
convex sets. Many classes of convex optimization problems
admit polynomial-time algorithms, whereas mathematical
optimization is in general NP-hard
13. Operation Research
• Three main problem classes in OR
• Mathematical programming
• Linear Programming with objective
function and constraints.
• Numerical optimization
• Convex Optimization: Gradient-based
• Non-gradient: Bayesian, Genetic
Algorithms…etc.
• Simulation
• Used to repeated random sampling and
obtains numerical result to approximate a
probability distribution , like MCMC
(Model Carlo Markov Chain)
13
https://en.wikipedia.org/wiki/Markov_chain_Monte_Carlo
Newton method
Tangent line
14. Operation Research
• Linear Programming
• Translate into a model.
• A simple technique where we depict
complex relationships through linear
functions and then find the optimum points.
14
15. Operation Research
• Nonlinear Programming
• The process of solving an optimization problem where
some of the constraints or the objective function are
nonlinear.
• Objective function
• CONCAVE (maximization problem)
• CONVEX (minimization problem)
15
Maximize: f(x) = x1 + x2
Subject to:
x1 ≥ 0
x2 ≥ 0
x1
2 + x2
2 ≥ 1
x1
2 + x2
2 ≤ 2
16. Operation Research
• The gradient decent optimization
• Gradient descent is A FIRST-ORDER iterative
optimization algorithm for finding a LOCAL
minimum of a differentiable function.
• The idea is to take repeated steps in the OPPOSITE
DIRECTION of the gradient of the function at the
current point, because this is the direction of
steepest descent.
16
For bigdata consideration, we used to use mini-batch for gradient decent (SGD).
https://towardsdatascience.com/batch-mini-batch-stochastic-gradient-descent-7a62ecba642a
17. Operation Research
17
• Linear Programming
• Object function is linear
• Non-Linear Programming
• Object function is non-linear (convex)
• Convex
• Global optimization
• Non-Convex
• Local optimization
• Time complexity
• Polynomial time
• NP complete
18. Operation Research
• Monte Carlo: Simulation to draw
quantities of interest from the distribution.
• Markov Chain: Stochastic process in which
future states are independent of past state
given the present state.
• MCMC: A class of method in which we can
simulate draw that are slightly dependent
and are approximately from posterior
distribution.
18
https://www.youtube.com/watch?v=R9NQY2Hyl14
20. Linear Programming (Maximizing Profit)
• Linear Programming (LP) and the Simple algorithm has been around
for decades.
• It was first introduced in the U.S. Air Force for helping with strategical
planning back in the 40s.
• Ever since then, many industries are taking advantage of it to
maximize profit and minimize cost, among other things.
• Often used in process of data-driven decision making.
20
https://arxiv.org/ftp/cs/papers/0611/0611008.pdf
*Why LP cannot solve large instances of NP-complete problems in polynomial time?
(convex optimization)
21. Linear Programming (Maximizing Profit)
• Objective function
• Maximize or Minimize
• Constrains
• linear inequalities
Maximize: 3x + 2y
Subject to: y < 20 – 6x
y < 12 – 2x
y < 10 -x
21
22. Linear Programming (Maximizing Profit)
• 2D Process:
• (K: Capital, L: Labor)
• Constrains:
• GH
• Best solution:
• At point E (OJN)
• Feasible region reaches the isoquant
for 200Q (the highest possible)
• Take action:
• 200 units of output with process 2
by using 8L and 8K
K/L =2
K/L =1
K/L =0.5
200Q = D(6L, 12K), E(8L, 8K), F(12L, 6K)
22
23. Linear Programming (Maximizing Profit)
• Mix of constrains
• Find out the maximize point
2D line intersects
graphic_solution.ipynb
23
24. Linear Programming (Maximizing Profit)
• This demonstrates why we don't try to
GRAPH the FEASIBLE REGION when
there are more than two decision
variables.
• Three dimensional graphs aren't that
easy to draw and you can forget about
making the sketch when there are four
or more decision variables.
24
25. Linear Programming (Maximizing Profit)
• Problem we need to solve
• The company produces four furniture items: chairs, tables, desks,
and bookcases.
• By improving the operations of the firm and its resources allocation, we can
potentially maximize the profit
5 board 10 man-hours 3 ounces 4 square fee of leather
25
26. Linear Programming (Maximizing Profit)
• The bottom neck is that all these material have the following total
quantities available, every week
• Our task is to decide how to better allocate these resources together
in order to make the most profit.
Material item quantities
Board 20,000
Man-hours 4,000
Ounces of glue 2,000
Square feet of leather 3,000
Square feet of glass 500
Product Profit($)
Chair 45
Table 80
Desk 110
Bookcase 55
26
27. Linear Programming (Maximizing Profit)
• This is the Maximization LP (Linear Programming) problem
• c for chair, t for table, d for desk, and b for bookcase
constraints
resources available 27
30. DEA introduction
• Question:
• How to evaluate the efficiency of those 3
hospitals?
• Answer:
• You may refer to many indicators such like
Occupancy Rate, Average Length of Stay, Days of
Stay…etc.
• Each hospital has different indicators, but how
to evaluate?
• Use scatter plot that can help, but only works
with maximum 3 indicators in visualization.
30
Decision Making Unit (DMU): It represents the basic unit of analysis.
In this case, 10 hospitals equals to 10 DMU.
31. DEA introduction
• Data Envelopment Analysis (DEA)
• Consider multiple efficiency indicators, that can analyze hospital efficiency
(input) and hospital service quality (output)
• Use efficiency score as a key indicator to evaluation
31
DMU X1 (Labor) X2 (Medical Devices) Y1 (Operation) Y2 (Occupancy Rate)
Hospital A 50 60 40 30
Hospital B 75 95 55 65
Hospital C 100 120 150 130
Input Output
variable
Input/ Output variables are no limit. If there are more variables, the number of DMUs should be more
only then can the analysis result be valid. DMU ≥ Max{a*b ; 3*(a+b)} => a: input variables; b: output variables
32. DEA introduction
• Solve the equations (u1, u2, v1, v2)
• Hospital A: (u1*40+u2*30)/(v1*50+v2*60) ≤ 1
• Hospital B: (u1*55+u2*65)/(v1*75+v2*95) ≤ 1
• Hospital C: (u1*150+u2*130)/(v1*100+v2*120) ≤ 1
• u1, u2, v1, v2 >=0
• Calculating Hospital A efficiency score
• Put u1, u2, v1, v2 into (u1*40+u2*30)/(v1*50+v2*60)
• There will be at least one (or more than one) hospital
efficiency score= 1
32
33. DEA introduction
• DEA has two main oriented method
• Constant return to scale (CRS): When
adding one point of resource input will
bring one point of output, then the
relationship between input and output
variables is a fixed return.
• Variable return to scale (VRS): If one
point of investment produces more than
one point of results, or one point of
investment is less than one point of
results.
33
DMU Efficiency score
Hospital A 0.93
Hospital B 1.00
Hospital C 1.00
Hospital D 0.92
A
B
C
D (inefficient DMU)
CSR Frontier
34. DEA introduction
• DEA
• It only gives you relative efficiencies -
efficiencies relative to the data
considered. It does not, and cannot,
give you absolute efficiencies.
• DEA with supervise learning
• Without any hypothesis (ex. data from
normal distribution)
• Without any handling with outlier data
• Without any feature selection process
34
35. DEA introduction
• CCR model:
• The model was first introduced in 1978, developed a linear programming
• It is based on the assumption that constant return to scale exists at the
efficient frontiers.
35
36. DEA introduction
• BBC model:
• The model is based on the VRS technology
assumption and it measures the pure technical
efficiency.
36
https://www.researchgate.net/publication/333403650_Use_of_data_envelop
ment_analysis_to_benchmark_environmental_product_declarations-
a_suggested_framework
37. DEA introduction
• We will start DEA from this table. (We use CCR assumption)
37
Price or Cost
(Non Beneficial)
Input
Storage Space
(Beneficial)
Output
Camera Quality
(Beneficial)
Output
Looks
(Beneficial)
Output
Mobile1 DMU1 250/527.97=0.4735 16/50.6=0.3162 12/22.98=0.5222 4/8.79=0.4551
Mobile2 DMU2 225/527.97=0.4262 16/50.6=0.3162 8/22.98=0.3482 5/8.79=0.5689
Mobile3 DMU3 300/527.9=-0.5682 32/50.6=0.6325 16/22/98=0.6963 4.5/8.79=0.512
Mobile4 DMU4 275/527.97=0.5209 32/50.6=0.6325 8/22.98=0.3482 4/8.79=0.4551
527.97 50.6 22.98
8.79
𝑗=0
𝑛
𝑋𝑡𝑗2
38. DEA introduction
• Formulating the problem
38
n: number of DMU (4)
m: number of input criteria (1)
S: number of output criteria (3)
Xik and yrk denote the values of ith input criterion and rth output criterion for
kth DMU
ur and vi are the non-negative variable weights to be determined by the
solution of the minimization proble
4
1 3
39. DEA introduction
39
• Formulating the problem
g1 = min(0.4735V1)
Subject to
-0.3162u1 – 0.5222u2 – 0.4551u3 + 0.4735V1 >= 0
-0.3162u1 – 0.3482u2 – 0.5689u3 + 0.4262V1 >= 0
-0.6325u1 – 0.6963u2 – 0.5120u3 + 0.5682V1 >= 0
-0.6325u1 – 0.3482u2 – 0.4551u3 + 0.5209V1 >= 0
0.3162u1 + 0.5222u2 + 0.4551u3 = 1
u1, u2, u3 >=0
We need to calculate g1, g2, g3, g4
40. DEA introduction
40
• Formulating the problem
g2 = min(0.4262V1)
Subject to
-0.3162u1 – 0.5222u2 – 0.4551u3 + 0.4735V1 >= 0
-0.3162u1 – 0.3482u2 – 0.5689u3 + 0.4262V1 >= 0
-0.6325u1 – 0.6963u2 – 0.5120u3 + 0.5682V1 >= 0
-0.6325u1 – 0.3482u2 – 0.4551u3 + 0.5209V1 >= 0
0.3162u1 + 0.3483u2 + 0.5689u3 = 1
u1, u2, u3 >=0
We need to calculate g1, g2, g3, g4
41. DEA introduction
41
• Formulating the problem
g3 = min(0.5682V1)
Subject to
-0.3162u1 – 0.5222u2 – 0.4551u3 + 0.4735V1 >= 0
-0.3162u1 – 0.3482u2 – 0.5689u3 + 0.4262V1 >= 0
-0.6325u1 – 0.6963u2 – 0.5120u3 + 0.5682V1 >= 0
-0.6325u1 – 0.3482u2 – 0.4551u3 + 0.5209V1 >= 0
0.6325u1 + 0.6963u2 + 0.512u3 = 1
u1, u2, u3 >=0
We need to calculate g1, g2, g3, g4
42. DEA introduction
42
• Formulating the problem
g4 = min(0.5209V1)
Subject to
-0.3162u1 – 0.5222u2 – 0.4551u3 + 0.4735V1 >= 0
-0.3162u1 – 0.3482u2 – 0.5689u3 + 0.4262V1 >= 0
-0.6325u1 – 0.6963u2 – 0.5120u3 + 0.5682V1 >= 0
-0.6325u1 – 0.3482u2 – 0.4551u3 + 0.5209V1 >= 0
0.6325u1 + 0.3482u2 + 0.4551u3 = 1
u1, u2, u3 >=0
We need to calculate g1, g2, g3, g4
46. DEA introduction
• How to improve the performance of
inefficiency DMU? (CCR model)
• Input oriented: Focuses on minimizing
the level of inputs or efficiency with an
assumption of fixed level of outputs.
• Output oriented: Focuses on efficient
outputs with an assumption of fixed level
of inputs.
46
Projection to frontier
47. DEA introduction
• DEA and regression
• On regression line DMUs have
average efficiency.
• Regression can
accommodate Multiple
inputs or outputs but not
both.
• Regression provides only
average relationships not
best practice.
47