技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
data-and-feature-columns【数据与研究】Use this DeepCTR sub-skill for SparseFeat, DenseFeat, VarLenSparseFeat, hashing, embedding sharing, input dictionaries, and tabular or sequence feature-column validation.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the task is about preparing DeepCTR inputs before a model is chosen or trained: categorical ids, dense numerical vectors, variable-length sequences, feature hashing, vocabulary files, shared embeddings, and get_feature_names.
SparseFeat, DenseFeat, or VarLenSparseFeat objects.length_name, weight_name, or shared embedding errors.get_feature_names.use_hash=True, missing feature names, shape mismatch, padding id 0, or incompatible shared embeddings.SparseFeat, or set use_hash=True with dtype="string" when hashing string values on the fly.DenseFeat(name, dimension) for dense vectors; make each input array shape match the declared dimension.VarLenSparseFeat(SparseFeat(...), maxlen=...) for multi-value or sequence ids. Pad every row to (batch_size, maxlen).0 reserved for padding when a sequence field relies on masking instead of an explicit length_name.embedding_name only when fields truly share one embedding table and have the same vocabulary size, embedding dimension, and trainability.get_feature_names(linear_feature_columns + dnn_feature_columns) and build model_input = {name: array for name in feature_names}.tf.feature_column Estimator workflows.For a quick preflight, create a JSON file like:
{
"features": [
{"type": "SparseFeat", "name": "item_id", "vocabulary_size": 1001, "embedding_dim": 8},
{"type": "DenseFeat", "name": "score", "dimension": 1},
{
"type": "VarLenSparseFeat",
"name": "hist_item_id",
"maxlen": 4,
"length_name": "seq_length",
"sparsefeat": {"name": "hist_item_id", "vocabulary_size": 1001, "embedding_dim": 8, "embedding_name": "item_id"}
}
]
}
Then run:
python sub-skills/data-and-feature-columns/scripts/validate_feature_spec.py feature_spec.json
The helper catches common structural mistakes; it does not replace a real TensorFlow model smoke test.
dtype="string" on SparseFeat or VarLenSparseFeat unless use_hash=True or values are pre-encoded.maxlen to the vocabulary size; maxlen is the number of ids in one row's list.0 as a real category id for padded sequence features unless using an explicit length convention that still keeps masking consistent.