program代写、c/c++,Java程序代做
Work-in-Progress Report for Project 1: Titanic Prediction Graph in Neo4j
1. Introduction
This project aims to construct a knowledge graph from the Titanic dataset to explore potential relationships among passengers that could support survival prediction. Graph Database Development:
Design and implement the graph database schema, including node labels, relationship types, node properties, and taxonomy. Analyze, prepare, and map the dataset (in CSV format) to the graph model. Construct the Neo4j upload scripts and set up the graph database (hosted on AuraDB).
Intelligent Functions Development:
Identify the target audience and define user tasks supported by the KG application. Develop two intelligent functions—including network analysis and interactive visualization—to enhance the KG for survival prediction support.
2. Dataset Description
2.1 Data Source and Content
The dataset selected for this project is the Titanic dataset from Kaggle. It includes detailed passenger information from the 1912 Titanic disaster. The key fields in the dataset include:
PassengerId: Unique passenger identifier
Survived: Survival status (0 = did not survive, 1 = survived)
Pclass: Passenger class (1, 2, or 3)
Name: Passenger name
Sex: Gender
Age: Age in years
SibSp: Number of siblings/spouses aboard
Parch: Number of parents/children aboard
Ticket: Ticket number
Fare: Fare paid
Cabin: Cabin number
Embarked: Port of embarkation
The dataset was collected from historical records and compiled on Kaggle. Data cleaning and preprocessing have been performed to standardize formats and handle missing values.
Citation:
The dataset is available on Kaggle.
3. Task 1 – Graph Database Development
3.1 Knowledge Graph Design
To effectively represent the Titanic dataset, we have designed the graph schema as follows:
Node Labels:
oPassenger: Represents each passenger. Key properties include passengerId, name, sex, age, pclass, ticket, cabin, fare, and survived.
Relationship Types:
oTRAVELS_WITH: Connects passengers sharing the same ticket.
oSHARES_CABIN_WITH: Connects passengers who are in the same cabin.
oIS_SPOUSE_OF: Captures marital relationships based on available spouse information.
oIS_SIBLING_OF: Connects passengers with sibling or familial relationships.
oPARENT_OF / IS_CHILD_OF: (If available) Represent family relationships between parents and children.
3.2 Data Preparation and Mapping
Prior to importing the data into Neo4j, the CSV file was cleaned and normalized. Key preprocessing steps include:
Data Cleaning:
Standardizing fields (e.g., ticket and cabin formats), handling missing values, and ensuring that identifiers are consistent.
Field Mapping:
Mapping CSV columns (e.g., "PassengerId", "Ticket", "Cabin") to node properties in the graph. The correct capitalization is crucial since Neo4j is case-sensitive.
Relationship Construction:
Using shared attributes (such as Ticket and Cabin) and family information to define relationship creation logic.
3.3 Neo4j Upload Scripts
3.4 Database Setup
The graph database is hosted on Neo4j AuraDB. The upload scripts have been executed via the Neo4j Browser, and initial data verification queries have confirmed that nodes and relationships are correctly mapped.
4. Task 2 – Intelligent Functions Development
4.1 Target Audience and User Tasks
The KG application is designed to serve:
Data Scientists & Machine Learning Engineers:
To leverage graph-based features in survival prediction models by exploring passenger interrelationships.
Historians & Educators:
To interactively explore the social network of Titanic passengers and uncover underlying patterns.
Key user tasks include:
1.Exploratory Data Analysis and Relationship Insights:
Users can query the graph to discover clusters of passengers (e.g., those sharing tickets or cabins) and analyze how these relationships correlate with survival rates.
2.Graph Feature Engineering for Prediction:
Using graph algorithms (such as community detection and centrality measures) to derive new features from the passenger network. These features can be used to enhance traditional machine learning models for survival prediction.
4.2 Intelligent Function Design
To meet these user tasks, we propose the following intelligent functions:
1. Graph Clustering and Community Detection:
Objective: Identify clusters within the passenger network using algorithms like Louvain community detection (available in the Neo4j Graph Data Science library).
Implementation: Custom Cypher queries assign community identifiers to nodes, and statistics are computed to reveal survival rate trends within communities.
User Benefit: Enables data scientists to pinpoint influential clusters that might be key predictors of survival.
2. Dynamic Interactive Graph Visualization:
Objective: Provide an interactive front-end using tools such as Cytoscape.js, allowing users to zoom, filter, and explore the network in real time.
Implementation: A Node.js Web API will fetch graph data via Neo4j Cypher queries, and the results will be rendered on a web page with user controls for filtering and interaction.
User Benefit: Offers historians and educators a visually engaging method to understand the complex social relationships onboard the Titanic.
5. Work in Progress and Next Steps
Current Progress
Data Import and Cleaning:
The Titanic dataset has been successfully cleaned and mapped to the graph schema. Passenger nodes and key relationships (TRAVELS_WITH, etc.) have been imported into AuraDB.
Graph Database Development:
The schema design has been implemented, and preliminary queries confirm correct mapping of nodes and relationships.
Intelligent Function Prototypes:
Early prototypes of the community detection and dynamic visualization functions have been developed and are currently undergoing iterative testing.
Next Steps
Data Refinement:
Enhance data mapping by incorporating additional relationships (e.g., SHARES_CABIN_WITH, IS_SPOUSE_OF) and refine transformation scripts for better accuracy.
Algorithm Optimization:
Optimize the graph algorithms to generate robust features for survival prediction and integrate these into the Node.js API.
Web Interface Development:
Develop and integrate an interactive web interface using Cytoscape.js, complete with input controls and visualization features, and deploy the solution on Google App Engine.
Comprehensive Testing:
Conduct end-to-end testing to ensure performance, scalability, and usability of the KG application.
6. Conclusion
This work-in-progress report presents the initial development of a Titanic Prediction Graph in Neo4j. By transforming the Titanic dataset into a rich knowledge graph and leveraging advanced graph algorithms, we aim to provide actionable insights into passenger survival dynamics. Our KG application, targeted at data scientists, historians, and educators, will facilitate interactive exploration and support enhanced survival prediction models. The next phases of the project will focus on data integration, algorithm refinement, and full deployment of the web interface.


