Files
chess-engine/python/python/data/preprocessing.py
KeshavAnandCode 9e2fe0cae6 feat: add project structure and basic NNUE model
- Create python directory with data/, model/ subdirectories
- Implement LinearEval(61072->1) model
- Add config, constants, feature_extractor
- Add tests with 4 passing test cases
2026-04-14 18:03:42 -05:00

12 lines
324 B
Python

"""Data preprocessing and cleaning"""
import numpy as np
def normalize_features(features: np.ndarray) -> np.ndarray:
"""Normalize features to zero mean, unit variance"""
mean = features.mean(axis=0)
std = features.std(axis=0)
std[std == 0] = 1 # Avoid division by zero
return (features - mean) / std