Coder Social home page Coder Social logo

Comments (2)

celsofranssa avatar celsofranssa commented on June 3, 2024

Trying to resolve the above error, I ensured that both X (training step csr_matrix) and Xt (prediction step csr_matrix) have the same number of features.

However, the following error has now occurred:

  File "main.py", line 29, in perform_tasks
    predict(params)
  File "main.py", line 15, in predict
    predict_helper.perform_predict()
  File "/home/celso/projects/XMTC-Baselines/source/helper/PredictHelper.py", line 70, in perform_predict
    prediction = model.predict(texts, texts_rpr)
  File "/home/celso/projects/venvs/XMTC-Baselines/lib/python3.8/site-packages/pecos/xmc/xtransformer/model.py", line 588, in predict
    pred_csr = self.concat_model.predict(
  File "/home/celso/projects/venvs/XMTC-Baselines/lib/python3.8/site-packages/pecos/xmc/xlinear/model.py", line 503, in predict
    Y_pred = self.model.predict(
  File "/home/celso/projects/venvs/XMTC-Baselines/lib/python3.8/site-packages/pecos/xmc/base.py", line 1557, in predict
    pred_csr = cur_model.predict(
  File "/home/celso/projects/venvs/XMTC-Baselines/lib/python3.8/site-packages/pecos/xmc/base.py", line 853, in predict
    clib.xlinear_single_layer_predict(
  File "/home/celso/projects/venvs/XMTC-Baselines/lib/python3.8/site-packages/pecos/core/base.py", line 864, in xlinear_single_layer_predict
    raise ValueError("Query matrix does not have sorted indices!")
ValueError: Query matrix does not have sorted indices!

How can I get around this error?

from pecos.

jiong-zhang avatar jiong-zhang commented on June 3, 2024

Hi @celsofranssa, as the error indicates, your input sparse matrices need to have sorted indices.

from pecos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.