This commit is contained in:
2026-04-24 15:42:54 +09:00
parent be4c383b6f
commit cd38fd49e2
18 changed files with 11609 additions and 235 deletions

View File

@@ -1,23 +1,25 @@
#!/bin/bash
# Arguments: script_dir working_dir data_dir train_data_count validate_data_count margin
# Arguments: script_dir working_dir data_dir train_count validate_count margin validate_iterations
SCRIPT_DIR=${1:-"script"}
WORKING_DIR=${2:-"."}
DATA_DIR=${3:-"datas"}
TRAIN_COUNT=${4:-100}
VAL_COUNT=${5:-20}
MARGIN=${6:-0.1}
MARGIN=${6:-0.5}
VAL_ITERATIONS=${7:-5}
# 작업 디렉토리가 없으면 생성
if [ ! -d "$WORKING_DIR" ]; then
echo "Creating directory: $WORKING_DIR"
echo "Creating working 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"
# factors.json이 없으면 생성
if [ ! -f "$WORKING_DIR/factors.json" ]; then
echo "Factors file not found. Running factorization..."
bun run "$SCRIPT_DIR/extract.ts" "$WORKING_DIR" "$DATA_DIR"
fi
echo "Training model..."
python3 "$SCRIPT_DIR/train.py" "$SCRIPT_DIR" "$WORKING_DIR" "$DATA_DIR" "$TRAIN_COUNT" "$VAL_COUNT" "$MARGIN"
echo "Starting training..."
python3 "$SCRIPT_DIR/train.py" "$SCRIPT_DIR" "$WORKING_DIR" "$DATA_DIR" "$TRAIN_COUNT" "$VAL_COUNT" "$MARGIN" "$VAL_ITERATIONS"