标题:考虑地理空间上下文信息的出行模式探测软件
Title: Travel Mode Detection Software Considering Geospatial Context Information
介绍(Introduction)
从全球导航卫星系统(GNSS)的轨迹数据中识别出行模式是研究现代居民出行行为规律的重要方法。
Detecting travel mode from trajectory data of the global navigation satellite system (GNSS) is an important approach for studying the patterns of contemporary residents' travel behavior.
我们基于随机森林和SHAP方法,针对出行模式识别模型中地理空间上下文特征对模型识别结果的贡献大小,提出了一种可解释性评估框架。
We propose an interpretability evaluation framework based on random forest and SHAP method to assess the contribution of geospatial context features to the model detection results in travel mode detection models.
这弥补了当下出行模式识别研究领域中缺乏系统性的上下文贡献评估方法的不足,有效提高了模型的可解释性。
This compensates for the lack of systematic contextual contribution assessment methods in the current research field of travel pattern recognition, effectively improving the interpretability of the model.
环境需求与依赖项(Requirements and dependencies)
本代码在以下环境中测试运行:
This code has been tested on:
- Python 3.10.9
- Geopandas 0.12.2
- trackintel 1.1.13
- shap 0.41.0
- scikit-learn 1.2.2
要创建虚拟环境并安装所需的依赖项,请在您的工作文件夹中运行以下命令:
To create a virtual environment and install the required dependencies, please run the following in your working folder:
git clone https://github.com/hong2223/mode_detect
cd mode-detect
conda env create -f environment.yml
conda activate mode-detect
输入与参数设置(Inputs and Parameters)
输入(Inputs)
代码需要已验证的出行模式标签和LineString几何形状作为输入数据。
Require stage data with validated travel mode labels and LineString geometries as input.
您可以查看0_load\import_data.py以从PostGIS数据库读取数据及其相应的数据格式。
You can check 0_load\import_data.py for reading data from the PostGIS database and the corresponding data format.
参数(Parameters)
此外,处理脚本需要以下输入数据和参数:
In addition, the processing scripts require the following input data and parameters:
1_preprocess :
用于计算用户跟踪质量的停驻点数据;用于地理过滤的区域shapefile;用于质量过滤的阶段质量参数(每种模式的跟踪,长度,速度等)。
staypoints data for calculating user tracking quality; area shapefile for geographical filtering; stages quality parameters (tracking, length, speed for each mode, etc.) for quality filtering.
2_feature_extraction :
地理空间上下文数据(来自OSM,Swiss Map Vector 25,或任何其他开源数据提供商)。
geospatial context data (from OSM, Swiss Map Vector 25, or any other open-source data provider).
3_rf_importance :
用于超参数搜索的搜索空间。
search space for hyper-parameter search.
中间文件将存储在./data/文件夹中。由脚本生成的图形将存储在./fig/文件夹中。
intermediate files will be stored in ./data/ folder. Figures generated by the scripts will be stored in ./fig/ folder.
参考文献(Related references)
本软件代表了该论文的实现:
This software represents the implementation of the paper:
- Hong Y, Stüdeli E, Raubal M. Evaluating geospatial context information for travel mode detection [J]. Journal of Transport Geography, 2023, 113: 103736.(站内链接 (Internal Link))
软件下载(Software Download)
点击跳转Github (Click to enter Github repository)
效果展示(Result Demonstration)
Q.E.D.