This commit is contained in:
2026-04-24 13:43:00 +09:00
parent c4d8c8145a
commit be4c383b6f
23 changed files with 533 additions and 1833 deletions

23
train.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# Arguments: script_dir working_dir data_dir train_data_count validate_data_count margin
SCRIPT_DIR=${1:-"script"}
WORKING_DIR=${2:-"."}
DATA_DIR=${3:-"datas"}
TRAIN_COUNT=${4:-100}
VAL_COUNT=${5:-20}
MARGIN=${6:-0.1}
# 작업 디렉토리가 없으면 생성
if [ ! -d "$WORKING_DIR" ]; then
echo "Creating directory: $WORKING_DIR"
mkdir -p "$WORKING_DIR"
fi
# 피처 추출 (존재 시 생략)
if [ ! -f "$WORKING_DIR/features.json" ]; then
echo "Extracting features..."
bun "$SCRIPT_DIR/extract.ts" "$WORKING_DIR" "$DATA_DIR" "$TRAIN_COUNT" "$VAL_COUNT"
fi
echo "Training model..."
python3 "$SCRIPT_DIR/train.py" "$SCRIPT_DIR" "$WORKING_DIR" "$DATA_DIR" "$TRAIN_COUNT" "$VAL_COUNT" "$MARGIN"