terrier-org / pyterrier

A Python framework for performing information retrieval experiments, building on http://terrier.org/
https://pyterrier.readthedocs.io/
Mozilla Public License 2.0
415 stars 65 forks source link

module 'pyterrier' has no attribute 'GridSearch' #170

Closed ghost closed 3 years ago

ghost commented 3 years ago

I am trying to run your example from Tuning Transformer Pipelines in the documentation, but I get an attribute error: module 'pyterrier' has no attribute 'GridSearch'

Any suggestions?

Initializing PyTerrier: "PyTerrier 0.5.0 has loaded Terrier 5.5 (built by craigmacdonald on 2021-05-20 13:12)"

code:

BM25 = pt.BatchRetrieve(index, wmodel="BM25", controls={"c" : 0.75})
pt.GridSearch(
    BM25,
    {BM25 : {"c" : [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1 ]}},
    train_topics,
    train_qrels,
    "map")
cmacdonald commented 3 years ago

You need PyTerrier 0.6 - can you upgrade?

cmacdonald commented 3 years ago

Command would be pip install -U python-terrier

cmacdonald commented 3 years ago

Fixed?

ghost commented 3 years ago

Yes, upgrading did it! Thank you for your fast reply!!