rare pattern extraction