Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-16759: Introducing logAll parameter in the feature logger #1586

Merged

Conversation

aruggero
Copy link
Contributor

@aruggero aruggero commented Apr 24, 2023

https://issues.apache.org/jira/browse/SOLR-16759

Description

Currently, there is no possibility of deciding how many features to log.
It would be useful to give the user the ability to decide if to print all the features of the store or only the features used by the model.
Suppose to execute a query with both logging and reranking, where the logging store is the same as the model store.
Suppose the model store contains 200 features while the model uses just half of them.
The logging will always consider all the 200 features of the store.
There is no possibility of printing only the 100 features used by the model.

Solution

An external parameter logAll has been added to the features transformer in order to give the user the possibility to choose how many features to log.
The new parameter has been added to:

  • solr/modules/ltr/src/java/org/apache/solr/ltr/FeatureLogger.java
  • solr/modules/ltr/src/java/org/apache/solr/ltr/CSVFeatureLogger.java

Tests

Several tests have been added into org/apache/solr/ltr/feature/TestFeatureLogging.java
We add one test for each feature logger store - logAll parameter combination.
We checked that the set of features returned is the expected on (all the features in the store or only the model features).

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

@alessandrobenedetti alessandrobenedetti force-pushed the feature/feature-logger-extract-all branch 7 times, most recently from afe2f38 to bcc54a8 Compare April 26, 2023 15:14
@alessandrobenedetti alessandrobenedetti marked this pull request as draft April 27, 2023 16:02
@alessandrobenedetti alessandrobenedetti force-pushed the feature/feature-logger-extract-all branch 2 times, most recently from f54a4b5 to 07f6a65 Compare April 28, 2023 14:19
Copy link
Contributor

@alessandrobenedetti alessandrobenedetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR is now in a good state and ready for additional reviews!

@aruggero aruggero marked this pull request as ready for review April 28, 2023 15:43
@alessandrobenedetti alessandrobenedetti force-pushed the feature/feature-logger-extract-all branch 3 times, most recently from d23805f to bb4c368 Compare May 12, 2023 09:28
@alessandrobenedetti
Copy link
Contributor

Running checks, merging on monday!

@alessandrobenedetti alessandrobenedetti force-pushed the feature/feature-logger-extract-all branch from 35b5349 to 2ad0548 Compare May 12, 2023 10:54
@alessandrobenedetti alessandrobenedetti force-pushed the feature/feature-logger-extract-all branch from bed14b6 to 543c71d Compare May 15, 2023 11:04
Copy link
Contributor

@alessandrobenedetti alessandrobenedetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proceeding with merge

@alessandrobenedetti alessandrobenedetti merged commit f9f5b59 into apache:main May 15, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants