@model-match/api 3.84.0 → 3.85.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 CHANGED
@@ -2,6 +2,12 @@
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.85.0
6
+
7
+ - **Start from a ModelMatch model**: `createStudioModel` takes `basedOnPublished` (a published model's `mm_model_<name>` table). Its outcome, data points and weighting become your own model, trained for you, with anything you pass overriding them; the report card compares with the published original. The model shows `basedOnPublished`. `404 published_model_not_found` for a table that is not a published model.
8
+ - **Copy a job**: `createStudioJob` takes `copyFrom` (one of your jobs) or `copyFromPublished` (a published job's `mm_<name>` table) instead of `sql`; the copy is yours to edit, starts `manual`, and shows `copiedFrom`.
9
+ - `getStudioPublishedModel` adds `weighting`, one sentence per setting.
10
+
5
11
  ## 3.84.0
6
12
 
7
13
  - **Studio models can be weighted** (`createStudioModel`, all optional):
@@ -14082,7 +14082,7 @@ type StudioJob = {
14082
14082
  */
14083
14083
  column?: string;
14084
14084
  /**
14085
- * `rows_added` — a key that was not in the previous run. `rows_removed` — a key the previous run had and this one does not. `threshold` — `column` `op` `value` holds for a key now and did not in the previous run.
14085
+ * `rows_added`: a key new since the previous run. `rows_removed`: a key gone since. `threshold`: `column` `op` `value` holds for a key now and did not before.
14086
14086
  */
14087
14087
  on: 'rows_added' | 'rows_removed' | 'threshold';
14088
14088
  /**
@@ -14094,6 +14094,13 @@ type StudioJob = {
14094
14094
  */
14095
14095
  value?: number;
14096
14096
  }>;
14097
+ /**
14098
+ * When it was saved as a copy: the job (`job`) or the ModelMatch table (`published`) it came from.
14099
+ */
14100
+ copiedFrom?: {
14101
+ job?: string;
14102
+ published?: string;
14103
+ };
14097
14104
  createdAt: string;
14098
14105
  createdBy?: string;
14099
14106
  description?: string;
@@ -14145,7 +14152,7 @@ type StudioJobDetail = {
14145
14152
  */
14146
14153
  column?: string;
14147
14154
  /**
14148
- * `rows_added` — a key that was not in the previous run. `rows_removed` — a key the previous run had and this one does not. `threshold` — `column` `op` `value` holds for a key now and did not in the previous run.
14155
+ * `rows_added`: a key new since the previous run. `rows_removed`: a key gone since. `threshold`: `column` `op` `value` holds for a key now and did not before.
14149
14156
  */
14150
14157
  on: 'rows_added' | 'rows_removed' | 'threshold';
14151
14158
  /**
@@ -14245,7 +14252,7 @@ type StudioJobList = {
14245
14252
  };
14246
14253
  type StudioJobRequest = {
14247
14254
  /**
14248
- * Changes between one run and the next worth flagging. A match is recorded on the run and, on a scheduled run, emailed to the job's creator.
14255
+ * Changes between runs to flag; on a scheduled run a match is emailed to the creator.
14249
14256
  */
14250
14257
  alerts?: Array<{
14251
14258
  /**
@@ -14253,7 +14260,7 @@ type StudioJobRequest = {
14253
14260
  */
14254
14261
  column?: string;
14255
14262
  /**
14256
- * `rows_added` — a key that was not in the previous run. `rows_removed` — a key the previous run had and this one does not. `threshold` — `column` `op` `value` holds for a key now and did not in the previous run.
14263
+ * `rows_added`: a key new since the previous run. `rows_removed`: a key gone since. `threshold`: `column` `op` `value` holds for a key now and did not before.
14257
14264
  */
14258
14265
  on: 'rows_added' | 'rows_removed' | 'threshold';
14259
14266
  /**
@@ -14265,12 +14272,20 @@ type StudioJobRequest = {
14265
14272
  */
14266
14273
  value?: number;
14267
14274
  }>;
14275
+ /**
14276
+ * Copy one of your jobs by name; fields given override it.
14277
+ */
14278
+ copyFrom?: string;
14279
+ /**
14280
+ * Or copy a ModelMatch `mm_*` table's job.
14281
+ */
14282
+ copyFromPublished?: string;
14268
14283
  /**
14269
14284
  * What the job is for. Shown in the catalog.
14270
14285
  */
14271
14286
  description?: string;
14272
14287
  /**
14273
- * The column or columns that identify one row of the result (for example `companyNmlsId`). Needed for 'what changed' and for alerts; one row per key.
14288
+ * Columns identifying one row (e.g. `companyNmlsId`); needed for 'what changed' and alerts.
14274
14289
  */
14275
14290
  keys?: Array<string>;
14276
14291
  /**
@@ -14283,11 +14298,11 @@ type StudioJobRequest = {
14283
14298
  /**
14284
14299
  * `manual` — runs only when asked. `daily` — about every 24 hours. `weekly` — every 7 days. Counted from when the job is saved.
14285
14300
  */
14286
- schedule: 'manual' | 'daily' | 'weekly';
14301
+ schedule?: 'manual' | 'daily' | 'weekly';
14287
14302
  /**
14288
- * One read-only SELECT, checked when the job is saved. It may use `$as_of`, the date of the run (a DATE), so the same job can be re-run for any day.
14303
+ * One read-only SELECT, checked when the job is saved. It may use `$as_of`, the date of the run (a DATE), so the same job can be re-run for any day. Required unless copying.
14289
14304
  */
14290
- sql: string;
14305
+ sql?: string;
14291
14306
  };
14292
14307
  type StudioJobRun = {
14293
14308
  /**
@@ -14312,7 +14327,7 @@ type StudioJobRun = {
14312
14327
  */
14313
14328
  column?: string;
14314
14329
  /**
14315
- * `rows_added` — a key that was not in the previous run. `rows_removed` — a key the previous run had and this one does not. `threshold` — `column` `op` `value` holds for a key now and did not in the previous run.
14330
+ * `rows_added`: a key new since the previous run. `rows_removed`: a key gone since. `threshold`: `column` `op` `value` holds for a key now and did not before.
14316
14331
  */
14317
14332
  on: 'rows_added' | 'rows_removed' | 'threshold';
14318
14333
  /**
@@ -14425,6 +14440,10 @@ type StudioJobUpdate = {
14425
14440
  };
14426
14441
  type StudioModel = {
14427
14442
  asOf: string;
14443
+ /**
14444
+ * The ModelMatch model this one was copied from (its table); its card compares against it.
14445
+ */
14446
+ basedOnPublished?: string;
14428
14447
  /**
14429
14448
  * The priority boosts (empty when none). When there are any, the scores table also has `priorityScore`, `priorityRank` and `priorityMultiplier`: sort by `priorityRank` for the boosted list; `score` and `rank` stay the model's own.
14430
14449
  */
@@ -14765,6 +14784,10 @@ type StudioModelCreate = {
14765
14784
  * Another of your models to start from: what this request omits is taken from it; the card compares the two.
14766
14785
  */
14767
14786
  basedOn?: string;
14787
+ /**
14788
+ * Copy a ModelMatch model (`mm_model_*` table); fields given override it.
14789
+ */
14790
+ basedOnPublished?: string;
14768
14791
  /**
14769
14792
  * After the model: matching homes' score × `multiply` is `priorityScore`; `score` and the card are unchanged. Text: `in`/`notIn`; numbers: `gte`/`lte`; dates: `onOrAfter`/`onOrBefore`.
14770
14793
  */
@@ -14865,7 +14888,7 @@ type StudioModelDeleted = {
14865
14888
  };
14866
14889
  type StudioModelError = {
14867
14890
  /**
14868
- * Stable code. The request: `invalid_request`, `invalid_model`, `invalid_model_name`, `unknown_outcome`, `unknown_data_point`, `blocked_data_point` (a data point that describes today, not the as-of date), `unknown_table`, `unknown_column`, `unsupported_key`, `direction_not_allowed` (a direction on a data point that is not a number), `invalid_boost`. The model: `model_not_found`, `model_exists`, `model_limit_reached`, `model_training_in_progress`, `model_not_ready`. Your own data: `no_date_column`, `data_point_is_outcome`, `data_point_is_key`, `data_point_after_outcome`, `data_point_needs_outcomes_table`, `data_points_missing_for_population`, `too_few_examples`, `too_few_positives`, `outcomes_all_one_class`, `outcome_dates_in_future`, `match_rate_too_low`. Access: `entitlement_missing` (the model uses neighborhood data points, or a boost or direction on where a home is, that your organization has not enabled; `details.dataPoints`, `details.boostColumns`, `details.directionRules`), `entitlement_unavailable`. Shared: `busy`, `rate_limited`, `no_organization`, `models_unavailable`, `studio_unavailable`.
14891
+ * Stable code. The request: `invalid_request`, `invalid_model`, `invalid_model_name`, `unknown_outcome`, `unknown_data_point`, `blocked_data_point` (a data point that describes today, not the as-of date), `unknown_table`, `unknown_column`, `unsupported_key`, `direction_not_allowed` (a direction on a data point that is not a number), `invalid_boost`. The model: `model_not_found`, `published_model_not_found` (`basedOnPublished` names no published model), `model_exists`, `model_limit_reached`, `model_training_in_progress`, `model_not_ready`. Your own data: `no_date_column`, `data_point_is_outcome`, `data_point_is_key`, `data_point_after_outcome`, `data_point_needs_outcomes_table`, `data_points_missing_for_population`, `too_few_examples`, `too_few_positives`, `outcomes_all_one_class`, `outcome_dates_in_future`, `match_rate_too_low`. Access: `entitlement_missing` (the model uses neighborhood data points, or a boost or direction on where a home is, that your organization has not enabled; `details.dataPoints`, `details.boostColumns`, `details.directionRules`), `entitlement_unavailable`. Shared: `busy`, `rate_limited`, `no_organization`, `models_unavailable`, `studio_unavailable`.
14869
14892
  */
14870
14893
  code: string;
14871
14894
  /**
@@ -15239,6 +15262,10 @@ type StudioPublishedModel = {
15239
15262
  * The table its scores are in, the same for every organization. Query it with Studio.
15240
15263
  */
15241
15264
  table: string;
15265
+ /**
15266
+ * How it was weighted — recent history, direction rules, priority boosts — one sentence each; empty when it was not. A copy (`basedOnPublished` on createStudioModel) starts with the same settings.
15267
+ */
15268
+ weighting: Array<string>;
15242
15269
  };
15243
15270
  type StudioPublishedModelResult = {
15244
15271
  data: StudioPublishedModel;
@@ -33167,7 +33194,7 @@ type ListStudioModelsErrors = {
33167
33194
  */
33168
33195
  403: StudioModelError;
33169
33196
  /**
33170
- * `model_not_found` — your organization has no model of that name.
33197
+ * `model_not_found` — your organization has no model of that name. `published_model_not_found` — `basedOnPublished` names no model ModelMatch publishes.
33171
33198
  */
33172
33199
  404: StudioModelError;
33173
33200
  /**
@@ -33215,7 +33242,7 @@ type CreateStudioModelErrors = {
33215
33242
  */
33216
33243
  403: StudioModelError;
33217
33244
  /**
33218
- * `model_not_found` — your organization has no model of that name.
33245
+ * `model_not_found` — your organization has no model of that name. `published_model_not_found` — `basedOnPublished` names no model ModelMatch publishes.
33219
33246
  */
33220
33247
  404: StudioModelError;
33221
33248
  /**
@@ -33267,7 +33294,7 @@ type GetStudioModelOptionsErrors = {
33267
33294
  */
33268
33295
  403: StudioModelError;
33269
33296
  /**
33270
- * `model_not_found` — your organization has no model of that name.
33297
+ * `model_not_found` — your organization has no model of that name. `published_model_not_found` — `basedOnPublished` names no model ModelMatch publishes.
33271
33298
  */
33272
33299
  404: StudioModelError;
33273
33300
  /**
@@ -33365,7 +33392,7 @@ type DeleteStudioModelErrors = {
33365
33392
  */
33366
33393
  403: StudioModelError;
33367
33394
  /**
33368
- * `model_not_found` — your organization has no model of that name.
33395
+ * `model_not_found` — your organization has no model of that name. `published_model_not_found` — `basedOnPublished` names no model ModelMatch publishes.
33369
33396
  */
33370
33397
  404: StudioModelError;
33371
33398
  /**
@@ -33422,7 +33449,7 @@ type GetStudioModelErrors = {
33422
33449
  */
33423
33450
  403: StudioModelError;
33424
33451
  /**
33425
- * `model_not_found` — your organization has no model of that name.
33452
+ * `model_not_found` — your organization has no model of that name. `published_model_not_found` — `basedOnPublished` names no model ModelMatch publishes.
33426
33453
  */
33427
33454
  404: StudioModelError;
33428
33455
  /**
@@ -33479,7 +33506,7 @@ type RefreshStudioModelErrors = {
33479
33506
  */
33480
33507
  403: StudioModelError;
33481
33508
  /**
33482
- * `model_not_found` — your organization has no model of that name.
33509
+ * `model_not_found` — your organization has no model of that name. `published_model_not_found` — `basedOnPublished` names no model ModelMatch publishes.
33483
33510
  */
33484
33511
  404: StudioModelError;
33485
33512
  /**
@@ -35765,7 +35792,7 @@ declare class Studio {
35765
35792
  /**
35766
35793
  * Save a question as a job
35767
35794
  *
35768
- * Save a SQL question to run again: on a schedule (`daily`, `weekly`) or only when asked (`manual`). Each run stores its result as a table named after the job, which later questions — and later jobs — can query like any other table. Name the `keys` (the columns that identify one row) to get 'what changed since the last run', and add `alerts` to flag new rows, removed rows or a number crossing a threshold. When an alert matches on a scheduled run, the job's creator is emailed (once per hourly tick, every job of theirs in one email, also in their notifications); `notify: { email: false }` saves the job without those emails, and `updateStudioJob` changes it later. Webhooks are not available yet. The SQL is checked when the job is saved: an unknown table or column, or a key that is not in the result, is refused here rather than at the first run. Saving does not run the job. Saving is free; each run that succeeds costs 10 credits, including the runs a `daily` or `weekly` schedule starts.
35795
+ * Save a SQL question to run again: on a schedule (`daily`, `weekly`) or only when asked (`manual`). Each run stores its result as a table named after the job, which later questions — and later jobs — can query like any other table. Name the `keys` (the columns that identify one row) to get 'what changed since the last run', and add `alerts` to flag new rows, removed rows or a number crossing a threshold. When an alert matches on a scheduled run, the job's creator is emailed (once per hourly tick, every job of theirs in one email, also in their notifications); `notify: { email: false }` saves the job without those emails, and `updateStudioJob` changes it later. Webhooks are not available yet. The SQL is checked when the job is saved: an unknown table or column, or a key that is not in the result, is refused here rather than at the first run. Saving does not run the job. To start from an existing job, give `copyFrom` (one of your jobs) or `copyFromPublished` (the `mm_*` table of a job ModelMatch publishes) instead of `sql`: its SQL, keys, alerts and description are copied into an editable job of your own — anything the request gives overrides them — checked like any other, starting `manual`; the job keeps `copiedFrom`. A published table built by a program, or a published model (copy that with createStudioModel and `basedOnPublished`), cannot be copied as a job. Saving is free; each run that succeeds costs 10 credits, including the runs a `daily` or `weekly` schedule starts.
35769
35796
  */
35770
35797
  static createStudioJob<ThrowOnError extends boolean = false>(options: Options<CreateStudioJobData, ThrowOnError>): RequestResult<CreateStudioJobResponses, CreateStudioJobErrors, ThrowOnError>;
35771
35798
  /**
@@ -35801,7 +35828,7 @@ declare class Studio {
35801
35828
  /**
35802
35829
  * Create a prediction model and start training it
35803
35830
  *
35804
- * 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. Data points marked `needsFairLendingReview` describe the neighborhood and need neighborhood data enabled for the organization (`neighborhoodDataAllowed` on getStudioModelOptions): without it a model that uses them — including one that leaves `features` out, which means every data point — is refused with `403 entitlement_missing`, naming them in `details.dataPoints`; so is a priority boost on ZIP code or city, or a direction rule on a place (`details.boostColumns`, `details.directionRules`); tell the person to ask their ModelMatch admin, or pick other data points. Weighting is optional: `recencyWeighting` counts recent past cases more while learning (testing stays unweighted), a `direction` on a number data point holds the model to it, and `boosts` add `priorityScore` and `priorityRank` to the scores table after the model; the report card is about `score`, never the boosted order. A request that cannot work is refused now with a clear reason (`error`, `code`, and the numbers in `details`). An organization can have a few models running at once (3 by default; past that, `409 model_training_in_progress` says how many are running and the limit), and a model runs once at a time; 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.
35831
+ * 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. Data points marked `needsFairLendingReview` describe the neighborhood and need neighborhood data enabled for the organization (`neighborhoodDataAllowed` on getStudioModelOptions): without it a model that uses them — including one that leaves `features` out, which means every data point — is refused with `403 entitlement_missing`, naming them in `details.dataPoints`; so is a priority boost on ZIP code or city, or a direction rule on a place (`details.boostColumns`, `details.directionRules`); tell the person to ask their ModelMatch admin, or pick other data points. `basedOnPublished` starts from a model ModelMatch publishes (its `mm_model_*` table): its outcome, data points and weighting are copied into your organization as your own model — anything this request gives overrides them — and trained on your scope; its report card compares with the published original. Neighborhood data points, boosts or directions it carries need neighborhood data enabled like your own (or override `features` / `boosts` to leave them out). Weighting is optional: `recencyWeighting` counts recent past cases more while learning (testing stays unweighted), a `direction` on a number data point holds the model to it, and `boosts` add `priorityScore` and `priorityRank` to the scores table after the model; the report card is about `score`, never the boosted order. A request that cannot work is refused now with a clear reason (`error`, `code`, and the numbers in `details`). An organization can have a few models running at once (3 by default; past that, `409 model_training_in_progress` says how many are running and the limit), and a model runs once at a time; 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.
35805
35832
  */
35806
35833
  static createStudioModel<ThrowOnError extends boolean = false>(options: Options<CreateStudioModelData, ThrowOnError>): RequestResult<CreateStudioModelResponses, CreateStudioModelErrors, ThrowOnError>;
35807
35834
  /**