liveBook · Manning

Objective function

As explained in Statistics Every Programmer Needs

An objective function is a mathematical expression that assigns a value to each feasible decision and is maximized or minimized in an optimization problem.

An objective function assigns a quantitative value to each feasible decision and defines what an optimization model maximizes or minimizes. In linear programming, it combines decision variables linearly, subject to constraints representing limits such as budget, resources, or strategic requirements. section 8.0 section 8.2

For feature prioritization, let xᵢ indicate whether feature i is selected and cᵢ represent its priority score. The objective is to maximize Σ cᵢxᵢ. With binary variables, xᵢ = 1 selects a feature and xᵢ = 0 excludes it. The model can also minimize costs or optimize another quantitative organizational goal. section 8.2 section 8.3

Maximizing feature value per effort

For each feature, calculate priority as value_points / effort_points. Because scipy.optimize.linprog minimizes by default, negate each score: c = [-f.value_points / f.effort_points for f in features]. Solving with budget limits and three-to-four-feature bounds per epic then minimizes the negative total, which is equivalent to maximizing total priority. section 8.2.2 section 8.2.3

>>> c = [-f.value_points / f.effort_points for f in features]

Shows the compact Python expression that constructs objective coefficients from feature value and effort points. section 8.2.3

The objective function does not determine feasibility by itself. Linear constraints must restrict the same decision variables, and the resulting solution should be checked for solver success, selected features, costs, priority scores, and compliance with organizational limits. section 8.2.2 section 8.3

How Statistics Every Programmer Needs covers it

How deep it goes
Explains linear formulation, binary variables, score ratios, solver negation, constraints, and result evaluation without proving optimization algorithms.
Examples
Uses feature value-to-effort ratios, project budgets, epic selection bounds, Python coefficients, and scipy.optimize.linprog.
What it assumes
Assumes basic Python and structured feature data while teaching objective coefficients, binary decisions, linear constraints, and solver-direction conversion.
What you can do after
Build it from scratch by defining objective coefficients, encoding constraints, solving with linprog(), and evaluating selected alternatives.
How it connects
Connects objective functions to linear programming, constrained optimization, decision variables, constraints, and binary variables.

Also explained in

Compare how 30 books explain objective function →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.