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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值