- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Is there a way of getting the labels of the support vectors after training?
Thank you,
Javier
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you please elaborate? do you mean support vectors of the trained data? or prediction labels?
Thanks
Preethi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Preethi,
In PyDAAL there is a method to get the support vectors of a SVM model (model.getSupportVectors()). However, I don't see a way of getting the labels for these vectors.
I see that there is a new update available that introduces a getSupportIndices() method. I might be able to use this to get the labels from the training dataset.
Regards,
Javier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes you are right, the support indices can be used to get the respective labels
import numpy as np intBlock = BlockDescriptor_Intc() model.getSupportIndices().getBlockOfRows(0, model.getSupportIndices().getNumberOfRows(), readOnly, intBlock) getIndex = intBlock.getArray() model.getSupportIndices().releaseBlockOfRows(intBlock) trainGroundTruth.getBlockOfRows(0, trainGroundTruth.getNumberOfRows(), readOnly, intBlock) getArray = intBlock.getArray() trainGroundTruth.releaseBlockOfRows(intBlock) print(getArray[np.ndarray.flatten(getIndex)])

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page