Causal nearest neighbor rules for optimal treatment regimes