-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to predict with libsvm data? #327
Comments
@xuanhuiwang sorry to be bothering, but you seemed to be quite active in those past issues. |
For training and evaluating with libsvm data, there is now a libsvm parser in the At a high-level, you should be able to use something like this to get predictions on libsvm files (this is a rough sketch and not a complete solution): model.fit()
...
path = "... path to your libsvm file ..."
with tf.io.gfile.GFile(path, "r") as f:
for input in LibSVMRankingParser(f, {0: "feature_0", 1: "feature_1", ...}, "label"):
label = input.pop("label")
predictions = model(input)
... |
I will close this issue now. Feel free to reach out or re-open if you have further questions about LibSVM-style data. |
Hello! I'm training and evaluating data in the libsvm format (using tf_ranking_libsvm.py), however I'd like to do predictions too, but I'm having no success at it.
I'm not really good at coding, so is there any straightforward way to do it? I've already seen #69, #65, #77, #78 and some others, and while some people were able to predict, from my understanding, those methods are not available now.
Some of the proposed solutions were to do "ranker.predict()", or "estimator.predict()", but it appears those are "undefined names". Some solutions were based on a "libsvm_generator", but from what I've seen, that function has been removed.
Any help would be appreciated, thank you very much! :)
The text was updated successfully, but these errors were encountered: