Scan your whole stack
Are you using melba?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.2.0
melba was last scanned on 27 Nov 2026 at version 0.2.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.2.0 LATEST | 27 Nov 2026 | No rules fired |
| 0.1.0 | 25 Nov 2026 | No rules fired |
Findings for v0.2.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.2.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
MELBA (Mathematical Economics Learning-Based Algorithm) is a Python library for business-data regression and formula-based economic mathematics. Version 0.2.0 combines the original Regression Engine with a separate Economic Mathematics Engine.
This source tree prepares version 0.2.0. Until that version is published, installing from PyPI will still install the latest published version.
The model uses established regression techniques. MELBA makes no claim of algorithmic novelty or scientific superiority.
Import functions from melba.economics:
The economic functions use parameters supplied by the caller. They are separate from the regression optimizer and do not infer causal relationships.
After MELBA 0.2.0 is published to PyPI:
python -m pip install --upgrade melba
To install this source checkout before publication:
python -m pip install .
Matplotlib is optional and only needed for plotting in the notebook. For tests and plotting:
python -m pip install ".[plot,test]"
The example below uses synthetic demonstration values. It trains a regression model, predicts sales, and passes the prediction into the economic functions.
import numpy as np
from melba import MELBA
from melba.economics import (
CostFunction,
DemandFunction,
Elasticity,
ProfitFunction,
RevenueFunction,
SupplyFunction,
)
# Synthetic demonstration data: promotion budget in thousands -> units sold.
X_train = np.array([[0], [10], [20], [30], [40], [50]], dtype=float)
y_train = np.array([50, 70, 90, 110, 130, 150], dtype=float)
model = MELBA(
quadratic_terms=False,
epochs=1000,
random_state=42,
l2_penalty=0.0,
)
model.fit(X_train, y_train)
predicted_sales = float(model.predict([[25]])[0])
evaluation = model.evaluate(X_train, y_train)
if predicted_sales < 0:
raise ValueError("Predicted sales are outside the non-negative quantity domain.")
# Illustrative currency values per product unit.
price_per_unit = 10_000.0
revenue = RevenueFunction().calculate(price_per_unit, predicted_sales)
total_cost = CostFunction(
fixed_cost=100_000.0,
variable_cost=6_000.0,
).calculate(predicted_sales)
profit = ProfitFunction().calculate(revenue, total_cost)
# Separate illustrative supply and demand curves.
demand = DemandFunction(a=1_000.0, b=0.05)
supply = SupplyFunction(c=20.0, d=0.02)
demand_quantity = demand.calculate(price_per_unit)
supply_quantity = supply.calculate(price_per_unit)
elasticity = Elasticity.price_demand(demand, price=price_per_unit)
print("Predicted sales:", predicted_sales)
print("Evaluation:", evaluation)
print("Revenue / cost / profit:", revenue, total_cost, profit)
print("Demand / supply:", demand_quantity, supply_quantity)
print("Price elasticity:", elasticity.elasticity, elasticity.category)
All data and currency values are synthetic and illustrative; they are not company observations or evidence of real-world accuracy. The demand and supply curves are separate from the fitted regression. Predictions are not constrained to non-negative values, so check the quantity domain before using predictions in economic calculations.
For price P and quantity Q, the linear functions use:
For polynomial cost, revenue, or profit functions, MELBA calculates derivatives analytically. Profit optimization searches a finite quantity interval, evaluates real stationary points in that interval, and compares them with both endpoints. A zero first derivative alone is not treated as proof of a maximum.
The regression objective uses Huber loss on standardized targets with an L2 penalty on non-intercept coefficients. See the algorithm guide and Economic Mathematics guide for assumptions and details.
Open the self-contained synthetic walkthrough in Google Colab. The notebook bundles a source snapshot so its regression and economics examples can run without a local repository checkout. Notebook results describe only the generated demonstration data.
Run examples from a source checkout:
python examples/basic_usage.py
python examples/business_sales.py
python examples/economic_functions.py
Run the unit test suite:
python -m pytest
MELBA is an inspectable learning and calculation tool, not a validated domain model for making business decisions. See the framework guide, algorithm guide, and Economic Mathematics guide.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.