Coder Social home page Coder Social logo

shoelace's Introduction

shoelace's People

Contributors

rjagerman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

shoelace's Issues

How did you compute ndcg?

Hi, thanks for your library.
the accuracy of output example code, for listmle, listpl and listnet are the same. you computed ndcg in your article.
how did you compute ndcg?

How do I use shoelace for prediction?

Hi,

Thank you for making your code available!

I was wondering if you could give me some directions for how to actually use the trained neural network for predicting query scores. That is, supose I have a training file where each line looks like this:

  1 qid:25662 1:5.0 2:1.0 3:1.0

and I trained your model on it following your example code in README:

from shoelace.dataset import LtrDataset
from shoelace.iterator import LtrIterator
from shoelace.loss.listwise import listnet
from chainer import training, optimizers, links, Chain
from chainer.training import extensions

# Load data and set up iterator
with open('./path/to/ranksvm.txt', 'r') as f:
    training_set = LtrDataset.load_txt(f)
training_iterator = LtrIterator(training_set, repeat=True, shuffle=True)

# Create neural network with chainer and apply loss function
predictor = links.Linear(None, 1)
class Ranker(Chain):
    def __call__(self, x, t):
        return listnet(self.predictor(x), t)
loss = Ranker(predictor=predictor)

# Build optimizer, updater and trainer
optimizer = optimizers.Adam()
optimizer.setup(loss)
updater = training.StandardUpdater(training_iterator, optimizer)
trainer = training.Trainer(updater, (40, 'epoch'))
trainer.extend(extensions.ProgressBar())

# Train neural network
trainer.run()

Now I have a test file where each line looks like this:

  qid:34562 1:2.0 2:3.0 3:5.0  

How do I use the trainer above to predict the query score?

Thanks very much!

Format of input dataset?

Nowhere in the docs is the format of input dataset mentioned.
In what format should data be fed to the model?

Thank you?

Official Docs out of date

Hey there, thanks for your library, it seems very useful. I noticed an issue with the docs located at:
https://rjagerman.github.io/shoelace/datasets.html

The section on datasets contains the snippet
`from shoelace.dataset import LtrIterator

iterator = LtrIterator(dataset)`

Which appears to contain an incorrect import statement, as LtrIterator is located in shoelace.iterator.

The Readme.MD contains the correct snippet.

Thanks!

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.