[null,null,["最后更新时间 (UTC):2025-02-25。"],[[["\u003cp\u003eSupervised similarity measures leverage deep neural networks (DNNs) to learn embeddings, which are lower-dimensional representations of feature data, for comparing items like YouTube videos.\u003c/p\u003e\n"],["\u003cp\u003eUnlike manual similarity measures, supervised measures excel with large datasets and automatically handle redundant information, but they lack the interpretability of manual methods.\u003c/p\u003e\n"],["\u003cp\u003eTo create a supervised similarity measure, you train a DNN (either an autoencoder predicting its own input or a predictor focusing on key features) to generate embeddings that capture item similarity.\u003c/p\u003e\n"],["\u003cp\u003eWhen designing the DNN, prioritize numerical features as labels and avoid label leakage by removing the label feature from the input data.\u003c/p\u003e\n"],["\u003cp\u003eEmbeddings from similar items will be clustered closer together in the embedding space, allowing for similarity comparisons using distance-based metrics.\u003c/p\u003e\n"]]],[],null,["Instead of comparing manually-combined feature data, you can reduce the feature\ndata to representations called\n[**embeddings**](/machine-learning/glossary#embeddings), then compare the\nembeddings. Embeddings are generated by training a supervised [**deep neural\nnetwork**](/machine-learning/glossary#neural_network) (**DNN** ) on the feature\ndata itself. The embeddings map the feature data to a vector in an embedding\nspace with typically fewer dimensions than the feature data. Embeddings are\ndiscussed in the [Embeddings](/machine-learning/crash-course/embeddings)\nmodule of Machine Learning Crash Course, while neural nets are discussed in the\n[Neural nets](/machine-learning/crash-course/neural-networks)\nmodule. Embedding vectors for similar examples, such as YouTube videos on\nsimilar topics watched by the same users, end up close together in the embedding\nspace. A **supervised similarity measure**\nuses this \"closeness\" to quantify the similarity for pairs of\nexamples.\n\nRemember, we're discussing supervised learning only to create our similarity\nmeasure. The similarity measure, whether manual or supervised, is then used by\nan algorithm to perform unsupervised clustering.\n\nComparison of Manual and Supervised Measures\n\nThis table describes when to use a manual or supervised similarity\nmeasure depending on your requirements.\n\n| Requirement | Manual | Supervised |\n|----------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|\n| Eliminates redundant information in correlated features? | No, you need to investigate any correlations between features. | Yes, DNN eliminates redundant information. |\n| Gives insight into calculated similarities? | Yes | No, embeddings cannot be deciphered. |\n| Suitable for small datasets with few features? | Yes. | No, small datasets don't provide enough training data for a DNN. |\n| Suitable for large datasets with many features? | No, manually eliminating redundant information from multiple features and then combining them is very difficult. | Yes, the DNN automatically eliminates redundant information and combines features. |\n\nCreating a supervised similarity measure\n\nHere's an overview of the process to create a supervised similarity measure:\n**Figure 1: Steps to create a supervised similarity\nmeasure.**\n\nThis page discusses DNNs, while\nthe following pages cover the remaining steps.\n\nChoose DNN based on training labels\n\nReduce your feature data to lower-dimensional embeddings by training a DNN that\nuses the same feature data both as input and as the labels. For example, in\nthe case of house data, the DNN would use the features---such as price, size, and\npostal code---to predict those features themselves.\n\nAutoencoder\n\nA DNN that learns embeddings of input data by predicting the input data itself\nis called an [autoencoder](/machine-learning/glossary#autoencoder).\nBecause an autoencoder's hidden layers are smaller\nthan the input and output layers, the autoencoder is forced to learn a\ncompressed representation of the input feature data. Once the DNN is trained,\nextract the embeddings from the smallest hidden layer to calculate similarity.\n**Figure 2: Autoencoder architecture.**\n\nPredictor\n\nAn autoencoder is the simplest choice to generate embeddings. However, an\nautoencoder isn't the optimal choice when certain features could be more\nimportant than others in determining similarity. For example, in house data,\nassume price is more important than postal code. In such cases, use\nonly the important feature as the training label for the DNN. Since this DNN\npredicts a specific input feature instead of predicting all input features, it\nis called a **predictor** DNN. Embeddings should usually be extracted from the\nlast embedding layer.\n**Figure 3: Predictor architecture.**\n\nWhen choosing a feature to be the label:\n\n- Prefer numerical to categorical features because loss\n is easier to calculate and interpret for numeric features.\n\n- Remove the feature that you use as the label from the input to the DNN, or\n else the DNN will use that feature to perfectly predict the output. (This is\n an extreme example of [label leakage](/machine-learning/glossary#label-leakage).)\n\nDepending on your choice of labels, the resulting DNN is either an\nautoencoder or a predictor.\n| **Key terms:**\n|\n| - [embeddings](/machine-learning/glossary#embeddings)\n| - [Deep Neural Network (DNN)](/machine-learning/glossary#neural_network)"]]