All Projects → neo4j-contrib → neo4j-ml-procedures

neo4j-contrib / neo4j-ml-procedures

Licence: Apache-2.0 license
This project provides procedures and functions to support machine learning applications with Neo4j.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to neo4j-ml-procedures

Neo4j Etl
Data import from relational databases to Neo4j.
Stars: ✭ 165 (+345.95%)
Mutual labels:  neo4j, cypher
angular-neo4j
Neo4j Bolt driver wrapper for Angular
Stars: ✭ 18 (-51.35%)
Mutual labels:  neo4j, cypher
Jetbrains Plugin Graph Database Support
Graph Databases support for JetBrains family IDEs.
Stars: ✭ 169 (+356.76%)
Mutual labels:  neo4j, cypher
Cypher Dsl
A Java DSL for the Cypher Query Language
Stars: ✭ 116 (+213.51%)
Mutual labels:  neo4j, cypher
Graph-OLAP
An attempt to model an OLAP cube with Neo4j.
Stars: ✭ 37 (+0%)
Mutual labels:  neo4j, cypher
Movies Javascript Bolt
Neo4j Movies Example with webpack-in-browser app using the neo4j-javascript-driver
Stars: ✭ 123 (+232.43%)
Mutual labels:  neo4j, cypher
neo4j-faker
Use faker cypher functions to generate demo and test data with cypher
Stars: ✭ 30 (-18.92%)
Mutual labels:  neo4j, cypher
Cypher Stream
Neo4j Cypher queries as Node.js object streams
Stars: ✭ 58 (+56.76%)
Mutual labels:  neo4j, cypher
ml-models
Machine Learning Procedures and Functions for Neo4j
Stars: ✭ 63 (+70.27%)
Mutual labels:  neo4j, cypher
Public-Transport-SP-Graph-Database
Metropolitan Transport Network from São Paulo mapped in a NoSQL graph database.
Stars: ✭ 25 (-32.43%)
Mutual labels:  neo4j, cypher
Neo4j
Graphs for Everyone
Stars: ✭ 9,582 (+25797.3%)
Mutual labels:  neo4j, cypher
NeoClient
🦉 Lightweight OGM for Neo4j which support transactions and BOLT protocol.
Stars: ✭ 21 (-43.24%)
Mutual labels:  neo4j, cypher
Stock Knowledge Graph
利用网络上公开的数据构建一个小型的证券知识图谱/知识库
Stars: ✭ 1,182 (+3094.59%)
Mutual labels:  neo4j, cypher
Neo4j 3d Force Graph
Experiments with Neo4j & 3d-force-graph https://github.com/vasturiano/3d-force-graph
Stars: ✭ 159 (+329.73%)
Mutual labels:  neo4j, cypher
Movies Java Bolt
Neo4j Movies Example application with SparkJava backend using the neo4j-java-driver
Stars: ✭ 66 (+78.38%)
Mutual labels:  neo4j, cypher
Movies Python Bolt
Neo4j Movies Example application with Flask backend using the neo4j-python-driver
Stars: ✭ 197 (+432.43%)
Mutual labels:  neo4j, cypher
Neo4j Helm
Helm Charts for running Neo4j on Kubernetes
Stars: ✭ 43 (+16.22%)
Mutual labels:  neo4j, cypher
Neo4j Tableau
Neo4j Tableau Integration via WDC
Stars: ✭ 56 (+51.35%)
Mutual labels:  neo4j, cypher
OGMNeo
[No Maintenance] Neo4j nodeJS OGM(object-graph mapping) abstraction layer
Stars: ✭ 54 (+45.95%)
Mutual labels:  neo4j, cypher
decypher
A handful of cypher utilities for Node.js
Stars: ✭ 34 (-8.11%)
Mutual labels:  neo4j, cypher

Neo4j Machine Learning Procedures (WIP)

Build state

This project provides procedures and functions to support machine learning applications with Neo4j.

Note
This project requires Neo4j 3.2.x

Installation

  1. Download the jar from the latest release or build it locally

  2. Copy it into your $NEO4J_HOME/plugins directory.

  3. Restart your server.

Built in classification and regression (WIP)

CALL ml.create("model",{types},"output",{config}) YIELD model, state, info

CALL ml.add("model", {inputs}, given)  YIELD model, state, info

CALL ml.train() YIELD model, state, info

CALL ml.predict("model", {inputs}) YIELD value [, confidence]

CALL ml.remove(model) YIELD model, state

Example: IRIS Classification from Encog

