Technology — pikaia

pikaia: our Genetic AI, open source

pikaia is the Python library behind every danube.ai product — evolutionary simulation for multi-objective optimization, ranking and matching, without a single row of training data.

Get started

One command away

pikaia is published on PyPI under the MIT license. Install it, point it at a table of comparable attributes, and inspect the evolution yourself.

Install

pip install pikaia
12 / 7 / 2
Gene / organism / mixing strategies
30–80×
D-matrix speed-up
99%
Test coverage
MIT
Open-source license

How it works

Evolution instead of training

In Genetic AI a data problem is converted into a model of genes and organisms. Evolutionary simulations then surface the behaviours and correlations hidden in the data.

Genetic AI: an evolving population of organisms along a genetic lattice

Genes and organisms

A data problem is translated into a genetic model: attributes become genes, records become organisms. No embeddings, no labels — just the fields you already store.

Evolutionary games

Genes compete under strategies such as dominant, altruistic, kin-altruistic, selfish, variance, entropy-max, orthogonality, partial correlation, redundancy penalty and the sell-easy / sell-hard / sell-uniform family; organisms play balanced, altruistic, selfish, kin-selfish or buy-easy / buy-hard / buy-uniform. A replicator equation drives the population until the trade-off stabilises.

Ab initio, no training data

pikaia does not learn from history. Every run is a fresh simulation over the current data, so there is no cold start, no retraining cycle and no inherited historical bias.

D-matrix acceleration

For compatible strategy combinations the iteration collapses into matrix form, typically running 30–80× faster than the standard iterative mode — with identical results.

Modular strategy system

12 gene strategies, 7 organism strategies and 2 mixing strategies (fixed and self-consistent) ship with the library, in supervised and unsupervised modes. Adding your own strategy is a documented extension point.

Research-ready

Built-in plotting, Jupyter notebook examples and 99% test coverage — pikaia is used for teaching and research as much as it powers our commercial products.

Quickstart

A first simulation in 30 lines

Scale your attributes, choose gene and organism strategies, fit the model — and read the fitness history the ranking is derived from.

1import numpy as np
2from pikaia.data import PikaiaPopulation
3from pikaia.models import PikaiaModel
4from pikaia.schemas import GeneStrategyEnum, OrgStrategyEnum, MixStrategyEnum
5from pikaia.strategies import (
6 GeneStrategyFactory, OrgStrategyFactory, MixStrategyFactory,
7)
8
9# 3 items, 3 comparable attributes (scaled to 0..1)
10raw = np.array([[300, 10, 2], [600, 5, 2], [1500, 4, 1]])
11scaled = (raw - raw.min(axis=0)) / (raw.max(axis=0) - raw.min(axis=0))
12population = PikaiaPopulation(scaled)
13
14model = PikaiaModel(
15 population=population,
16 gene_strategies=[
17 GeneStrategyFactory.get_strategy(GeneStrategyEnum.DOMINANT),
18 GeneStrategyFactory.get_strategy(GeneStrategyEnum.ALTRUISTIC),
19 ],
20 org_strategies=[
21 OrgStrategyFactory.get_strategy(OrgStrategyEnum.BALANCED),
22 OrgStrategyFactory.get_strategy(OrgStrategyEnum.SELFISH),
23 ],
24 gene_mix_strategy=MixStrategyFactory.get_strategy(MixStrategyEnum.FIXED),
25 org_mix_strategy=MixStrategyFactory.get_strategy(MixStrategyEnum.FIXED),
26 use_d_matrix=True, # 30-80x faster on large populations
27 max_iter=500,
28)
29model.fit()
30
31print("Gene fitness history:", model.gene_fitness_history)

Comparison

Against a trained ranking model

Trained ML modelpikaia
Training dataLarge labelled corpus requiredNone
Cold startPoor until history accumulatesFull quality from request one
ExplainabilityPost-hoc approximationIntrinsic to the result
Bias handlingInherits historical biasAttributes included by choice
AdaptationRetraining cycleChange the criteria, take effect now
InspectabilityWeights in a closed artefactMIT-licensed source on GitHub

Try Genetic AI on your own data

With DarwinNGC you can already upload your own data and run Genetic AI on it. Ready to try it for yourself? - or get in touch directly.