@model-match/api 3.79.0 → 3.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RELEASE_NOTES.md +9 -0
- package/dist/{index-CXBAeaSu.d.mts → index-uHovaz1c.d.mts} +106 -10
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/slim/index.d.mts +7 -7
- package/dist/slim/index.mjs +7 -7
- package/dist/{src-bW2n1ku2.mjs → src-c-fp5gD8.mjs} +6 -6
- package/openapi.json +220 -11
- package/package.json +1 -1
package/RELEASE_NOTES.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Changes to `@model-match/api` that affect how you use it. Each version is generated from the ModelMatch API's OpenAPI spec, so new endpoints and fields appear in the [API reference](https://docs.modelmatch.com/developers) as they ship.
|
|
4
4
|
|
|
5
|
+
## 3.80.0
|
|
6
|
+
|
|
7
|
+
- **New: published Studio tables.** `getStudioCatalog` can list tables of `kind: "published"` — named `mm_…`, computed and kept up to date by ModelMatch for every organization, with `published: { maintainedBy, refreshedAt }`. They are read-only and queried with `runStudioQuery` like any other table, at the same price. `mm_retention` (borrower retention of every mortgage company) is the first; a table appears once ModelMatch publishes it.
|
|
8
|
+
- Names starting with `mm_` are reserved: `createStudioJob` refuses one.
|
|
9
|
+
|
|
10
|
+
## 3.79.1
|
|
11
|
+
|
|
12
|
+
- Regenerated from the latest API spec. No changes to the client itself.
|
|
13
|
+
|
|
5
14
|
## 3.79.0
|
|
6
15
|
|
|
7
16
|
- **Studio: a slow question is no longer stopped — it carries on in the background.**
|
|
@@ -13863,6 +13863,10 @@ type StudioCatalog = {
|
|
|
13863
13863
|
*/
|
|
13864
13864
|
type: string;
|
|
13865
13865
|
}>;
|
|
13866
|
+
/**
|
|
13867
|
+
* For a market table: the last day (YYYY-MM-DD) its records are treated as fully recorded. Later months are still filling in, so end trends and year-over-year windows here, not at today, and compare the same months of each year.
|
|
13868
|
+
*/
|
|
13869
|
+
completeThrough?: string;
|
|
13866
13870
|
/**
|
|
13867
13871
|
* What part of the data is available, when not all of it.
|
|
13868
13872
|
*/
|
|
@@ -13885,9 +13889,9 @@ type StudioCatalog = {
|
|
|
13885
13889
|
previousTable: string;
|
|
13886
13890
|
};
|
|
13887
13891
|
/**
|
|
13888
|
-
* `market` — market data, the same for everyone. `job_result` — the latest result of one of your organization's saved jobs. `upload` — a file your organization uploaded. `crm` — your organization's own CRM records (the lists shared with the whole organization and the records in them), refreshed about every 15 minutes. `model` — the scores of one of your organization's prediction models.
|
|
13892
|
+
* `market` — market data, the same for everyone. `job_result` — the latest result of one of your organization's saved jobs. `upload` — a file your organization uploaded. `crm` — your organization's own CRM records (the lists shared with the whole organization and the records in them), refreshed about every 15 minutes. `model` — the scores of one of your organization's prediction models. `published` — a table ModelMatch computes and keeps up to date for every organization (its name starts with `mm_`): read-only, the same rows for everyone, and the right source for what it covers.
|
|
13889
13893
|
*/
|
|
13890
|
-
kind: 'market' | 'job_result' | 'upload' | 'crm' | 'model';
|
|
13894
|
+
kind: 'market' | 'job_result' | 'upload' | 'crm' | 'model' | 'published';
|
|
13891
13895
|
/**
|
|
13892
13896
|
* The name to use in SQL.
|
|
13893
13897
|
*/
|
|
@@ -13896,6 +13900,19 @@ type StudioCatalog = {
|
|
|
13896
13900
|
* What to know before writing SQL against this table.
|
|
13897
13901
|
*/
|
|
13898
13902
|
notes: Array<string>;
|
|
13903
|
+
/**
|
|
13904
|
+
* For a `published` table: who maintains it and when it was last refreshed.
|
|
13905
|
+
*/
|
|
13906
|
+
published?: {
|
|
13907
|
+
/**
|
|
13908
|
+
* Who computes and maintains the table.
|
|
13909
|
+
*/
|
|
13910
|
+
maintainedBy: string;
|
|
13911
|
+
/**
|
|
13912
|
+
* When its rows were last computed (ISO 8601).
|
|
13913
|
+
*/
|
|
13914
|
+
refreshedAt: string;
|
|
13915
|
+
};
|
|
13899
13916
|
/**
|
|
13900
13917
|
* For a `crm` table: when your organization's records were last copied in (ISO 8601). Changes made in the CRM since then appear after the next refresh.
|
|
13901
13918
|
*/
|
|
@@ -14273,7 +14290,7 @@ type StudioJobSaved = {
|
|
|
14273
14290
|
type StudioModel = {
|
|
14274
14291
|
asOf: string;
|
|
14275
14292
|
/**
|
|
14276
|
-
* The report card (`ready` and `refused`). Read it to the person as it is written; do not round it up. `headline` — one sentence. `learnedFrom` — how many past cases and over what dates, and the later cases it was tested on. `lift.top10` (and `lift.top1` on large tests) — `modelPer100`, `randomPer100`, `bestSimpleRulePer100` and a ready-made `sentence`. `checks` — three, each `passed` true or false
|
|
14293
|
+
* The report card (`ready` and `refused`). Read it to the person as it is written; do not round it up. Show the sentences and the fields named `label`, `…Label`, `sentence`, `detail`, `reason`, `summary` and `note`: they are written in plain words. The fields named `id`, `code`, `verdict`, `better`, `kind`, `table` and `column`, and everything under `technical` and `details`, are for programs: never show them to a person (say `verdictLabel` "helped a little", not `verdict` `helped_a_little`). `headline` — one sentence. `outcome.label` — what it predicts. `learnedFrom` — how many past cases and over what dates, and the later cases it was tested on; for a model on the person's own outcomes, `learnedFrom.funnel` — the rows in their file, then how many had a date and an outcome, matched a home, had history before their date and were used, each with the reason rows were dropped (`funnel.sentence` says it in one line). `lift.top10` (and `lift.top1` on large tests) — `modelPer100`, `randomPer100`, `bestSimpleRulePer100` and a ready-made `sentence`. `checks` — three, each `passed` true or false, with a `label` and a `detail`: beats the best simple rule, finds nothing when the outcomes are shuffled, holds up across time periods. `dataPoints.ranking` — each data point's `label`, its share, a `verdictLabel` and a `sentence`, and `dataPoints.summary`. `comparison` — the person's picks against every available data point (`sentence`, `betterLabel`) and `worthAdding`. `changeFromPrevious.sentence` — what changed since the version it replaced or was based on. `calibration.calibrated` — only when true may a home's estimated chance be called a chance; otherwise scores are a ranking; `calibration.note` says it. `caution` — when present, say it first. `caveats` — say them. `refusal` — `reason` and `whatWouldHelp` when refused.
|
|
14277
14294
|
*/
|
|
14278
14295
|
card: {
|
|
14279
14296
|
[key: string]: unknown;
|
|
@@ -14285,6 +14302,17 @@ type StudioModel = {
|
|
|
14285
14302
|
code: string;
|
|
14286
14303
|
message: string;
|
|
14287
14304
|
};
|
|
14305
|
+
/**
|
|
14306
|
+
* While a run is going (training, or a refresh): how long a run like it takes from start to finish, in minutes. It depends on the size of the state: a couple of minutes for a small one, 15 to 25 for the largest. An estimate. Null when nothing is running.
|
|
14307
|
+
*/
|
|
14308
|
+
expectedMinutes?: {
|
|
14309
|
+
high: number;
|
|
14310
|
+
low: number;
|
|
14311
|
+
};
|
|
14312
|
+
/**
|
|
14313
|
+
* The data points by their plain labels, in the same order as `features`.
|
|
14314
|
+
*/
|
|
14315
|
+
featureLabels?: Array<string>;
|
|
14288
14316
|
features: Array<StudioModelDataPoint>;
|
|
14289
14317
|
/**
|
|
14290
14318
|
* True when the data points were picked; false when the model uses every market data point.
|
|
@@ -14294,6 +14322,10 @@ type StudioModel = {
|
|
|
14294
14322
|
name: string;
|
|
14295
14323
|
nextRunAt: string;
|
|
14296
14324
|
outcome: string;
|
|
14325
|
+
/**
|
|
14326
|
+
* What the model predicts, in plain words. Show a person this, `populationLabel` and `featureLabels`; `outcome`, `population` and `features` are the request's own values, for programs.
|
|
14327
|
+
*/
|
|
14328
|
+
outcomeLabel?: string;
|
|
14297
14329
|
outcomeSource: {
|
|
14298
14330
|
/**
|
|
14299
14331
|
* The date of each row: the day you would have wanted the prediction (for example the day the lead came in). It must be a date column. Only what was on record before it is used to learn.
|
|
@@ -14315,16 +14347,51 @@ type StudioModel = {
|
|
|
14315
14347
|
};
|
|
14316
14348
|
population: StudioModelPopulation;
|
|
14317
14349
|
/**
|
|
14318
|
-
*
|
|
14350
|
+
* Who is scored, in plain words.
|
|
14351
|
+
*/
|
|
14352
|
+
populationLabel?: string;
|
|
14353
|
+
/**
|
|
14354
|
+
* While the model trains: the step it is on, how long it has been, and how long is left (an estimate). Tell the person the step and the remaining range, as a range.
|
|
14319
14355
|
*/
|
|
14320
14356
|
progress: {
|
|
14357
|
+
/**
|
|
14358
|
+
* Seconds since the run was started.
|
|
14359
|
+
*/
|
|
14360
|
+
elapsedSeconds?: number;
|
|
14361
|
+
/**
|
|
14362
|
+
* A range of minutes, `low` to `high`. An estimate from earlier runs of the same size, not a promise: say it as a range ("about 13 to 23 minutes").
|
|
14363
|
+
*/
|
|
14364
|
+
expectedMinutes?: {
|
|
14365
|
+
high: number;
|
|
14366
|
+
low: number;
|
|
14367
|
+
};
|
|
14368
|
+
/**
|
|
14369
|
+
* Says that the times are estimates, or that the run is past its estimate and still going. Pass it on.
|
|
14370
|
+
*/
|
|
14371
|
+
note?: string;
|
|
14372
|
+
/**
|
|
14373
|
+
* What is left of the estimate. Null when there is no estimate for this run.
|
|
14374
|
+
*/
|
|
14375
|
+
remainingMinutes?: {
|
|
14376
|
+
high: number;
|
|
14377
|
+
low: number;
|
|
14378
|
+
};
|
|
14379
|
+
/**
|
|
14380
|
+
* The step the run is on, numbered: "step 3 of 6: building past cases to learn from". Steps only ever go up.
|
|
14381
|
+
*/
|
|
14321
14382
|
stage: string;
|
|
14322
14383
|
startedAt: string;
|
|
14384
|
+
step?: number;
|
|
14385
|
+
steps?: number;
|
|
14323
14386
|
};
|
|
14324
14387
|
/**
|
|
14325
14388
|
* A refresh in progress, or why the last one produced nothing (the earlier scores stay).
|
|
14326
14389
|
*/
|
|
14327
14390
|
refresh: {
|
|
14391
|
+
/**
|
|
14392
|
+
* While it runs: seconds since it started. `expectedMinutes` on the model says how long a refresh takes.
|
|
14393
|
+
*/
|
|
14394
|
+
elapsedSeconds?: number;
|
|
14328
14395
|
error?: {
|
|
14329
14396
|
code: string;
|
|
14330
14397
|
message: string;
|
|
@@ -14550,6 +14617,35 @@ type StudioModelOptions = {
|
|
|
14550
14617
|
label: string;
|
|
14551
14618
|
theme: string;
|
|
14552
14619
|
}>;
|
|
14620
|
+
/**
|
|
14621
|
+
* How long a model takes from start to finish, as a range of minutes: for each state (`states`, when the sizes are known) and by size of state (`sizes`). An estimate from earlier runs (`note` says so; pass it on). Tell the person the range for their state BEFORE starting a model.
|
|
14622
|
+
*/
|
|
14623
|
+
trainingTime?: {
|
|
14624
|
+
basis: string;
|
|
14625
|
+
note: string;
|
|
14626
|
+
sizes: Array<{
|
|
14627
|
+
/**
|
|
14628
|
+
* A range of minutes, `low` to `high`. An estimate from earlier runs of the same size, not a promise: say it as a range ("about 13 to 23 minutes").
|
|
14629
|
+
*/
|
|
14630
|
+
expectedMinutes: {
|
|
14631
|
+
high: number;
|
|
14632
|
+
low: number;
|
|
14633
|
+
};
|
|
14634
|
+
label: string;
|
|
14635
|
+
size: 'small' | 'medium' | 'large';
|
|
14636
|
+
}>;
|
|
14637
|
+
states: Array<{
|
|
14638
|
+
/**
|
|
14639
|
+
* A range of minutes, `low` to `high`. An estimate from earlier runs of the same size, not a promise: say it as a range ("about 13 to 23 minutes").
|
|
14640
|
+
*/
|
|
14641
|
+
expectedMinutes: {
|
|
14642
|
+
high: number;
|
|
14643
|
+
low: number;
|
|
14644
|
+
};
|
|
14645
|
+
size: 'small' | 'medium' | 'large';
|
|
14646
|
+
state: string;
|
|
14647
|
+
}>;
|
|
14648
|
+
};
|
|
14553
14649
|
uploadedOutcomes: {
|
|
14554
14650
|
keyKinds: Array<{
|
|
14555
14651
|
columns: string;
|
|
@@ -34942,7 +35038,7 @@ declare class Studio {
|
|
|
34942
35038
|
/**
|
|
34943
35039
|
* Tables you can query in Studio, with their columns
|
|
34944
35040
|
*
|
|
34945
|
-
* Everything a Studio question can read: the market tables (recorded mortgage loans, home listings and sales), the result tables of your organization's own saved jobs, the files your organization uploaded (`upload_…`) and your organization's CRM (`crm_…`: the lists shared with the whole organization and the records in them, refreshed about every 15 minutes; they join to market data on NMLS ids). Each table lists its columns with a type and a plain-language description, and notes worth reading before writing SQL. `limits` says how many rows an answer can carry and how long a question may run; `guidance` says how to write SQL that works here. `notes` carries anything worth telling the user about the catalog itself, such as why there are no CRM tables yet. Read this before the first question in a conversation. Free.
|
|
35041
|
+
* Everything a Studio question can read: the market tables (recorded mortgage loans, home listings and sales), the result tables of your organization's own saved jobs, the files your organization uploaded (`upload_…`) and your organization's CRM (`crm_…`: the lists shared with the whole organization and the records in them, refreshed about every 15 minutes; they join to market data on NMLS ids) and the tables ModelMatch publishes for every organization (`mm_…`, kind `published`: already computed, read-only, each says when it was last refreshed — when one covers the question, query it instead of recomputing from the market tables). Each table lists its columns with a type and a plain-language description, and notes worth reading before writing SQL. `limits` says how many rows an answer can carry and how long a question may run; `guidance` says how to write SQL that works here. `notes` carries anything worth telling the user about the catalog itself, such as why there are no CRM tables yet. Read this before the first question in a conversation. Free.
|
|
34946
35042
|
*/
|
|
34947
35043
|
static getStudioCatalog<ThrowOnError extends boolean = false>(options?: Options<GetStudioCatalogData, ThrowOnError>): RequestResult<GetStudioCatalogResponses, GetStudioCatalogErrors, ThrowOnError>;
|
|
34948
35044
|
/**
|
|
@@ -34978,19 +35074,19 @@ declare class Studio {
|
|
|
34978
35074
|
/**
|
|
34979
35075
|
* Your organization's models
|
|
34980
35076
|
*
|
|
34981
|
-
* Every model your organization has: its status, what it predicts, the data points it uses, its report card and where its scores are. Only your organization's models are listed. Listing is free; a model that has just finished is charged for here if this is the first call to see it (`credits`), exactly as getStudioModel would.
|
|
35077
|
+
* Every model your organization has: its status, what it predicts, the data points it uses (`featureLabels` in plain words), its report card and where its scores are; for one that is training, the step it is on and how long is left (`progress`, `expectedMinutes`: estimates). Only your organization's models are listed. Listing is free; a model that has just finished is charged for here if this is the first call to see it (`credits`), exactly as getStudioModel would.
|
|
34982
35078
|
*/
|
|
34983
35079
|
static listStudioModels<ThrowOnError extends boolean = false>(options?: Options<ListStudioModelsData, ThrowOnError>): RequestResult<ListStudioModelsResponses, ListStudioModelsErrors, ThrowOnError>;
|
|
34984
35080
|
/**
|
|
34985
35081
|
* Create a prediction model and start training it
|
|
34986
35082
|
*
|
|
34987
|
-
* Define a model — what to predict, for whom, in which state, and the data points to use — and start training it. It answers at once with `status: training
|
|
35083
|
+
* Define a model — what to predict, for whom, in which state, and the data points to use — and start training it. It answers at once with `status: training` and `expectedMinutes`, a range that depends on the size of the state: a couple of minutes for a small state, 15 to 25 for the largest (an estimate; say the range, and say it is an estimate). Read the model with getStudioModel until it is `ready` or `refused`: `progress` gives the numbered step it is on and how long is left. `features` is the heart of it: the data points the person believes matter. Their own knowledge can be data points too — columns of their uploaded outcomes table such as a lead source or a rating their team gives. To learn from their own results instead of a market outcome, pass `outcomeSource` (an uploaded table with a home, a date and what happened on every row); that usually helps most. Everything a model learns from is taken strictly before each case's date, and a data point that could show it the answer is refused with the reason. To try a different list of data points, send the same `name` with `replace: true`, or a new name with `basedOn`: the new report card says what changed. An uploaded file's table is named `upload_<name>` (the upload `my_deals` is the table `upload_my_deals`); a wrong name is refused with the names that exist. A request that cannot work is refused now with a clear reason (`error`, `code`, and the numbers in `details`). One model trains at a time per organization, up to 10 models. 50 credits for a model that passes its checks, charged once when it has finished: by the first call that reads it or, if nobody does, on its own within about two hours. A model that is refused or fails is free.
|
|
34988
35084
|
*/
|
|
34989
35085
|
static createStudioModel<ThrowOnError extends boolean = false>(options: Options<CreateStudioModelData, ThrowOnError>): RequestResult<CreateStudioModelResponses, CreateStudioModelErrors, ThrowOnError>;
|
|
34990
35086
|
/**
|
|
34991
35087
|
* What a prediction model can be built from
|
|
34992
35088
|
*
|
|
34993
|
-
* Everything needed to define a model: the outcomes that can be predicted, who can be scored (`populations`), the data points a model may use, grouped by theme, each with a line on why someone might believe it matters, the limits,
|
|
35089
|
+
* Everything needed to define a model: the outcomes that can be predicted, who can be scored (`populations`), the data points a model may use, grouped by theme, each with a line on why someone might believe it matters, the limits, what a table of your own outcomes must contain, and how long a model takes for each state (`trainingTime`: a range of minutes, an estimate). Call this first, show the themes, and ASK which data points the person believes matter: a model is trained on exactly their picks, and its report card tests that belief. Free.
|
|
34994
35090
|
*/
|
|
34995
35091
|
static getStudioModelOptions<ThrowOnError extends boolean = false>(options?: Options<GetStudioModelOptionsData, ThrowOnError>): RequestResult<GetStudioModelOptionsResponses, GetStudioModelOptionsErrors, ThrowOnError>;
|
|
34996
35092
|
/**
|
|
@@ -35002,13 +35098,13 @@ declare class Studio {
|
|
|
35002
35098
|
/**
|
|
35003
35099
|
* A model: its status and its report card
|
|
35004
35100
|
*
|
|
35005
|
-
* The model and, once training has finished, its report card (`card`). Read the card as it is written. It says how many past cases the model learned from and was tested on; the lift (`in the top 10% of the list, X of every 100 had the outcome, against Y at random and Z for the best simple rule`); three checks, each passed or not; how much each chosen data point mattered; how the person's picks compare with using every data point; and the caveats. Never promise accuracy, and never call a score a probability unless `card.calibration.calibrated` is true (then
|
|
35101
|
+
* The model and, once training has finished, its report card (`card`). While it trains, `progress` says which numbered step it is on, how long it has been and how long is left (an estimate, as a range). Read the card as it is written, using its sentences and labels: fields named `id`, `code`, `verdict`, `better`, and everything under `technical`, are for programs and are never shown to a person. It says how many past cases the model learned from and was tested on; the lift (`in the top 10% of the list, X of every 100 had the outcome, against Y at random and Z for the best simple rule`); three checks, each passed or not; how much each chosen data point mattered; how the person's picks compare with using every data point; and the caveats. Never promise accuracy, and never call a score a probability unless `card.calibration.calibrated` is true (then each home's estimated chance is an estimate from past cases). `status: refused` means the model is not dependable enough to publish: `card.refusal.reason` says why and `card.refusal.whatWouldHelp` what to try; a refused model has no scores. When `scores` is not null, query `scores.table` with runStudioQuery: one row per home with `rank`, `percentile`, `score`, `topReason`, the home's `city` and `zipCode` (select those and leave `streetAddress` out to show the list without street addresses), and `propertyId` to join to `loans` and `sales`. Reading is free. 50 credits for a model that passes its checks, charged once when it has finished: by the first call that reads it or, if nobody does, on its own within about two hours. A model that is refused or fails is free. 10 credits for refreshed scores, charged once, the same way (a scheduled refresh too). The charge is reported in `credits`.
|
|
35006
35102
|
*/
|
|
35007
35103
|
static getStudioModel<ThrowOnError extends boolean = false>(options: Options<GetStudioModelData, ThrowOnError>): RequestResult<GetStudioModelResponses, GetStudioModelErrors, ThrowOnError>;
|
|
35008
35104
|
/**
|
|
35009
35105
|
* Refresh a model's scores with the latest data
|
|
35010
35106
|
*
|
|
35011
|
-
* Score the model's population again as of today, with the trained model as it is. The current scores stay queryable until the new ones are ready; read the model with getStudioModel to see when (`refresh` goes back to null and `scores.asOf` moves). Pass `retrain: true` to also train it again on the latest data (the same data points, a fresh report card; if it no longer passes its checks it becomes `refused` and its scores are taken down). A model with a `weekly` or `monthly` schedule is refreshed on its own. 10 credits for refreshed scores, charged once, the same way (a scheduled refresh too). 50 credits for a model that passes its checks, charged once when it has finished: by the first call that reads it or, if nobody does, on its own within about two hours. A model that is refused or fails is free.
|
|
35107
|
+
* Score the model's population again as of today, with the trained model as it is. The current scores stay queryable until the new ones are ready; read the model with getStudioModel to see when (`refresh` goes back to null and `scores.asOf` moves); `expectedMinutes` says how long it is expected to take. Pass `retrain: true` to also train it again on the latest data (the same data points, a fresh report card; if it no longer passes its checks it becomes `refused` and its scores are taken down). A model with a `weekly` or `monthly` schedule is refreshed on its own. 10 credits for refreshed scores, charged once, the same way (a scheduled refresh too). 50 credits for a model that passes its checks, charged once when it has finished: by the first call that reads it or, if nobody does, on its own within about two hours. A model that is refused or fails is free.
|
|
35012
35108
|
*/
|
|
35013
35109
|
static refreshStudioModel<ThrowOnError extends boolean = false>(options: Options<RefreshStudioModelData, ThrowOnError>): RequestResult<RefreshStudioModelResponses, RefreshStudioModelErrors, ThrowOnError>;
|
|
35014
35110
|
/**
|