Class CommunityFeatureData<U>
java.lang.Object
es.uam.eps.ir.relison.links.recommendation.features.CommunityFeatureData<U>
- Type Parameters:
U
- type of the users.
- All Implemented Interfaces:
es.uam.eps.ir.ranksys.core.feature.FeatureData<U,java.lang.Integer,java.lang.Double>
,es.uam.eps.ir.ranksys.core.index.FeatureIndex<java.lang.Integer>
,es.uam.eps.ir.ranksys.core.index.ItemIndex<U>
public class CommunityFeatureData<U>
extends java.lang.Object
implements es.uam.eps.ir.ranksys.core.feature.FeatureData<U,java.lang.Integer,java.lang.Double>
Class for loading feature data from an index.
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
CommunityFeatureData(java.util.Map<U,java.util.Map<java.lang.Integer,java.lang.Double>> itemMap, java.util.Map<java.lang.Integer,java.util.Map<U,java.lang.Double>> featMap)
Constructor. -
Method Summary
Modifier and Type Method Description boolean
containsFeature(java.lang.Integer f)
boolean
containsItem(U i)
java.util.stream.Stream<java.lang.Integer>
getAllFeatures()
java.util.stream.Stream<U>
getAllItems()
java.util.stream.Stream<org.jooq.lambda.tuple.Tuple2<U,java.lang.Double>>
getFeatureItems(java.lang.Integer f)
java.util.stream.Stream<java.lang.Integer>
getFeaturesWithItems()
java.util.stream.Stream<org.jooq.lambda.tuple.Tuple2<java.lang.Integer,java.lang.Double>>
getItemFeatures(U i)
java.util.stream.Stream<U>
getItemsWithFeatures()
static <U> CommunityFeatureData<U>
load(Communities<U> comms)
Loads the feature data from a forward index.int
numFeatures()
int
numFeatures(U i)
int
numFeaturesWithItems()
int
numItems()
int
numItems(java.lang.Integer f)
int
numItemsWithFeatures()
-
Field Details
-
Constructor Details
-
CommunityFeatureData
protected CommunityFeatureData(java.util.Map<U,java.util.Map<java.lang.Integer,java.lang.Double>> itemMap, java.util.Map<java.lang.Integer,java.util.Map<U,java.lang.Double>> featMap)Constructor.- Parameters:
itemMap
- item to features map.featMap
- features to items map.
-
-
Method Details
-
numItemsWithFeatures
public int numItemsWithFeatures()- Specified by:
numItemsWithFeatures
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<U,java.lang.Integer,java.lang.Double>
-
numFeaturesWithItems
public int numFeaturesWithItems()- Specified by:
numFeaturesWithItems
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<U,java.lang.Integer,java.lang.Double>
-
getItemsWithFeatures
- Specified by:
getItemsWithFeatures
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<U,java.lang.Integer,java.lang.Double>
-
getFeaturesWithItems
public java.util.stream.Stream<java.lang.Integer> getFeaturesWithItems()- Specified by:
getFeaturesWithItems
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<U,java.lang.Integer,java.lang.Double>
-
getFeatureItems
public java.util.stream.Stream<org.jooq.lambda.tuple.Tuple2<U,java.lang.Double>> getFeatureItems(java.lang.Integer f)- Specified by:
getFeatureItems
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<U,java.lang.Integer,java.lang.Double>
-
getItemFeatures
public java.util.stream.Stream<org.jooq.lambda.tuple.Tuple2<java.lang.Integer,java.lang.Double>> getItemFeatures(U i)- Specified by:
getItemFeatures
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<U,java.lang.Integer,java.lang.Double>
-
numFeatures
- Specified by:
numFeatures
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<U,java.lang.Integer,java.lang.Double>
-
numItems
public int numItems(java.lang.Integer f)- Specified by:
numItems
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<U,java.lang.Integer,java.lang.Double>
-
containsFeature
public boolean containsFeature(java.lang.Integer f)- Specified by:
containsFeature
in interfacees.uam.eps.ir.ranksys.core.index.FeatureIndex<U>
-
numFeatures
public int numFeatures()- Specified by:
numFeatures
in interfacees.uam.eps.ir.ranksys.core.index.FeatureIndex<U>
-
getAllFeatures
public java.util.stream.Stream<java.lang.Integer> getAllFeatures()- Specified by:
getAllFeatures
in interfacees.uam.eps.ir.ranksys.core.index.FeatureIndex<U>
-
containsItem
- Specified by:
containsItem
in interfacees.uam.eps.ir.ranksys.core.index.ItemIndex<U>
-
numItems
public int numItems()- Specified by:
numItems
in interfacees.uam.eps.ir.ranksys.core.index.ItemIndex<U>
-
getAllItems
- Specified by:
getAllItems
in interfacees.uam.eps.ir.ranksys.core.index.ItemIndex<U>
-
load
Loads the feature data from a forward index.- Type Parameters:
U
- type of the users- Parameters:
comms
- the communities users belong to.- Returns:
- the feature data object.
-