Skip to content

Commit

Permalink
Move ltr.feature.norm classes into their own ltr.norm package (apache#87
Browse files Browse the repository at this point in the history
)

* Move ltr.feature.norm classes into their own ltr.norm package (since now Feature.java now longer uses Normalizer.java).

* Folding norm.impl.* into just norm package.

* Remove two not-needed imports.
  • Loading branch information
cpoerschke authored and Michael Nilsson committed Sep 28, 2016
1 parent 843b299 commit 70c1682
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 53 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.Explanation;
import org.apache.solr.ltr.feature.norm.Normalizer;
import org.apache.solr.ltr.model.LTRScoringModel;
import org.apache.solr.ltr.norm.Normalizer;
import org.apache.solr.ltr.ranking.Feature;
import org.apache.solr.ltr.util.LTRUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.Explanation;
import org.apache.solr.ltr.feature.FeatureException;
import org.apache.solr.ltr.feature.norm.Normalizer;
import org.apache.solr.ltr.feature.norm.impl.IdentityNormalizer;
import org.apache.solr.ltr.norm.IdentityNormalizer;
import org.apache.solr.ltr.norm.Normalizer;
import org.apache.solr.ltr.ranking.Feature;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.ltr.feature.norm.impl;
package org.apache.solr.ltr.norm;

import java.util.LinkedHashMap;

import org.apache.solr.ltr.feature.norm.Normalizer;

public class IdentityNormalizer extends Normalizer {

public static final IdentityNormalizer INSTANCE = new IdentityNormalizer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.ltr.feature.norm.impl;
package org.apache.solr.ltr.norm;

import java.util.LinkedHashMap;
import org.apache.solr.ltr.feature.norm.Normalizer;

public class MinMaxNormalizer extends Normalizer {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.ltr.feature.norm;
package org.apache.solr.ltr.norm;

import java.util.LinkedHashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.ltr.feature.norm.impl;
package org.apache.solr.ltr.norm;

import java.util.LinkedHashMap;

import org.apache.solr.ltr.feature.norm.Normalizer;

public class StandardNormalizer extends Normalizer {

private float avg = 0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
* will be computed, the normalizer will be applied and the resulting values
* will be received by the model.
*/
package org.apache.solr.ltr.feature.norm;
package org.apache.solr.ltr.norm;
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.Explanation;
import org.apache.solr.ltr.feature.norm.Normalizer;
import org.apache.solr.ltr.model.LTRScoringModel;
import org.apache.solr.ltr.model.ModelException;
import org.apache.solr.ltr.norm.Normalizer;
import org.apache.solr.ltr.util.LTRUtils;

public class LambdaMARTModel extends LTRScoringModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.Explanation;
import org.apache.solr.ltr.feature.norm.Normalizer;
import org.apache.solr.ltr.model.LTRScoringModel;
import org.apache.solr.ltr.model.ModelException;
import org.apache.solr.ltr.norm.Normalizer;

public class RankSVMModel extends LTRScoringModel {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.ltr.feature.FeatureStore;
import org.apache.solr.ltr.feature.ModelStore;
import org.apache.solr.ltr.feature.norm.Normalizer;
import org.apache.solr.ltr.feature.norm.impl.IdentityNormalizer;
import org.apache.solr.ltr.model.LTRScoringModel;
import org.apache.solr.ltr.model.ModelException;
import org.apache.solr.ltr.norm.IdentityNormalizer;
import org.apache.solr.ltr.norm.Normalizer;
import org.apache.solr.ltr.ranking.Feature;
import org.apache.solr.ltr.util.CommonLTRParams;
import org.apache.solr.response.SolrQueryResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name":"matchedTitle",
"norm": {
"class":"org.apache.solr.ltr.feature.norm.impl.MinMaxNormalizer",
"class":"org.apache.solr.ltr.norm.MinMaxNormalizer",
"params":{ "min":"0.0f", "max":"10.0f" }
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
"name":"popularity",
"norm": {
"class":"org.apache.solr.ltr.feature.norm.impl.MinMaxNormalizer",
"class":"org.apache.solr.ltr.norm.MinMaxNormalizer",
"params":{ "min":"0.0f", "max":"10.0f" }
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name":"feature2normalize",
"norm": {
"class":"org.apache.solr.ltr.feature.norm.impl.StandardNormalizer",
"class":"org.apache.solr.ltr.norm.StandardNormalizer",

"params":{
"avg":0.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.ltr.TestRerankBase;
import org.apache.solr.ltr.feature.norm.Normalizer;
import org.apache.solr.ltr.feature.norm.impl.IdentityNormalizer;
import org.apache.solr.ltr.model.LTRScoringModel;
import org.apache.solr.ltr.model.ModelException;
import org.apache.solr.ltr.norm.IdentityNormalizer;
import org.apache.solr.ltr.norm.Normalizer;
import org.apache.solr.ltr.ranking.Feature;
import org.apache.solr.ltr.ranking.RankSVMModel;
import org.apache.solr.ltr.rest.ManagedModelStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.ltr.feature.norm.impl;
package org.apache.solr.ltr.norm;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Expand All @@ -23,7 +23,6 @@
import java.util.Map;

import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.ltr.feature.norm.Normalizer;
import org.junit.Test;

public class TestMinMaxNormalizer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.ltr.feature.norm.impl;
package org.apache.solr.ltr.norm;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Expand All @@ -23,7 +23,6 @@
import java.util.Map;

import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.ltr.feature.norm.Normalizer;
import org.junit.Test;

public class TestStandardNormalizer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.ltr.feature.impl.ValueFeature;
import org.apache.solr.ltr.feature.norm.Normalizer;
import org.apache.solr.ltr.ranking.ModelQuery.FeatureInfo;
import org.apache.solr.ltr.feature.norm.impl.IdentityNormalizer;
import org.apache.solr.ltr.model.LTRScoringModel;
import org.apache.solr.ltr.model.ModelException;
import org.apache.solr.ltr.norm.IdentityNormalizer;
import org.apache.solr.ltr.norm.Normalizer;
import org.junit.Test;

@SuppressCodecs("Lucene3x")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.ltr.feature.impl.FieldValueFeature;
import org.apache.solr.ltr.feature.norm.Normalizer;
import org.apache.solr.ltr.feature.norm.impl.IdentityNormalizer;
import org.apache.solr.ltr.model.LTRScoringModel;
import org.apache.solr.ltr.norm.IdentityNormalizer;
import org.apache.solr.ltr.norm.Normalizer;
import org.apache.solr.ltr.ranking.ModelQuery.ModelWeight;
import org.apache.solr.ltr.ranking.ModelQuery.ModelWeight.ModelScorer;
import org.junit.Ignore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.ltr.TestRerankBase;
import org.apache.solr.ltr.feature.impl.ValueFeature;
import org.apache.solr.ltr.feature.norm.Normalizer;
import org.apache.solr.ltr.feature.norm.impl.IdentityNormalizer;
import org.apache.solr.ltr.model.ModelException;
import org.apache.solr.ltr.norm.IdentityNormalizer;
import org.apache.solr.ltr.norm.Normalizer;
import org.apache.solr.ltr.ranking.LTRThreadModule;
import org.junit.AfterClass;
import org.junit.BeforeClass;
Expand Down

0 comments on commit 70c1682

Please sign in to comment.