$\ell(\f(\x), y)$ and the entire optimization can be formulated as: $$\begin{aligned}
        \min_\w \sum_{t=1}^T \ell(\f(\x_t), y_t)
    \end{aligned}$$

Several types of loss functions can be used, including the popular hinge-loss $\ell(\f(\x), y) = \frac{1}{2} \max(1 - y\f(\x), 0)$, or the squared-loss $\ell(\f(\x), y) = \frac{1}{2} (\f(\x) - y)^2$. Sometimes, a regularization term is often added to prevent over-fitting or to learn sparse models, or the loss function can be modified based on cost-sensitive nature of the data (e.g., class imbalanced distribution, different costs for diverse threats).

In the following, we will discuss the existing studies on feature representation for malicious URL detection and appropriate machine learning algorithms design in detail.

![image](feature.jpg){width="100mm"}

Feature Representation
======================

As stated earlier, the success of a machine learning model critically depends on the quality of the training data, which hinges on the quality of feature representation. Given a URL $\u \in \mathbb{U}$, where $\mathbb{U}$ denotes a domain of any valid URL strings, the goal of feature representation is to find a mapping $g:\mathbb{U}\rightarrow\R^d$, such that $g(\u) \rightarrow \x$ where $\x \in \R^d$ is a $d$-dimensional feature vector, that can be fed into machine learning models. The process of feature representation can be further broken down into two 