{"id":20640144,"url":"https://github.com/wondervictor/traffic_prediction","last_synced_at":"2025-04-15T22:58:54.191Z","repository":{"id":71143975,"uuid":"82575648","full_name":"wondervictor/Traffic_Prediction","owner":"wondervictor","description":"Traffic Prediction in PaddlePaddle (ASC17 Deep Learning Application)","archived":false,"fork":false,"pushed_at":"2017-04-27T16:36:05.000Z","size":7217,"stargazers_count":17,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T22:58:49.038Z","etag":null,"topics":["deep-learning","deep-neural-networks","machine-learning","predictive-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wondervictor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-20T15:56:52.000Z","updated_at":"2024-11-02T08:48:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e42e104-a5c5-4dcc-ba32-75d895c24dad","html_url":"https://github.com/wondervictor/Traffic_Prediction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wondervictor%2FTraffic_Prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wondervictor%2FTraffic_Prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wondervictor%2FTraffic_Prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wondervictor%2FTraffic_Prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wondervictor","download_url":"https://codeload.github.com/wondervictor/Traffic_Prediction/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249167440,"owners_count":21223505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","deep-neural-networks","machine-learning","predictive-analysis"],"created_at":"2024-11-16T15:28:05.442Z","updated_at":"2025-04-15T22:58:54.186Z","avatar_url":"https://github.com/wondervictor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Traffic Prediction\n\n**A Deep Learning Prediction Task Supported by PaddlePaddle**\n\n\n### Introduction\n\n1. Construct a easy Graph model by combine the adjacent nodes together\n\n\t* Collect spatio information from `graph.csv`, then construct a Center- MultiOrder-Adjacent Nodes Model (中心-多阶邻接节点图模型)\n\t* MultiOrder adjacent nodes can lengthen the predicting period\n\n![](https://github.com/wondervictor/Blog/blob/master/Traffic_Graph.png?raw=true)\n\n\n\n2. ResLSTM (Residual Long Short Term Memory)\n\t\n\t* Inpired by ResNet(which can deepen the neural network to more than 150 layers) ([Deep Residual Network](https://arxiv.org/abs/1512.03385))\n\t* LSTM can deal with time sequence well\n\t* Residual can contribute to the loss and reasonable gradient\n\n![](https://github.com/wondervictor/Blog/blob/master/ResLSTM.png?raw=true)\n\n3. Construct the full network\n\n\t* Input speed sequences\r\t* Bidirectional LSTM can learn from the former speed and latter speed to deal with the relation of the adjacent nodes and the center node.\n\t* Use fully connected layers to extract the spatio feature.\n\t* End-to-End Trainable\n\t* LSTM and ReLU can lower the possibility of Gradient Vanishing\r\n![](https://github.com/wondervictor/Blog/blob/master/network.png?raw=true)\n\r\n\n### Usage\n\n#### Install PaddlePaddle\n\t\n[go to the PaddlePaddle documentation](http://www.paddlepaddle.org/doc/build/build_from_source.html#build-and-install)\n\n##### Prepare data\n\n```\ncd data\n\n```\n\n* get point list for training (Graph Constructing)\n\n```\npoints_to_point()\nget_points_count_list_2()\n```\n\n* remove zeros\n    \n```\nsplit_data.split_by_remove_some_timestamps('speeds.csv',[(from_time, to_time)],'speed_nzero.csv')\n```\n\n* validation set\n\n```\nsplit_data.split_out(filename, [(from_time, to_time)],[output filenames])\n``` \n\n* test data\n\n```\nsplit_data.get_test_data('test_speeds.csv', 'train_speeds.csv', 'speed_no_valid.csv', [(from_time, to_time)])                                                                                   dataset = create_dataset('test_speeds.csv')\n```\n\n* create data set\n\n```\ndataset = create_dataset('test_speeds.csv')\nget_speed_data_2(dataset, 'test')\n\ndataset = create_dataset('train_speeds.csv')\nget_speed_data_2(dataset, 'train')\n\ndataset = create_dataset('speeds_without_zero.csv')\nget_predict_data_2(dataset)\ndataset = create_dataset('VadiationSet/419_6_10.csv')\nget_predict_valid(dataset)\n```\n\n##### run\n\n```\nsh run.sh\n```\n\n### Advantages\n\n* End-to-End trainable\n* Maybe high accuracy :)\n* Generalization ability and robustness\n* make full use of data provided\n\n### Drawbacks\n\n* training speed\n* Framework (PaddlePaddle) is too slow and stupid\n\n### Licence\n\n**This project is under the Apache-2.0**\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwondervictor%2Ftraffic_prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwondervictor%2Ftraffic_prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwondervictor%2Ftraffic_prediction/lists"}