Super efficiency

Preparing…

Import modules and prepare data.

import matplotlib.pyplot as plt
import pandas as pd

from Pyfrontier.frontier_model import EnvelopDEA

supply_chain_df = pd.DataFrame(
    {"cost": [1, 2, 4, 6, 4], "day": [4, 2, 1, 1, 4], "profit": [2, 2, 2, 2, 2]}
)
supply_chain_df
cost day profit
0 1 4 2
1 2 2 2
2 4 1 2
3 6 1 2
4 4 4 2


Fit dea model.

The necessity inputs are inputs and outputs. The result has below belongings.

dea = EnvelopDEA("CRS", "in", super_efficiency=True)
dea.fit(
    supply_chain_df[["day", "cost"]].to_numpy(),
    supply_chain_df[["profit"]].to_numpy(),
)

dea.result[1]
EnvelopResult(score=1.25, id=1, dmu=DMU(input=array([2, 2]), output=array([2]), id=1), weights=[0.5, 0.5, 0.0, 0.0], x_slack=[], y_slack=[], orientation='in')
plt.figure()
plt.plot(
    [r.dmu.input[0] for r in dea.result[:-1]],
    [r.dmu.input[1] for r in dea.result[:-1]],
    "-o",
)
plt.plot([4, 6], [1, 1], color="C0")
plt.plot([1, 4], [4, 1], color="black", linestyle="--")
plt.legend()
plt.show()
04 super efficiency
/home/runner/work/PyDEA/PyDEA/tutorials/build/01_usecase/04_super_efficiency.py:45: UserWarning: No artists with labels found to put in legend.  Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
  plt.legend()

Total running time of the script: (0 minutes 0.055 seconds)

Gallery generated by Sphinx-Gallery