การฝังกราฟด้วย GDS
เรียนรู้วิธีที่ Graph Data Science สร้างการฝังโหนด ซึ่งแปลงโครงสร้างกราฟเป็นเวกเตอร์สำหรับการเรียนรู้ของเครื่อง
การฝังกราฟด้วย GDS เป็นบทเรียน Neo4j Graph Database Fundamentals ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Neo4j Graph Database Fundamentals และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Neo4j Graph Database Fundamentals มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
From Graphs to Vectors
Machine learning models work with numbers, not graph topology. Graph embeddings convert each node into a fixed-length vector that captures its position and neighborhood.
Why Embeddings Help
Once nodes are vectors, you can feed them into classifiers, clustering, and similarity search. Similar nodes end up close together in vector space.
Projecting a Graph
Embeddings run on an in-memory graph projection in GDS. First project the nodes and relationships you care about.
CALL gds.graph.project(
'embedGraph',
'Person',
'FRIEND'
);FastRP
FastRP (Fast Random Projection) is a quick, scalable embedding algorithm. It is a great default for large graphs.
CALL gds.fastRP.stream('embedGraph', { embeddingDimension: 128 })
YIELD nodeId, embedding
RETURN gds.util.asNode(nodeId).name AS name, embedding
LIMIT 5;Node2Vec
Node2Vec uses biased random walks to learn embeddings that balance local and global structure. It is slower but often richer than FastRP.
CALL gds.node2vec.stream('embedGraph', { embeddingDimension: 128, walkLength: 80 })
YIELD nodeId, embedding
RETURN nodeId, embedding
LIMIT 5;GraphSAGE
GraphSAGE is an inductive method: it learns a function that can embed even new nodes not seen during training, using their features.
Choosing Dimensions
The embedding dimension trades expressiveness for cost. Common values are 64, 128, or 256. Larger is more detailed but heavier.
Writing Embeddings Back
Use the write mode to store embeddings as a node property, so other queries and tools can use them.
CALL gds.fastRP.write('embedGraph', {
embeddingDimension: 128,
writeProperty: 'embedding'
});Using Embeddings for Similarity
With vectors stored, compute cosine similarity between embeddings to find nodes that are structurally alike.
MATCH (a:Person {name: 'Alice'}), (b:Person)
WHERE a <> b
RETURN b.name, gds.similarity.cosine(a.embedding, b.embedding) AS sim
ORDER BY sim DESC LIMIT 5;Embeddings in ML Pipelines
Embeddings are powerful features for GDS machine learning pipelines: node classification and link prediction both benefit from them.
Choosing an Algorithm
Use FastRP for speed at scale, Node2Vec for richer structure, and GraphSAGE when you must embed unseen nodes.
Quick Check
Test your embeddings knowledge.
Recap
You learned graph embeddings in GDS:
- Embeddings turn nodes into vectors
- FastRP is fast and scalable
- Node2Vec uses biased random walks
- GraphSAGE handles unseen nodes
- Write embeddings back and use them in ML pipelines
เรียนรู้ Neo4j Graph Database Fundamentals ด้วย AI tutor — ฟรี
เขียนและเรียกใช้โค้ดจริงในเบราว์เซอร์ของคุณ รับความช่วยเหลือทันทีจาก AI tutor 24/7 และเรียนรู้ต่อจากที่คุณหยุดบนเว็บหรือในแอป
- คอร์ส
- 12
- บทเรียน
- 48
คำถามที่พบบ่อย
บทเรียน “การฝังกราฟด้วย GDS” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “การฝังกราฟด้วย GDS” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Neo4j Graph Database Fundamentals ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Neo4j Graph Database Fundamentals มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “การฝังกราฟด้วย GDS”
เรียนรู้วิธีที่ Graph Data Science สร้างการฝังโหนด ซึ่งแปลงโครงสร้างกราฟเป็นเวกเตอร์สำหรับการเรียนรู้ของเครื่อง คุณปฏิบัติ Neo4j Graph Database Fundamentals ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Neo4j Graph Database Fundamentals หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Neo4j Graph Database Fundamentals บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน
บทเรียน “การฝังกราฟด้วย GDS” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Neo4j Graph Database Fundamentals นี้ได้ไหม
ได้ บทเรียน Neo4j Graph Database Fundamentals ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- บทนำสู่ไลบรารี GDS
- การเรียกใช้อัลกอริทึม GDS
- กระบวนการส่งข้อมูล GDS และการเรียนรู้ของเครื่อง
- การฝังกราฟด้วย GDS