Skip to main content
Every column is read as one of these types. The type is inferred from the values, and you can override it for any column.

How the type is inferred

The rules are applied in this order.
  1. A column with no values at all is ignore.
  2. A boolean column is a category.
  3. A datetime column is a date. A string column is also a date when at least 95% of its distinct values read as dates.
  4. A column whose cells are lists of numbers of the same length is an embedding.
  5. A numeric column is a number. It is an id instead when it has at least 50 rows, holds only whole numbers, nearly every value is different (99% or more), and its name looks like an id, such as id, customer_id or account_no.
  6. A string column is text when it has at least 64 distinct values and at least half of its values contain a space.
  7. A string column is an id when it has at least 50 rows, nearly every value is different, and hardly any value contains a space.
  8. Any other string column is a category.
The image, audio and document types are never inferred, because a link looks like any other string. Set them yourself with column_types. The report of every request lists each column with its type and the reason the rule gave. Check it the first time you send a new table.

Overriding a type

Pass column_types to change the type of any column.
Common reasons to override:
  • A code stored as a number, such as a postcode or a product code, is a category, not a number.
  • A short free-text field with few distinct values may be read as a category. Mark it as text if the wording matters.
  • A column that would leak the answer, such as a field filled in after the outcome, should be ignore.

Dates

A date is read as a point in time. When you give a time_column, every other date column is read relative to the row’s own time. For example, an account_opened date on a row dated 31 October tells the model how long the account had been open on 31 October. This keeps the meaning of the column stable as time moves on.

Columns the model does not read

The report lists the columns the model could not use, such as a column that has the same value in every context row. When you predict, the report also lists the columns of your rows that were not in the context. Those columns are not read.