LIBLINEAR model lacks weight(s) when training for SolrFeatures in LTR

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

LIBLINEAR model lacks weight(s) when training for SolrFeatures in LTR

Zheng Lin Edwin Yeo
Hi,

I am using Solr 7.4.0, and using LIBLINEAR to do the training for the LTR
model based on this example:
https://github.com/bloomberg/lucene-solr/blob/master-ltr/solr/contrib/ltr/example/README.md

However, I found that when I wanted to train for solr filter query with the
class SolrFeature, I will get the following error saying that the model
lacks weight(s):

Exception: Status: 400 Bad Request
Response: {
  "responseHeader":{
    "status":400,
    "QTime":1},
  "error":{
    "metadata":[
      "error-class","org.apache.solr.common.SolrException",
      "root-error-class","org.apache.solr.ltr.model.ModelException"],
    "msg":"org.apache.solr.ltr.model.ModelException: Model myModel lacks
weight(s) for [category]",

This is how I define it in my feature JSON file:

  {
    "store" : "myFeatures",
    "name" : "category",
    "class" : "org.apache.solr.ltr.feature.SolrFeature",
    "params" : {
"fq": ["{!terms f=category}book"]
}
  }

What could be the reason that causes this, and how can we resolve this
issue?

Regards,
Edwin
Reply | Threaded
Open this post in threaded view
|

Re: LIBLINEAR model lacks weight(s) when training for SolrFeatures in LTR

Zheng Lin Edwin Yeo
I have found that it is due to insufficient training data that are related
to that feature.
After I add more entries that are related to that features to the training
data, the issues did not occur.

Regards,
Edwin

On Tue, 28 Aug 2018 at 15:56, Zheng Lin Edwin Yeo <[hidden email]>
wrote:

> Hi,
>
> I am using Solr 7.4.0, and using LIBLINEAR to do the training for the LTR
> model based on this example:
> https://github.com/bloomberg/lucene-solr/blob/master-ltr/solr/contrib/ltr/example/README.md
>
> However, I found that when I wanted to train for solr filter query with
> the class SolrFeature, I will get the following error saying that the model
> lacks weight(s):
>
> Exception: Status: 400 Bad Request
> Response: {
>   "responseHeader":{
>     "status":400,
>     "QTime":1},
>   "error":{
>     "metadata":[
>       "error-class","org.apache.solr.common.SolrException",
>       "root-error-class","org.apache.solr.ltr.model.ModelException"],
>     "msg":"org.apache.solr.ltr.model.ModelException: Model myModel lacks
> weight(s) for [category]",
>
> This is how I define it in my feature JSON file:
>
>   {
>     "store" : "myFeatures",
>     "name" : "category",
>     "class" : "org.apache.solr.ltr.feature.SolrFeature",
>     "params" : {
> "fq": ["{!terms f=category}book"]
> }
>   }
>
> What could be the reason that causes this, and how can we resolve this
> issue?
>
> Regards,
> Edwin
>