CALL ml.create("iris",
  {sepalLength: "float", sepalWidth: "float", petalLength: "float", petalWidth: "float", kind: "class"}, "kind",{});
LOAD CSV FROM "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data" AS row
CALL ml.add('iris', {sepalLength: row[0], sepalWidth: row[1], petalLength: row[2], petalWidth: row[3]}, row[4])
YIELD state
WITH collect(distinct state) as states, collect(distinct row[4]) as kinds

CALL ml.train('iris')  YIELD state, info

RETURN state, states, kinds, info;
╒═══════╤════════════╤══════════════════════════════════════════════════╤══════════════════════════════════════════════════════════════════════╕
│"state"│"states"    │"kinds"                                           │"info"                                                                │
╞═══════╪════════════╪══════════════════════════════════════════════════╪══════════════════════════════════════════════════════════════════════╡
│"ready"│["training"]│["Iris-setosa","Iris-versicolor","Iris-virginica"]│{"trainingSets":150,"methodName":"feedforward","normalization":"[Norma│
│       │            │                                                  │lizationHelper:\n[ColumnDefinition:sepalLength(continuous);low=4,30000│
│       │            │                                                  │0,high=7,900000,mean=5,843333,sd=0,825301]\n[ColumnDefinition:petalLen│
│       │            │                                                  │gth(continuous);low=1,000000,high=6,900000,mean=3,758667,sd=1,758529]\│
│       │            │                                                  │n[ColumnDefinition:sepalWidth(continuous);low=2,000000,high=4,400000,m│
│       │            │                                                  │ean=3,054000,sd=0,432147]\n[ColumnDefinition:petalWidth(continuous);lo│
│       │            │                                                  │w=0,100000,high=2,500000,mean=1,198667,sd=0,760613]\n[ColumnDefinition│
│       │            │                                                  │:kind(nominal);[Iris-setosa, Iris-versicolor, Iris-virginica]]\n]","tr│
│       │            │                                                  │ainingError":0.034672103747075696,"selectedMethod":"[BasicNetwork: Lay│
│       │            │                                                  │ers=3]","validationError":0.05766172747088482}                        │
└───────┴────────────┴──────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────────────┘
LOAD CSV FROM "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data" AS row
WITH state, info, row limit 10

CALL ml.predict("iris", {sepalLength: row[0], sepalWidth: row[1], petalLength: row[2], petalWidth: row[3]})
YIELD value as prediction

RETURN row[4] as correct, prediction, state, row;
╒═════════════╤═════════════╤═══════╤═══════════════════════════════════════╕
│"correct"    │"prediction" │"state"│"row"                                  │
╞═════════════╪═════════════╪═══════╪═══════════════════════════════════════╡
│"Iris-setosa"│"Iris-setosa"│"ready"│["5.1","3.5","1.4","0.2","Iris-setosa"]│
├─────────────┼─────────────┼───────┼───────────────────────────────────────┤
│"Iris-setosa"│"Iris-setosa"│"ready"│["4.9","3.0","1.4","0.2","Iris-setosa"]│
├─────────────┼─────────────┼───────┼───────────────────────────────────────┤
│"Iris-setosa"│"Iris-setosa"│"ready"│["4.7","3.2","1.3","0.2","Iris-setosa"]│
├─────────────┼─────────────┼───────┼───────────────────────────────────────┤
...
CALL ml.remove('iris') YIELD model, state;

Manual neural network operations (TODO)

Procedures
apoc.ml.propagate(network, {inputs}) yield {outputs}
apoc.ml.backprop(network, {output}) yield {network}
Functions
apoc.ml.sigmoid
apoc.ml.sigmoidPrime

Future plans include storing networks from the common machine learning libraries (TensorFlow, Deeplearning4j, Encog etc.) as executable Network structures in Neo4j.

Building it yourself

This project uses maven, to build a jar-file with the procedure in this project, simply package the project with maven:

mvn clean package

This will produce a jar-file,target/neo4j-ml-procedures-*-SNAPSHOT.jar, that can be copied in the $NEO4J_HOME/plugins directory of your Neo4j instance.

License

Apache License V2, see LICENSE

Next Steps

  • Normalization / Classification for dl4j

  • Push frameworks to separate modules

  • Support external frameworks

  • Store / Load models from graph

  • Expose simple ML functions / propagation/ backprop on graph structures as procedures and functions

  • Load PMML

  • More fine-grained configuration (JSON) for Networks

  • K-Means, Classification, Regression

  • Spark ML-Lib

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].