You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my hyperparameter search, I am trying to perform KNN classification with query labels in my 'test' set and reference labels in my 'train' set. I thought of doing the following:
Add custom accuracy metric by subclassing accuracycalculator
use splits_to_eval to include {'test' : 'train'}
I thought along with a custom function and splits_to_eval, I should get the KNN classifier. However, this is not going to help - reason being - the accuracy calculator class is supposed to compare class labels of query and reference embeddings -- and not supposed to predict class label for query. Is this correct?
The InferenceModel class has all the required ingredients for doing KNN I believe. It would really help if you can provide some idea on how to go about this. (I think having KNNClassifier in future version would be a really good feature)
The text was updated successfully, but these errors were encountered:
I'll come back to this tomorrow, but I just wanted to say that it might be worth trying scikit learn's KNeighborsClassifier if you haven't already. You just need to convert your tensors to numpy.
Thanks for the suggestion. Let me try that.
I am thinking to first call
base_tester.get_all_embeddings(dataset, trunk, embedder, collate_fn,..) to compute emberddings for both train and test set and then use that in sklearn.
Excellent library Kevin - Thanks a lot.
In my hyperparameter search, I am trying to perform KNN classification with query labels in my 'test' set and reference labels in my 'train' set. I thought of doing the following:
I thought along with a custom function and splits_to_eval, I should get the KNN classifier. However, this is not going to help - reason being - the accuracy calculator class is supposed to compare class labels of query and reference embeddings -- and not supposed to predict class label for query. Is this correct?
The InferenceModel class has all the required ingredients for doing KNN I believe. It would really help if you can provide some idea on how to go about this. (I think having KNNClassifier in future version would be a really good feature)
The text was updated successfully, but these errors were encountered: