← User manual

Synthetic variables

Create new columns with formulas, rules, automatic equation search, or predictive models.

A synthetic variable is a new column calculated from other columns in the dataset. The Synthetic variables module lets you:

  • write the formula yourself (Numeric variable creation or categorical),
  • classify rows with conditions (Rule-based variable),
  • let a search engine find an equation (Equation finder (genetic programming)),
  • train a machine learning model (Predictive model),
  • reuse saved equations (Equation evaluations).

Each tool is an expandable section in the left panel.

First choose the Target dataset: the new column is added to that dataset. Results appear on the right, in the Summary, Chart, and Table tabs.

Create a numeric variable

Numeric variable creation

  1. Expand Numeric variable creation.
  2. Enter the Expression. Use Insert column to add columns (they appear in square brackets, for example [Cu]) and Insert operator to add operators and functions.
  3. Enter the name of the Output column.
  4. Optional:
    • Limit to category: calculates the formula only on rows where a Scope column has a given Category value. The rest are left empty.
    • Fill missing values: before calculating, replaces empty cells in the columns used by the formula with a Numeric fill value. Without this option, a row with any empty column gives an empty result.
  5. Press Create numeric variable.

As you type, the application validates the expression and explains any error, for example a column that does not exist or a missing operator. Columns always go in square brackets: if you type Cu_pct instead of [Cu_pct], you will see “Cu_pct” looks like a column name written without brackets. The Preview on the right shows the expression and statistics for the columns it uses.

Once created you will see the notification Created CuEq (1500 rows, 0 nulls). and the result in Summary, Chart (histogram of the new variable), and Table.

Synthetic variable result

Operators and functions

ElementMeaning
+ - * /Addition, subtraction, multiplication, and division. Dividing by zero gives empty
**Power, for example [Cu] ** 2
abs(x)Absolute value
sqrt(x)Square root. Empty if x is negative
psqrt(x)Protected square root: sqrt(abs(x))
log(x) / log10(x)Natural and base-10 logarithm. Empty if x ≤ 0
plog(x)Protected logarithm: ln(abs(x)), and 0 if abs(x) ≤ 0.001
exp(x)Exponential
sin(x) cos(x) tan(x)Trigonometric functions (in radians)
pdiv(a, b)Protected division: a / b, and 1 if abs(b) ≤ 0.001
min(a, b) / max(a, b)Minimum or maximum of two values, row by row
min(x) / max(x)Minimum or maximum of the whole column
sum(x) mean(x) median(x) std(x)Sum, mean, median, and standard deviation of the whole column
coalesce(a, b)a if it has a value; if empty, b

Whole-column functions (sum, mean, median, std, and min/max with one argument) cannot contain another function of that type.

Examples:

  • log10([Cu]) to work with a variable on a logarithmic scale.
  • ([Cu] - mean([Cu])) / std([Cu]) to standardize a variable.
  • pdiv([Au], [Ag]) for a ratio without division-by-zero errors.
  • coalesce([Cu_ppm], [Cu_pct] * 10000) to fill one column with another.

Create a categorical variable

Expand Categorical Variable Creation. It works like the numeric one, but the expression combines text:

  • + concatenates values, for example [Lithology] + "_" + [Zone].
  • Fixed text goes in quotes: "A".
  • coalesce(a, b) uses b when a is empty.
  • Standalone numbers and other operators are not allowed.

Optionally, Fill missing values with a Categorical fill value.

Rule-based variable

Creates a variable (for example a rock class) from conditions, like a decision tree.

  1. Expand Rule-based variable. Choose a set from Saved rule sets or press New.
  2. Enter the Output variable and choose the Output type: Numeric or Categorical.
  3. Build the Rules: If column, operator, value Then value. Use Add condition (and) to combine conditions, Else if for another rule, and Else for the remaining case. The value can be text, another Column, or a Formula. Special operators: is one of, is not one of, is empty, and is not empty.
  4. Review the count (N rows · M left empty) and the Decision tree and Dependencies views.
  5. Save rule set saves it for reuse; Create variable writes the column to the dataset.

A rule can use the output of another rule set; create that one first.

Find equations automatically

Genetic programming equation finder

Equation finder (genetic programming) tries many combinations of candidate columns to find equations that predict a Target column. It uses symbolic regression: it evolves formulas generation after generation.

  1. Choose the Target column (numeric).
  2. Optional: choose a Matching dataset. Only columns that also exist in that dataset will be used as candidates, so you can apply the equation there later.
  3. Press Select variables. The candidate columns are listed, sorted by Importance or by Correlation with the target. Check the ones you want to use with Enable and press Apply.
  4. Optional: Limit to category and Fill missing values, as when creating a variable.
  5. In the Settings tab:
    • Output variable: prefix for the result columns (by default synth_<target>).
    • Number of results: how many equations to save (1 to 99).
    • Generations and Population size.
  6. In the Advanced tab (optional):
    • Random seed: repeats exactly the same search.
    • Parsimony coefficient (penalizes long formulas), Crossover probability, and subtree, hoist, and point mutation probabilities.
  7. Press Run finder. You can stop it with Cancel finder.

Results

When it finishes, the columns <prefix>_1, <prefix>_2, … are created in the target dataset, one per equation, and the equations are saved in the project. The results panel shows:

  • the Finder progress per generation,
  • each equation with its R², RMSE, and MAE,
  • a Predicted vs. target chart with the Identity line (the closer to the line, the better).

Predictive model

Trains a model that estimates a variable from others, with uncertainty.

  1. Expand Predictive model, Train tab.
  2. Choose the Target variable, the Task (Regression or Classification), and the Predictor variables. Use XYZ coordinates adds position as a predictor.
  3. Choose the Method: LightGBM, Gaussian process, or NGBoost, and the Test fraction.
  4. Optional: Restrict to a domain, Keep known values, and Retrain with all data.
  5. Enter the Output name and train. Besides the estimate, an uncertainty column with a suffix is created.

The result shows test metrics (RMSE, MAE, R², or accuracy), the Observed vs. predicted chart, the residuals, and the Variable importance. The model is saved: apply it to another dataset in the Apply saved model tab.

Reuse saved equations

Expand Equation Evaluations to apply a saved equation to another dataset:

  1. Choose the Saved equation. Its Canonical formula is shown.
  2. Under Matching variables, assign each Original variable of the equation a column from the Selected dataset.
  3. Enter the Output column and press Evaluate and create.

To delete an equation, use Delete equation.

Import equations

Under Import equation, press Choose .liden file to bring in the equations from a Lidenbrock Classic project. Optionally set a Name prefix. When it finishes, it shows how many were imported and how many were skipped.