Package org.neo4j.gds.ml.splitting
Class UndirectedEdgeSplitter
java.lang.Object
org.neo4j.gds.ml.splitting.EdgeSplitter
org.neo4j.gds.ml.splitting.UndirectedEdgeSplitter
Splits an undirected graph into two Relationships objects.
The first represents a holdout set and is a directed graph.
The second represents the remaining graph and is also undirected.
For each held out undirected edge, the holdout set is populated with
an edge with the same underlying node pair but with random direction.
The holdout fraction is denominated in fraction of undirected edges.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.neo4j.gds.ml.splitting.EdgeSplitter
EdgeSplitter.SplitResult -
Field Summary
Fields inherited from class org.neo4j.gds.ml.splitting.EdgeSplitter
POSITIVE, RELATIONSHIP_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionUndirectedEdgeSplitter(Optional<Long> maybeSeed, org.neo4j.gds.api.IdMap rootNodes, org.neo4j.gds.api.IdMap sourceNodes, org.neo4j.gds.api.IdMap targetNodes, org.neo4j.gds.RelationshipType selectedRelationshipType, org.neo4j.gds.RelationshipType remainingRelationshipType, int concurrency) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidpositiveSampling(org.neo4j.gds.api.Graph graph, org.neo4j.gds.core.loading.construction.RelationshipsBuilder selectedRelsBuilder, org.neo4j.gds.api.RelationshipWithPropertyConsumer remainingRelsConsumer, org.apache.commons.lang3.mutable.MutableLong selectedRelCount, org.apache.commons.lang3.mutable.MutableLong remainingRelCount, long nodeId, com.carrotsearch.hppc.predicates.LongLongPredicate isValidNodePair, org.apache.commons.lang3.mutable.MutableLong positiveSamplesRemaining, org.apache.commons.lang3.mutable.MutableLong candidateEdgesRemaining) protected longvalidPositiveRelationshipCandidateCount(org.neo4j.gds.api.Graph graph, com.carrotsearch.hppc.predicates.LongLongPredicate isValidNodePair) Methods inherited from class org.neo4j.gds.ml.splitting.EdgeSplitter
splitPositiveExamples
-
Constructor Details
-
UndirectedEdgeSplitter
-
-
Method Details
-
validPositiveRelationshipCandidateCount
protected long validPositiveRelationshipCandidateCount(org.neo4j.gds.api.Graph graph, com.carrotsearch.hppc.predicates.LongLongPredicate isValidNodePair) - Specified by:
validPositiveRelationshipCandidateCountin classEdgeSplitter
-
positiveSampling
protected void positiveSampling(org.neo4j.gds.api.Graph graph, org.neo4j.gds.core.loading.construction.RelationshipsBuilder selectedRelsBuilder, org.neo4j.gds.api.RelationshipWithPropertyConsumer remainingRelsConsumer, org.apache.commons.lang3.mutable.MutableLong selectedRelCount, org.apache.commons.lang3.mutable.MutableLong remainingRelCount, long nodeId, com.carrotsearch.hppc.predicates.LongLongPredicate isValidNodePair, org.apache.commons.lang3.mutable.MutableLong positiveSamplesRemaining, org.apache.commons.lang3.mutable.MutableLong candidateEdgesRemaining) - Specified by:
positiveSamplingin classEdgeSplitter
-