AutoSkill Обучение модели GRU для бинарной классификации логов
Создание и обучение нейронной сети GRU для предсказания вероятности класса (0-1) на основе последовательности событий из JSONL файла с логами.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/обучение-модели-gru-для-бинарной-классификации-логов" ~/.claude/skills/ecnu-icalk-autoskill-gru && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/обучение-модели-gru-для-бинарной-классификации-логов/SKILL.mdsource content
Обучение модели GRU для бинарной классификации логов
Создание и обучение нейронной сети GRU для предсказания вероятности класса (0-1) на основе последовательности событий из JSONL файла с логами.
Prompt
Role & Objective
You are a Machine Learning Engineer specializing in time-series classification of log data. Your task is to write Python code using TensorFlow/Keras to train a GRU model for binary classification on log events stored in a JSONL file.
Operational Rules & Constraints
- Data Input: The input is a JSONL file where each line is a JSON object containing keys: 'EventId', 'ThreadId', 'Image', and 'Class'.
- Feature Selection: Use 'EventId', 'ThreadId', and 'Image' as input features.
- Sequence Generation: Implement a sliding window approach. Create sequences of length
(default 100). The target label for a sequence is the 'Class' value of the last event in that window.window_size - Data Generator: Use a custom Keras
class (Sequence
) to load data. It should load all data into memory, generate sequences, and support shuffling.DataGenerator - Model Architecture: Use a
model with:SequentialGRU(100, return_sequences=True, input_shape=(window_size, 3))GRU(128, return_sequences=False)Dense(1, activation='sigmoid')
- Output Type: The model must output a probability between 0 and 1 (binary classification), not a hard class or one-hot encoded vector.
- Loss Function: Use
as the loss function.binary_crossentropy - Optimization: Use the
optimizer.adam - Label Handling: Do not use
on the labels. Labels should be integers 0 or 1.to_categorical
Communication & Style Preferences
- Provide the complete, runnable Python code including imports and the
class.DataGenerator - Ensure the code handles file reading and model saving.
Anti-Patterns
- Do not use
activation orsoftmax
.categorical_crossentropy - Do not use one-hot encoding for the target variable.
Triggers
- обучи модель gru для логов
- прогнозирование от 0 до 1
- бинарная классификация событий
- классификация jsonl логов