feature columns

think of feature columns as the intermediaries between raw data and estimators. feature columns are very rich, enabling you to transform a diverse range of raw data into formats that estimators can use, allowing easy experimentation


what kind of data can a deep neural network operate on? the answer is, of course, numbers(for example, tf.float32). after all, every neuron in a neural network performs multiplication and addition operations on weights and input data


ML models generally represent categorical values as simple vectors in which a 1 represents the presence of a value and a 0 represents the absence of a value


when we just use a single number(a year) as input, a linear model can only learn a linear relationship. so, bucketing provides the model with additional flexibility that the model can use to learn


a categorical identity column mapping. note that this is a one-hot encoding, not a binary numberical encoding


we cannot input strings directly to a model. instead, we must first map strings to numeric or categorical values. categorical vocabulary columns provide a goog way to represent strings as a ont-hot vector


categorical_column_with_vocabulary_list maps each string to an integer based on an explicit vocabulary list


as with many counterintuitive phenomena in machine learning, it turns out that hashing often works well in practice. that's because hash categories provide the model with some separation. the model can use additional features to further separate kitchenware from sports


an embedding column stores categorical data in a lower-dimensional vector that an indicator column


that is, the model learns the best way to map your input numeric categorical values to the embeddings vector value in order to solve your problem. embedding columns increase your model's capabilities, since an embeddings vector learns new relationships between categories from the training data


why is the embedding vector size 3 in our example? well, the following "formula" provides a general rule of thumb about the number of embedding dimensions:
###
embedding_dimensions = number_of_categories**0.25


embeddings is a significant topic within machine learning
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章