Create new configuration for a model

models_post(table_name = NULL, database_id = NULL,
  credential_id = NULL, model_name = NULL, description = NULL,
  interaction_terms = NULL, box_cox_transformation = NULL,
  model_type_id = NULL, primary_key = NULL,
  dependent_variable = NULL, dependent_variable_order = NULL,
  excluded_columns = NULL, limiting_sql = NULL,
  active_build_id = NULL, cross_validation_parameters = NULL,
  number_of_folds = NULL, notifications = NULL, schedule = NULL,
  parent_id = NULL, time_zone = NULL, hidden = NULL)

Arguments

table_name

string optional. The qualified name of the table containing the training set from which to build the model.

database_id

integer optional. The ID of the database holding the training set table used to build the model.

credential_id

integer optional. The ID of the credential used to read the target table. Defaults to the user's default credential.

model_name

string optional. The name of the model.

description

string optional. A description of the model.

interaction_terms

boolean optional. Whether to search for interaction terms.

box_cox_transformation

boolean optional. Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.

model_type_id

integer optional. The ID of the model's type.

primary_key

string optional. The unique ID (primary key) of the training dataset.

dependent_variable

string optional. The dependent variable of the training dataset.

dependent_variable_order

array optional. The order of dependent variables, especially useful for Ordinal Modeling.

excluded_columns

array optional. A list of columns which will be considered ineligible to be independent variables.

limiting_sql

string optional. A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., "id > 105").

active_build_id

integer optional. The ID of the current active build, the build used to score predictions.

cross_validation_parameters

list optional. Cross validation parameter grid for tree methods, e.g. "n_estimators": [100, 200, 500], "learning_rate": [0.01, 0.1], "max_depth": [2, 3].

number_of_folds

integer optional. Number of folds for cross validation. Default value is 5.

notifications

list optional. A list containing the following elements:

  • urls array, URLs to receive a POST request at job completion

  • successEmailSubject string, Custom subject line for success e-mail.

  • successEmailBody string, Custom body text for success e-mail, written in Markdown.

  • successEmailAddresses array, Addresses to notify by e-mail when the job completes successfully.

  • successEmailFromName string, Name from which success emails are sent; defaults to "Civis."

  • successEmailReplyTo string, Address for replies to success emails; defaults to the author of the job.

  • failureEmailAddresses array, Addresses to notify by e-mail when the job fails.

  • stallWarningMinutes integer, Stall warning emails will be sent after this amount of minutes.

  • successOn boolean, If success email notifications are on.

  • failureOn boolean, If failure email notifications are on.

schedule

list optional. A list containing the following elements:

  • scheduled boolean, If the item is scheduled.

  • scheduledDays array, Day based on numeric value starting at 0 for Sunday.

  • scheduledHours array, Hours of the day it is scheduled on.

  • scheduledMinutes array, Minutes of the day it is scheduled on.

  • scheduledRunsPerHour integer, Alternative to scheduled minutes, number of times to run per hour.

parent_id

integer optional. The ID of the parent job that will trigger this model.

time_zone

string optional. The time zone of this model.

hidden

boolean optional. The hidden status of the item.

Value

A list containing the following elements:

id

integer, The ID of the model.

tableName

string, The qualified name of the table containing the training set from which to build the model.

databaseId

integer, The ID of the database holding the training set table used to build the model.

credentialId

integer, The ID of the credential used to read the target table. Defaults to the user's default credential.

modelName

string, The name of the model.

description

string, A description of the model.

interactionTerms

boolean, Whether to search for interaction terms.

boxCoxTransformation

boolean, Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.

modelTypeId

integer, The ID of the model's type.

primaryKey

string, The unique ID (primary key) of the training dataset.

dependentVariable

string, The dependent variable of the training dataset.

dependentVariableOrder

array, The order of dependent variables, especially useful for Ordinal Modeling.

excludedColumns

array, A list of columns which will be considered ineligible to be independent variables.

limitingSQL

string, A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., "id > 105").

activeBuildId

integer, The ID of the current active build, the build used to score predictions.

crossValidationParameters

list, Cross validation parameter grid for tree methods, e.g. "n_estimators": [100, 200, 500], "learning_rate": [0.01, 0.1], "max_depth": [2, 3].

numberOfFolds

integer, Number of folds for cross validation. Default value is 5.

notifications

list, A list containing the following elements:

  • urls array, URLs to receive a POST request at job completion

  • successEmailSubject string, Custom subject line for success e-mail.

  • successEmailBody string, Custom body text for success e-mail, written in Markdown.

  • successEmailAddresses array, Addresses to notify by e-mail when the job completes successfully.

  • successEmailFromName string, Name from which success emails are sent; defaults to "Civis."

  • successEmailReplyTo string, Address for replies to success emails; defaults to the author of the job.

  • failureEmailAddresses array, Addresses to notify by e-mail when the job fails.

  • stallWarningMinutes integer, Stall warning emails will be sent after this amount of minutes.

  • successOn boolean, If success email notifications are on.

  • failureOn boolean, If failure email notifications are on.

schedule

list, A list containing the following elements:

  • scheduled boolean, If the item is scheduled.

  • scheduledDays array, Day based on numeric value starting at 0 for Sunday.

  • scheduledHours array, Hours of the day it is scheduled on.

  • scheduledMinutes array, Minutes of the day it is scheduled on.

  • scheduledRunsPerHour integer, Alternative to scheduled minutes, number of times to run per hour.

parentId

integer, The ID of the parent job that will trigger this model.

runningAs

list, A list containing the following elements:

  • id integer, The ID of this user.

  • name string, This user's name.

  • username string, This user's username.

  • initials string, This user's initials.

  • online boolean, Whether this user is online.

timeZone

string, The time zone of this model.

lastRun

list, A list containing the following elements:

  • id integer,

  • state string,

  • createdAt string, The time that the run was queued.

  • startedAt string, The time that the run started.

  • finishedAt string, The time that the run completed.

  • error string, The error message for this run, if present.

hidden

boolean, The hidden status of the item.

user

list, A list containing the following elements:

  • id integer, The ID of this user.

  • name string, This user's name.

  • username string, This user's username.

  • initials string, This user's initials.

  • online boolean, Whether this user is online.

createdAt

string, The time the model was created.

updatedAt

string, The time the model was updated.

currentBuildState

string, The status of the current model build. One of "succeeded", "failed", "queued", or "running,"or "idle", if no build has been attempted.

currentBuildException

string, Exception message, if applicable, of the current model build.

builds

array, An array containing the following fields:

  • id integer, The ID of the model build.

  • name string, The name of the model build.

  • createdAt string, The time the model build was created.

  • description string, A description of the model build.

  • rootMeanSquaredError number, A key metric for continuous models. Nil for other model types.

  • rSquaredError number, A key metric for continuous models. Nil for other model types.

  • rocAuc number, A key metric for binary, multinomial, and ordinal models. Nil for other model types.

predictions

array, An array containing the following fields:

  • id integer, The ID of the model to which to apply the prediction.

  • tableName string, The qualified name of the table on which to apply the predictive model.

  • primaryKey array, The primary key or composite keys of the table being predicted.

  • limitingSQL string, A SQL WHERE clause used to scope the rows to be predicted.

  • outputTable string, The qualified name of the table to be created which will contain the model's predictions.

  • schedule object,

  • state string, The status of the prediction. One of: "succeeded", "failed", "queued", or "running,"or "idle", if no build has been attempted.

lastOutputLocation

string, The output JSON for the last build.

archived

string, The archival status of the requested item(s).