track the occurrence for every type of word that may have occurred in a URL in our training data. A model can be trained on this data, but while predicting, new URLs may have words that did not occur in the training data. It is thus a challenging task to design a good feature representation that is robust to unseen data.

After obtaining the feature vector $\x$ for the training data, to learn the prediction function $\f: \R^d \rightarrow \R$, it is usually formulated as an optimization problem such that the detection accuracy is maximized (or alternately, a loss function is minimized). The function $\f$ is (usually) parameterized by a $d-$ dimensional weight vector $\w$, such that $\f(\x) = (\w^\top\x)$. Let $\hat{y_t} = \sign (\f(\x_t))$ denote the class label prediction made by the function $\f$. The number of mistakes made by the prediction model on the entire training data is given by: $\sum_{t=1}^T\I_{\hat{y_t} = y_t}$ where $\I$ is an indicator which evaluates to $1$ if the condition is true, and $0$ otherwise. Since the indicator function is not convex, the optimization can be difficult to solve. As a result, a convex loss function is often defined, and is denoted by 