Go beyond prediction — determine the best course of action given constraints.
Functions
ConductLinearOptimization
Solve linear programming problems: maximize or minimize an objective subject to constraints. Uses scipy.optimize.linprog and returns an interpretable results table.
from analysistoolbox.prescriptive_analytics import ConductLinearOptimization
result = ConductLinearOptimization(
objective_coefficients=[5, 4], # Maximize 5x + 4y
inequality_constraint_matrix=[[1, 1], [2, 1]],
inequality_constraint_bounds=[100, 150],
objective_direction="maximize"
)
CreateContentBasedRecommender
Build a two-tower neural network recommender system. Takes a catalog of items with feature vectors and returns personalized recommendations.
from analysistoolbox.prescriptive_analytics import CreateContentBasedRecommender
recommendations = CreateContentBasedRecommender(
item_dataframe=catalog_df,
user_profile=user_features,
number_of_recommendations=10
)
Use cases
- Resource allocation under budget or capacity constraints
- Logistics and scheduling optimization
- Personalized content delivery for intelligence products
- Health or training program recommendations