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/08/01 01:36:18 UTC

Re: Cannot train 2 or more features for Solr LTR using LIBLINEAR

Hi,

Anyone has any information on this?

Regards,
Edwin

On Mon, 30 Jul 2018 at 11:15, Zheng Lin Edwin Yeo <ed...@gmail.com>
wrote:

> Hi,
>
> I am using the Solr LTR in Solr 7.4.0, and I am trying to train an example
> learning model using LIBLINEAR.
>
> When I tried to run the code from train_and_upload_demo_model.py , I can
> only train one feature at a time. If I put more than one features, then I
> will get the following error
>
> Traceback (most recent call last):
>
>   File "train_and_upload_demo_model.py", line 182, in <module>
>
>     sys.exit(main())
>
>   File "train_and_upload_demo_model.py", line 169, in main
>
>
> formatter.processQueryDocFeatureVector(fvGenerator,config["trainingFile"]);
>
>   File
> "/cygdrive/c/Users/edwin/Desktop/solr-7.4.0/contrib/ltr/myModel/libsvm_formatter.py",
> line 25, in processQueryDocFeatureVector
>
>     curListOfFv.append((relevance,self._makeFeaturesMap(featureVector)))
>
>   File
> "/cygdrive/c/Users/edwin/Desktop/solr-7.4.0/contrib/ltr/myModel/libsvm_formatter.py",
> line 35, in _makeFeaturesMap
>
>     featName,featValue = keyValuePairStr.split(":");
>
> ValueError: too many values to unpack
>
>
> Is there any way that we can do so that we can train 2 or more features at
> the same time?
>
> Regards,
> Edwin
>
>