skills/tabular/multi-input-embedding-nn/SKILL.md
Keras multi-input model with separate embedding layers for categoricals, GRU for text sequences, and dense layers for numerics, all concatenated into a shared regression trunk
npx skillsauth add wenmin-wu/ds-skills tabular-multi-input-embedding-nnInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
For datasets mixing categorical, text, and numeric features, build a single Keras model with dedicated input branches: Embedding layers for each categorical, Embedding+GRU for text sequences, and a passthrough for numerics. Concatenate all branches into shared dense layers. This avoids lossy manual encoding and lets the network learn feature interactions end-to-end.
from tensorflow.keras.layers import (Input, Embedding, GRU, Dense,
Flatten, Dropout, concatenate)
from tensorflow.keras.models import Model
name = Input(shape=(MAX_NAME_LEN,))
desc = Input(shape=(MAX_DESC_LEN,))
brand = Input(shape=(1,))
condition = Input(shape=(1,))
num_vars = Input(shape=(NUM_FEATURES,))
emb_desc = Embedding(VOCAB_SIZE, 60)(desc)
emb_name = Embedding(VOCAB_SIZE, 20)(name)
emb_brand = Embedding(NUM_BRANDS, 10)(brand)
emb_cond = Embedding(NUM_CONDITIONS, 5)(condition)
gru_desc = GRU(16)(emb_desc)
gru_name = GRU(8)(emb_name)
x = concatenate([gru_desc, gru_name, Flatten()(emb_brand),
Flatten()(emb_cond), num_vars])
x = Dropout(0.1)(Dense(128, activation='relu')(x))
x = Dropout(0.1)(Dense(64, activation='relu')(x))
output = Dense(1, activation='linear')(x)
model = Model([name, desc, brand, condition, num_vars], output)
model.compile(optimizer='adam', loss='mse')
Tokenizer, pad to fixed lengthsInput per feature groupdata-ai
Scaled Pinball Loss (SPL) metric for evaluating quantile forecasts, normalized by mean absolute successive differences of training data
data-ai
Walk backward through a time series and multiplicatively rescale segments when jumps exceed a fraction of the running mean to correct data collection anomalies
testing
Transform forecasting target to next/current ratio minus one so that optimizing MAE or squared error implicitly minimizes SMAPE
tools
Convert point forecasts to prediction intervals by scaling with logit-transformed quantile ratios passed through a Normal CDF