Library reference
Every public type of OpenBI.Notebooks, the library C# steps use, with its members and what they do, grouped as the library is. 155 types, 1,389 members, from OpenBI Studio 0.3.78.
C# steps see every type here without a using, and the members of KernelGlobals without a prefix: Dax(…), Sql(…), Network(…), TikZ(…), Display(…) and Status(…). In a step, autocomplete lists the same members; an agent asks for them with analytics_catalog (api: "LightGbm"). Signatures are written as C# declares them: ? marks a value that may be null, and = … a parameter's default.
Steps and the kernel
What a C# step sees without a prefix (queries on the model, Display, Status, TikZ), OAX and SQL written with interpolated values, how values are shown under a step, and dates. The steps and the kernel reference.
| Type | What it is |
|---|---|
KernelGlobals | What C# steps see without a prefix: Dax() and Sql() on the open model, Display() and Status(). (Steps also see the OpenBI.Notebooks types: Table, LightGbm, Metrics, Chart, Dates, Models, Output.) |
Notebook | The running notebook: steps call it to show values and report progress. |
DisplayData | What a step shows: one value in one or more formats (MIME type → content), as Jupyter keeps outputs. |
Formatter | How values are shown: a table as a grid, a chart as a chart, a metric as a number. |
DaxQuery | An OAX step with parameters (@asOf): run for any values with DaxQuery.Run, or for a date with DaxQuery.At. |
DaxText | OAX written with $"…": a date, number or list in braces goes in as an OAX literal (text goes in as it is). |
SqlText | SQL written with $"…": a date, number or list in braces goes in as a SQL literal (text goes in as it is). |
Literal | Values written into OAX and SQL text: dates, numbers, true/false and lists as literals of each language. |
Dates | Dates for as-of points and periods. |
Diagram | A TikZ picture in a notebook: real TikZ (LaTeX), as papers draw their figures, compiled offline by the engine's Tectonic. |
Diagram.Document | The standalone document a step's code is compiled as, and how its lines map back to the step's. |
TikzException | TeX could not draw a TikZ picture: its message, and the step's line it points at. |
INotebookHost | Where a running step's outputs, status and interrupt come from: the kernel sets it for each step. |
Tables
Table, the rows every OAX and SQL step gives and every method takes: columns, rows, filters, joins and sorts, each giving a new table and never changing the one it started from. Also made-up tables to try a method on. The tables reference.
| Type | What it is |
|---|---|
Table | A table of rows and named columns, kept in memory by column. |
Column | A column of a Table (t["Score"]): its values, read-only, by row position (t["Score"][0], or typed: Number(i), Text(i), Date(i), Bool(i)). |
ColumnKind | What a column holds. |
ColumnSet | A table's column names, with ColumnSet.Without for choosing features. |
Row | One row of a table (t[0], t.Rows[0], each row of foreach (var r in t.Rows), Table.Where and Table.With): a view of the table at a row position, nothing copied. |
RowList | A table's rows (Table.Rows), a view: nothing is copied. t.Rows[0] is the first row (as t[0]), t.Rows.Count how many; LINQ over them gives rows, which .ToTable() makes a table again. |
RowExtensions | Rows back into a table, after LINQ. |
Synthetic | Made-up tables to try a method on before pointing it at the model (the analytics catalog's recipes run on them): their truth is known, so a recipe shows whether a method finds it. |
Learning
LightGBM from C#, and what keeps a model honest: datasets, training with early stopping, time and group folds, tuning, metrics and the verdict, calibration, drift, walk-forward backtests, uplift and targeting policies, and forecasts. The learning reference.
| Type | What it is |
|---|---|
LightGbm | LightGBM (MIT licensed) from C#: the same library OpenBI's engine scores with, so a model learned in a notebook scores the same in the model, Get data and HTTP. |
Dataset | Rows LightGBM learns from or is checked on: a table's features and outcome, as LightGBM keeps them. |
Booster | A learned LightGBM model: it scores rows, explains scores (SHAP contributions) and saves as LightGBM's own text format, which any LightGBM (Python, R, C) reads. |
Iteration | A validation result after an iteration. |
Feature | An input of a model: its name in the model, the table column it reads, and how values become numbers. |
CrossValidation | A cross-validation's folds, their average and worst value of the metric, and the trees to train the final model with. |
CvFold | One fold of a cross-validation: its rows, its best iteration and its best validation value. |
Tuning | A hyperparameter search: every trial's parameters and cross-validated score, the best trial's parameters (with the base ones) and how many trees to train the final model with. |
TuningTrial | One trial of a search: its parameters and how they cross-validated. |
Metrics | How well scores rank and predict an outcome. |
Metric | A measured quality of a model: a name and a value (shown as "AUC 0.821"). |
Tenth | One tenth of the rows, ranked by a score (first: the highest scores). |
Verdict | How good a model is, in words anyone reads: strong, useful, weak, no better (than the simple rule) or uncertain, a sentence that says why, and what to check (warnings). |
Checks | What to check before trusting a model: the engine's checks, as warnings a verdict carries. |
Calibration | Calibration of a model's scores (LightGBM's binary scores, or any probability): learn a map on a calibration slice (Platt or isotonic, as scikit-learn's CalibratedClassifierCV), apply it to the test rows, and judge it with Metrics.Brier, Metrics.CalibrationError and Chart.Reliability. |
Calibrator | A map from a model's scores to probabilities that hold up: of the rows it gives 0.3, about 30 % have the outcome. |
CalibrationBin | A tenth (or bin) of a reliability curve: its scores' range and mean, its rows and how often they had the outcome. |
Drift | Drift: how far the rows a model scores now have moved from the rows it learned from. |
Backtest | A walk-forward backtest (Backtest.WalkForward): per test period, out of sample, how well a model learned only from what came before ranked (AUC, lift) and how true its probabilities were (calibration), against a simple rule; and a summary over the periods. |
BacktestFold | One test period of a walk-forward backtest: what its model learned from, what it was tested on, and how it did there. |
Uplift | Causal effects, from an experiment's rows (a randomized treatment) or, with care, from observational ones: the average effect, who the treatment moves (uplift: Uplift.TwoModel, judged with Qini), and an effect adjusted for who was treated (inverse propensity weighting). |
UpliftModel | An uplift model (the two-model or T-learner): one LightGBM learns the outcome of the treated rows, another of the control rows; a row's uplift is the difference of their scores (for churn: how much the offer changes its chance of leaving). |
QiniCurve | A Qini curve: by the share of rows targeted (highest uplift first), the extra outcomes the targeting brings against treating at random. |
Policy | A targeting policy judged before it is rolled out (off-policy evaluation): on rows where the treatment was random (an experiment), the rows that happened to get what the policy would give stand for everyone, weighted by the chance of that (inverse propensity, Hájek). |
PolicyValue | A targeting policy's estimated value: the mean outcome per row had it been followed, with its interval. |
Forecast | Forecasts made the way OpenBI's engine makes them (the recipe "openbi-series/1"): a measure per period, for the total or per series. |
ForecastHistory | Every series' values per period (NaN before a series starts), and the recipe's features over them. |
ForecastCalendar | A country's calendar as inputs of a forecast (Forecast.History's calendar: "no"): for each period forecast, its working days, their change on the same period a year before, its Fridays and Saturdays and whether Easter falls in it - whole numbers, as the engine counts them, so a version's forecasts are the notebook's. |
Statistics and survival
Experiments (sample size, power, assignment, reading an A/B test), two-sample tests, bootstrap intervals of an AUC, and survival analysis: Kaplan-Meier, concordance and Cox models with start-stop rows. The statistics and survival reference.
| Type | What it is |
|---|---|
Experiment | Experiment design and reading: how many rows an A/B test needs (two proportions as R's power.prop.test; means as power.t.test, by the shifted t), its power, the smallest effect it can see, a reproducible (stratified) assignment of rows to arms, the effect with its interval, and CUPED (an outcome adjusted by the same measure before the test). |
Effect | A comparison of two groups (an A/B test's arms, treated and control): each one's rows and mean, the difference with its confidence interval and p-value (two-sided), and the method: two proportions (an outcome of 0 and 1, Wald's interval and the pooled z test, as R's prop.test without continuity correction) or Welch's t (any number). |
KsTest | Kolmogorov-Smirnov's two-sample test: the largest distance between the two samples' cumulative shares, and its p-value (asymptotic). |
Bootstrap | Confidence intervals of an AUC and of the difference between two models' AUCs, by a bootstrap that resamples clusters (outlets, products, customers) rather than rows: rows of the same cluster are not independent (a product's monthly snapshots, an outlet's orders), and an interval that resamples rows is then too narrow. The method: each resample draws as many clusters as there are, uniformly with replacement (xoshiro256** from the seed), and takes all of each drawn cluster's rows, as often as it was drawn; its AUC is the Mann-Whitney statistic of those rows (ties count half, as Metrics.Auc). |
AucInterval | An AUC (or the difference of two models' AUCs on the same rows) with its confidence interval: from a bootstrap that resamples clusters (Bootstrap.Auc, Bootstrap.AucDifference), with DeLong's interval for the rows taken as independent beside it (AucInterval.Independent), so what the clusters change shows. |
Survival | Survival analysis in a notebook, as R's survival package computes it: how long until an event (a customer leaves, a policy lapses), the rows still without one counted as censored (they lasted at least so long). |
CoxModel | A fitted Cox model: its terms and coefficients (a number's per its own unit), their standard errors, the rows and events it learned from, and how (ties, entries). |
CoxTerm | A column of a Cox model's design: a number (its mean and scale) or a text value against a reference. |
SurvivalBaseline | What a survival model keeps to give each row its curve: the duration and event columns it learned from, the offset of its scores (their mean on the training rows: a risk of 1 is the average row's) and Breslow's baseline. |
Optimization
Plans with OR-Tools: decisions for the rows of a table, an objective, constraints with parameters, the solution in words with shadow prices and ranging, scenarios, and vehicle routing. The optimization reference.
| Type | What it is |
|---|---|
Optimize | Operations research in a step: decisions made for the rows of a table, an objective and the limits that hold them back, written the way a decision maker reads them, then solved with OR-Tools. |
OptimizationModel | An operations research model: decisions, what to make as large or as small as possible, and constraints. |
Decision | One decision: a number the solver chooses (a quantity, a yes/no), within its bounds. |
Decisions | The decisions for the rows of a table, one each: Liters for every product and plant. |
LinExpr | A linear expression of decisions: Σ coefficient × decision, plus a constant (which may hold parameters). |
LinConstraint | expression ≤ / ≥ / == expression, as lo ≤ Σ a·x + constant ≤ hi. |
Constraint | A constraint of the model: its name, its group (the limit it is one of) and what it says. |
Parameter | A value the model reads that a scenario or a report can change: a capacity, a demand, a budget. |
Solution | What a solve found: the status in words, the best value of the objective, the plan (a value for every decision, as a table of the decisions' rows), and what limits it: each constraint's use, slack and shadow price (how much one more of it would add). |
Ranging | How far a linear program's plan holds as its numbers move: the solver's ranging (HiGHS, the solver the engine solves plans again with). |
CostRange | A decision's value, its objective coefficient and the range of the coefficient in which the plan stays the same. |
LimitRange | A limit's bound and the range of it in which its shadow price holds (an open end: ±∞), the objective at each end. |
Scenario | A scenario: its name and the parameter values it tries ("Bergen +10 %", ("Bergen hours", 1760)). |
ScenarioSet | Scenarios against a plan, written in a step: each solved again with its values, compared with the plan (the objective and how far from the plan's, what limits it, the rows that change). |
Routing | Routes for vehicles, written in a step and solved with OR-Tools' routing: the places, the distance (or time) between each two, then the rules: how many vehicles from where, how far each may go, what each carries, when each place may be visited, what is picked up where and delivered where. Distances are whole units (meters, minutes): fractions are rounded. |
RoutePlan | A routing problem being written: the places, the distances, and the rules added to it. |
Routes | What routing found: the routes, their distances, loads and times, or why there are none. |
Route | One vehicle's route: its stops from start to end, its distance, its load and its time. |
Stop | A stop on a route: the place, the load carried after it, when the vehicle may be there (from, to). |
Quantitative finance
Valuation and risk with QuantLib: curves and markets as of a date, bonds, swaps, FX forwards, options, swaptions and CDS, portfolios valued row by row, value at risk, credit risk, counterparty exposure and XVA, initial margin, and Monte Carlo simulations. The quantitative finance reference.
| Type | What it is |
|---|---|
Quant | Quantitative finance in a step, with QuantLib 1.43: bonds, curves, options and FX forwards. |
Curve | A yield curve as of a date, kept as its pillars: dates with their discount factors, interpolated log-linearly in between. |
Market | The market data a run uses, as of a date: curves, quotes and FX rates, frozen with it. |
Valuation | Portfolios valued on a market, row by row with QuantLib. |
Valued | A valuation: positions valued as of a date on a market (frozen with it), their totals, the risk measures computed, and what the run had to decide (a bond with no quote priced from the curve). |
BondPrice | A bond's price and risk, per 100 of nominal. |
OptionPrice | An option's price and greeks: vega and rho per 1 (100 %) of volatility and rate, theta per year. |
SwaptionPrice | A European swaption in the Hull-White model (QuantLib, Jamshidian): its value, the swap's value today, its par rate. |
FxForward | An FX forward: buys (or sells) Notional of the foreign currency at Strike (domestic per foreign) on Maturity. |
InterestRateSwap | An interest rate swap on a single curve, fixed against floating; both legs pay at the given frequency, with Actual/365. |
CdsPrice | A CDS priced on a default curve (per notional, to the side that holds it). |
CreditCurve | A name's default curve, as of a date: survival probabilities at its pillars, with a flat hazard rate between them (QuantLib's piecewise default curve). |
CreditRisk | Credit risk of a portfolio over a horizon: expected loss, and the loss distribution when names default together (a one-factor Gaussian copula: Vasicek's model, behind Basel's internal-ratings formula). |
Risk | Value at risk and expected shortfall of a profit-and-loss history (losses negative); both as positive losses. |
Xva | Counterparty exposure and valuation adjustments: a netting set's trades valued along simulated paths (Hull-White one factor fitted to today's curve, simulated exactly with each path's own discounting; FX lognormal, drifting with the path's domestic rates), its expected exposure profiles, and CVA, DVA and FVA from them. |
ExposureSimulation | A netting set to simulate: the rates model, FX, its trades, the grid; Run gives its exposure. |
ExposureResult | A netting set's simulated values: at each date, the expected exposure (EE: what the counterparty would owe, on average), the expected negative exposure (ENE: what one would owe it), the potential future exposure (PFE, 97.5 %), and their discounted values (what CVA, DVA and FVA integrate). |
Margin | Initial margin for non-centrally cleared derivatives. |
ScheduleMargin | A netting set's standardised initial margin (BCBS-IOSCO): each trade's, gross, the net-to-gross ratio, net. |
MonteCarlo | Monte Carlo, written in a step: what moves over time (prices, currencies, rates) and what is simply uncertain (demand, costs, a yield), simulated together many times; any value of them per path (a portfolio, a margin, an option's payoff) becomes a distribution: its mean, percentiles, the chance of a loss or of reaching a target, VaR and expected shortfall. |
Simulation | A simulation being written: its factors (what moves, what is uncertain), how they correlate, its time steps. |
SimulationResult | What a simulation produced: each factor's value at the end of every path (and every step, when kept), and any value of them per path as a distribution. |
SimulationResult.PathView | One path, as Value(…) sees it. |
Distribution | The values a simulation gave, one per path: their mean (and its standard error), percentiles, the chance of any condition, value at risk and expected shortfall, and a histogram. |
Networks
A network measured with Open Graph: each node's degree, weight, PageRank, betweenness, community, component, k-core and cut point, paths between nodes, and the network in words; and Graph, Open Graph's graph made from the model's rows, with every graph algorithm as a table (Og, every function of Open Graph, is in the Open Graph reference: /docs/reference/open-graph/notebooks/). Graph and Og's methods are the way in; Og.Native, Open Graph's raw C interface, only when that is what you need: a mistake there can crash the notebook's process instead of showing an error, and OpenBI's agent uses it only when you ask for it. The networks reference.
| Type | What it is |
|---|---|
Network | A network with its nodes measured (who matters by PageRank and betweenness, the communities, components, k-cores and cut points, and where to draw each node) and its edges. |
Graph | A graph of Open Graph's (og_t), in a notebook: made from a table of edges the model gives the step (Graph.FromTable(Dax(...), "From", "To", weight: "Weight") - the rows this user may see, row-level security applied), or by a generator (Graph.Famous("Zachary"), Graph.Ring(10)). |
NodeOrder | How Graph.FromTable numbers a graph's nodes. |
SirResult | What Graph.Sir gives: Curve, the runs' mean on a grid of times (columns Time, Susceptible, Infected, Recovered, then Infected low and Infected high - where 10% and 90% of the runs were - and Reached share), and Nodes, one row a node (Node; Reached, how often of all runs the node fell ill; Mean time, when it did on average; Seed, whether a run started there). |
OpenGraphException | What Open Graph reported when a function failed: its error code (Og.Error), the function's C name and its own words (og_abi_error_last), e.g. "Open Graph's og_neighbors: Vertex 9 is not in the graph. (OG_EINVVID)". |
SparseMatrix | A sparse matrix as triplets: Rows x Columns, entry k at (Row[k], Column[k]) with Values[k] (og_sparsemat_t in C). |
HrgModel | A hierarchical random graph (og_hrg_t): a dendrogram fitted to a graph, for link prediction (Og.HrgFit, Og.HrgPredict). |
OgEntry | An entry of Open Graph's documentation and where C# reaches it (tools/gen_open_graph_binding.py's entries.json). |
Charts and visuals
Charts a step shows (bars, lines, reliability, SHAP, loss and survival curves) and any of OpenBI's report visuals drawn under a step on the model's measures. The charts and visuals reference.
| Type | What it is |
|---|---|
Chart | Charts for steps to show with Display. |
ChartSpec | A chart a step shows: bars, horizontal bars or lines over categories, with an optional reference line and a marked point. |
ChartSeries | A series of a chart: a name and one value per category (NaN: none there), and how it is drawn. |
ChartPoint | A point of a chart of points: its row (a beeswarm's feature), x, y and its color from 0 (low, blue) to 1 (high, red), NaN grey; the row of data it came from (its name in ChartSpec.PointNames, -1 for none) and the feature's value there. |
ChartMark | A category a chart marks with a vertical line and a label (where a model stopped early). |
Visual | A report visual in a notebook: OpenBI's own components (obi-chart, obi-matrix, obi-kpi, obi-table, obi-map, obi-network, obi-canvas … as reports.md has them), drawn by the report runtime against the model as on a report page, in the report's theme, without the report's filters on all pages. |
Versions and results
What a notebook saves for a person to approve: model versions (Models) and the results of a plan, a valuation or a network (Results), how their scores are written, their history and checks, and models brought from elsewhere, read and never run. The versions and results reference.
| Type | What it is |
|---|---|
Models | Model versions for notebooks: save the model a notebook learned (the output of a notebook), import one a data scientist brings, load one to score. |
ModelVersion | A saved model version: serialized (LightGBM's text format), with what made it and what it showed. |
Output | How a model version's scores are written: a probability (with bands and reasons), a value, or a survival model's risk with each row's survival to a horizon (Outcome its duration column, Event its event column, in the features query). |
HeldOut | How a version's metrics were measured, kept with it (Models.Save heldOut:): the model that was checked - learned from the training rows, its trees chosen by early stopping on the validation rows - and the held-out test it was measured on, rows neither learning nor early stopping saw (for a history, the latest as-of dates, whose outcome came after all the others'). |
HistoryEntry | A step in a version's life, as the history keeps it: who (their name), from which account, why. |
VersionStore | A prediction's model versions (predictions/<name>/versions/<n>/) and their history: saved, approved (by someone other than the author), not approved, in use, retired. |
StoreCheck | What checking a model store found: nothing changed, or what did. |
Results | What an operations research, a valuation or a network notebook found - a plan, positions valued, a network's nodes - saved as a version of its own: the rows (result.parquet, kept in git: they are the version's output), what they are (schema.json), the evidence, the notebook as it ran and where it ran. |
ImportedModel | A LightGBM model brought from outside OpenBI: its text, and what the file said about it. |
ModelImport | Reads a LightGBM model a data scientist sends: LightGBM's text format (model.txt), or a Python pickle or joblib file of a Booster, an LGBMClassifier/LGBMRegressor, or a scikit-learn pipeline ending in one. |
PickleReader | Reads a Python pickle (protocols 0 to 5) as data, never as code: classes are names, calls are recorded, nothing is imported or executed. |
PyObject | A Python object a pickle describes: its class, the arguments it is made from, and its state. |
PyGlobal | A Python class or function a pickle names (module and name). |
PyDict | A Python dict, in its order. |
PyTuple | A Python tuple. |
PyNone | Python's None. |
Notebooks, the kernel and the catalog
The types the studio and the agent's tools use to read, write and run notebooks: the notebook in Jupyter's format, its flow, the kinds of notebooks, the kernel's requests and results, the analytics catalog and the examples. A step seldom needs them. The notebooks, the kernel and the catalog reference.
| Type | What it is |
|---|---|
NotebookDocument | A notebook in Jupyter's format (.ipynb, nbformat 4.5), as VS Code's Polyglot Notebooks and Jupyter read it. |
NotebookCell | A step of a notebook: text (markdown) or code in C#, OAX or SQL, with what it showed when it last ran. |
NotebookSteps | A notebook's steps named as an agent or a person names them: by id (what notebook_step_add and notebook_read give), or by name (the variable an OAX step makes, a C# step's title in the flow) - "backtest", "subgroups". |
NotebookTemplates | The first steps of a new notebook. |
FlowGraph | A notebook as a flow: its steps are nodes, and an edge goes from the step that makes a variable to each later step that uses it (read from the code, not run). |
FlowNode | A node of a notebook's flow: a step (or a model version a step saves), what it makes and what it uses. |
FlowEdge | An edge: the variables one step makes and another uses. |
Workbench | The four kinds of notebooks and where each one's work is in a project. |
WorkKind | A kind of work a notebook does, in its own folder of the project: a prediction (a model that scores), operations research (a plan: what to do given what limits it), a valuation (positions valued, risk) or a network (its nodes measured). |
AnalyticsCatalog | OpenBI's analytics catalog: by goal, what to use of LightGBM, OR-Tools, Open Graph and OpenBI's own statistics, with a recipe that runs. |
CatalogEntry | What OpenBI has for one goal of serious analytics work: the notebook API and the OAX to use, a recipe of notebook steps that runs (on made-up data with a known truth unless it says what model it needs), and what to watch out for. |
CatalogStep | A step of a recipe: its language (csharp, dax, markdown), its name and its code. |
Examples | The examples of the analytics tabs, on the example project's tables (examples/Example Brewery): a production plan and delivery routes (Operations Research), a bond portfolio (Quantitative), who buys what (Networks). |
Example | An example for newcomers: its question, the model's tables it needs, a brief for the agent, its notebook. |
ModelConnection | The open model, through the engine OpenBI Studio runs for the project: OAX queries, and DuckDB SQL over the project's sources and the model. |
KernelSession | Runs a notebook's steps in order, keeping their variables: C# scripting, OAX and SQL on the open model (bound to a variable of the step's name). |
KernelServer | The kernel process (OpenBI.Studio.exe --kernel): requests come as JSON lines on standard input ({"op": "run", "id", "language", "code", "name", "parameters"}, {"op": "interrupt"}, {"op": "variables"}, {"op": "record"}, {"op": "shutdown"}); events and results go out as JSON lines on standard output. |
KernelClient | The studio's side of a notebook's kernel: starts it (a process of its own), sends it steps, and raises what they show as they run. |
KernelConnection | A running kernel's two streams (we write requests, we read events) and how to stop it. |
KernelStoppedException | The kernel stopped (crashed, or was restarted) while a request waited. |
StepRequest | A step to run: its language, code, and for OAX and SQL the variable it makes and its parameters. |
StepResult | What a step did: its outputs, its error (if any), how long it took, and the variables after it. |
StepError | A step's error: the message, and where in the step (1-based) when known. |
VariableInfo | A variable the kernel holds after a step: its name, type and a line about its value. |