In this first example, we will work approximating the probability of the presence of heart disease, using an univariate logistic regression, being this variable, the patients age.
Since version 0.8, TensorFlow has provided a means of generating one hot. The function used for this generation is
tf.one_hot, which has this form:
tf.one_hot(indices, depth, on_value=1, off_value=0, axis=None, dtype=tf.float32, name=None)
This functions generates a generalized one hot encoding data structure, which can specify the values, axis of generation, data type, and so on.
In the resulting tensors, the indicated values of the indexes will take the
1, and the others will ...