Class FreeDiscovery<U>
java.lang.Object
es.uam.eps.ir.relison.sna.metrics.vertex.FreeDiscovery<U>
- Type Parameters:
U
- Type of the users.
- All Implemented Interfaces:
VertexMetric<U>
public class FreeDiscovery<U> extends java.lang.Object implements VertexMetric<U>
Finds how unpopular the user is in the network.
Reference: P. Castells, S. Vargas, N. Hurley. Novelty and diversity in recommender systems. Recommender Systems Handbook, 2nd. ed., pp. 881-918 (2015)
-
Field Summary
Fields Modifier and Type Field Description private EdgeOrientation
orient
Orientation. -
Constructor Summary
Constructors Constructor Description FreeDiscovery(EdgeOrientation orient)
Constructor. -
Method Summary
Modifier and Type Method Description java.util.Map<U,java.lang.Double>
compute(Graph<U> graph)
Computes the value of the metric for all the users in the graph.java.util.Map<U,java.lang.Double>
compute(Graph<U> graph, java.util.stream.Stream<U> users)
Computes the value of the metric for a subset of the users in the graph.double
compute(Graph<U> graph, U user)
Computes the value of the metric for a single user.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface es.uam.eps.ir.relison.sna.metrics.VertexMetric
averageValue, averageValue
-
Field Details
-
orient
Orientation.
-
-
Constructor Details
-
FreeDiscovery
Constructor.- Parameters:
orient
- edge orientation.
-
-
Method Details
-
compute
Description copied from interface:VertexMetric
Computes the value of the metric for all the users in the graph.- Specified by:
compute
in interfaceVertexMetric<U>
- Parameters:
graph
- The graph.- Returns:
- A map relating the users with the values of the metric.
-
compute
public java.util.Map<U,java.lang.Double> compute(Graph<U> graph, java.util.stream.Stream<U> users)Description copied from interface:VertexMetric
Computes the value of the metric for a subset of the users in the graph.- Specified by:
compute
in interfaceVertexMetric<U>
- Parameters:
graph
- the graph.users
- the stream of users.- Returns:
- a map relating users with the values of the metric. Nodes not in the graph will not be included in the map.
-
compute
Description copied from interface:VertexMetric
Computes the value of the metric for a single user.- Specified by:
compute
in interfaceVertexMetric<U>
- Parameters:
graph
- The graph.user
- The user to compute.- Returns:
- the value of the metric.
-