Appendix
Below are Cypher scripts used for uploading data into Neo4j:
1. Create a Unique Constraint:
CREATE CONSTRAINT unique_passenger_id IF NOT EXISTS
FOR (p:Passenger)
REQUIRE p.passengerId IS UNIQUE;
2. Import Passenger Nodes:
LOAD CSV WITH HEADERS FROM 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRmy0R3vn98fWGdtsPxgnxvKItfcOl9qH6JNXBDczpwVEcFh5VqxQaUbWk2t5Ywclz0rxWtkEndmitD/pub?gid=788360882&single=true&output=csv' AS row
MERGE (p:Passenger { passengerId: toInteger(row.PassengerId) })
ON CREATE SET
p.name = row.Name,
p.sex = row.Sex,
p.age = CASE WHEN row.Age = "" THEN null ELSE toInteger(row.Age) END,
p.pclass = toInteger(row.Pclass),
p.ticket = row.Ticket,
p.cabin = row.Cabin,
p.fare = CASE WHEN row.Fare = "" THEN null ELSE toFloat(row.Fare) END,
p.survived = toInteger(row.Survived);
3. Create TRAVELS_WITH Relationship (Sharing the Same Ticket):
MATCH (p1:Passenger), (p2:Passenger)
WHERE p1.ticket IS NOT NULL AND p2.ticket IS NOT NULL
AND trim(p1.ticket) = trim(p2.ticket)
AND p1.passengerId <> p2.passengerId
MERGE (p1)-[:TRAVELS_WITH]->(p2);

Similar scripts are used to create other relationships (such as SHARES_CABIN_WITH, IS_SPOUSE_OF, etc.).

Example of passengers who travel together but don't have specified family relationships

Demonstration of Final Graph

热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图