-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
ch4Chapter 4Chapter 4
Description
I have modified "ch4 - Implementing Multiclass SVMs" code to use my own data set to train the classifier. The training process is good and so for the testing result. But I got some problems when I want to predict the new data that are without the labels.
I see three lines of code in "ch4 - Implementing Multiclass SVMs" which use those lines below to estimate the training acc :
prediction_output = tf.matmul(tf.multiply(y_target, b), pred_kernel)
prediction = tf.argmax(prediction_output - tf.expand_dims(tf.reduce_mean(prediction_output, 1), 1), 0)
accuracy = tf.reduce_mean(tf.cast(tf.equal(prediction, tf.argmax(y_target, 0)), tf.float32))
- How do I use this trained SVM model to predict the new data (no label)?
- It seems that I need the label for the data to run the prediction, but I think it is very weird why I need the y_target (label) to calculate the prediction result?
- How can those three lines of code get correct prediction result?
Hope someone can help me to figure out what's going on.
Metadata
Metadata
Assignees
Labels
ch4Chapter 4Chapter 4