You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Zheng Lin Edwin Yeo <ed...@gmail.com> on 2018/09/12 02:50:21 UTC

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

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 <ed...@gmail.com>
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
>