Skip to content

Commit 006826b

Browse files
committed
Remove default value for featureProperties in GraphSage
The default value was invalid and just lead to confusing docs.
1 parent fa04474 commit 006826b

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

algo/src/main/java/org/neo4j/gds/embeddings/graphsage/algo/GraphSageTrainConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public interface GraphSageTrainConfig extends
6262

6363
long serialVersionUID = 0x42L;
6464

65+
@Override
66+
List<String> featureProperties();
67+
6568
@Override
6669
@Value.Default
6770
default int embeddingDimension() {

algo/src/test/java/org/neo4j/gds/embeddings/graphsage/algo/GraphSageConfigTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ void specifyBatchesPerIteration(double samplingRatio, long nodeCount, int expect
7272
@Test
7373
void shouldThrowIfNoPropertiesProvided() {
7474
var mapWrapper = CypherMapWrapper.create(Map.of("modelName", "foo"));
75+
var expectedMessage = "No value specified for the mandatory configuration parameter `featureProperties`";
76+
assertThatThrownBy(() -> GraphSageTrainConfig.of("", mapWrapper))
77+
.isInstanceOf(IllegalArgumentException.class)
78+
.hasMessage(expectedMessage);
79+
}
80+
81+
@Test
82+
void shouldThrowIfEmptyPropertiesProvided() {
83+
var mapWrapper = CypherMapWrapper.create(Map.of("modelName", "foo", "featureProperties", List.of()));
7584
var expectedMessage = "GraphSage requires at least one property.";
7685
assertThatThrownBy(() -> GraphSageTrainConfig.of("", mapWrapper))
7786
.isInstanceOf(IllegalArgumentException.class)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
| modelName | String | n/a | no | The name of the model to train, must not exist in the Model Catalog.
2-
| featureProperties | List of String | [] | yes | The names of the node properties that should be used as input features. All property names must exist in the projected graph and be of type Float or List of Float.
2+
| featureProperties | List of String | n/a | no | The names of the node properties that should be used as input features. All property names must exist in the projected graph and be of type Float or List of Float.
33
include::partial$/algorithms/common-configuration/common-configuration-entries.adoc[]

0 commit comments

Comments
 (0)