-
Notifications
You must be signed in to change notification settings - Fork 0
Graph Procedures
Our Aim is To enable user-defined graph procedures for spectral clustering of graph data models in Neo4j. We extend this from the already available Decision Tree Plugin (DTP). The initial steps to set up the DTP plugin in Neo4j Desktop are explained below.
Clone the DTP repository to the local system.(DTP-Plugin)
With Maven installed, a jar file can be generated with the command mvn clean install in the terminal of the IDE used(Intellij, Eclipse).
Changes to be made before generating, the jar file:
- change the password inside the methods which enable the plugin to connect to Neo4j. This password should be a minimum of 8 characters long.
Password change in all required methods
Download the neo4j Desktop from its website (Neo4j Desktop) and install it.
step to follow after installing to set a local DBMS:
- Open the Neo4j Desktop application and click 'Add', under the pop-down menu click 'Local DBMS'.
- A create menu will be opened, with the options of the database name, password, and version.
- Version number should be '4.3.2', set a password of your choice(same as the one used inside of the methods of the plugin) and click "Create".
- Click on the "3" dots in the newly created local Dbms and click "Open folder".
- Open the "Plugins" folder and add the generated Jar file(DTP).
- Open the "Import" folder and add all Data-related files(Testing set, Training set, etc...).
Run the DTP plugin with the "Heart failure prediction" Dataset. An important point to be noted is that the dataset files in the import folder should not contain any spaces in their names. After starting the local DBMS, open a neo4j browser and run the following steps.
LOAD CSV WITH HEADERS FROM "file:///TrainingSet.csv" AS line WITH line CREATE (p:P_train { anaemia: toInteger(line.anaemia),creatinine_phosphokinase: toInteger(line.creatinine_phosphokinase), diabetes: toInteger(line.diabetes), ejection_fraction: toInteger(line.ejection_fraction), high_blood_pressure: toInteger(line.high_blood_pressure), platelets: toFloat(line.platelets), serum_creatinine: toFloat(line.serum_creatinine), serum_sodium: toInteger(line.serum_sodium), smoking: toInteger(line.smoking), time: toInteger(line.time), DEATH_EVENT: toInteger(line.DEATH_EVENT), age:toInteger(line.age), sex: toInteger(line.sex)}) RETURN count(*);
RETURN main.queryTrainData("P_train");
LOAD CSV WITH HEADERS FROM "file:///TestingSet.csv" AS line WITH line CREATE (p:P_test { anaemia: toInteger(line.anaemia),creatinine_phosphokinase: toInteger(line.creatinine_phosphokinase), diabetes: toInteger(line.diabetes), ejection_fraction: toInteger(line.ejection_fraction), high_blood_pressure: toInteger(line.high_blood_pressure), platelets: toFloat(line.platelets), serum_creatinine: toFloat(line.serum_creatinine), serum_sodium: toInteger(line.serum_sodium), smoking: toInteger(line.smoking), time: toInteger(line.time), DEATH_EVENT: toInteger(line.DEATH_EVENT), age:toInteger(line.age), sex: toInteger(line.sex)}) RETURN count(*);
RETURN main.queryTestData("P_test");
RETURN main.createTreeGR("DEATH_EVENT","True","3");
- Install SimKit Plugin in Neo4j
- Procedures
- Map nodes in Neo4j from CSV
- Construct similarity matrix in Neo4j from CSV
- Construct similarity matrix in Neo4j from Neo4j Nodes
- Construct laplacian eigendecomposited matrix
- Perform K-means clustering and validate it with silhouette coefficient
- Calculate silhouette coefficient
- Calculate adjusted rand index
- Perform spectral clustering algorithm and validate it with silhouette coefficient