A navigation prediction and asset preloading system that forecasts user navigation paths and preloads web assets using a Decision Tree model.
PredictPulse enhances web performance by predicting user navigation paths and preloading assets (images, CSS, JS) for the next page, based on interaction patterns, device context, and session data. It uses a client-side Decision Tree model trained on user logs via train_model.py
, dynamically adapting to userAgent
and screenWidth
. The system achieves 54.55% accuracy with a 100-log dataset and introduces the Web Operational Intelligence Score (WOIS) to evaluate adaptive intelligence.
- Navigation Prediction & Preloading: Forecasts next pages and preloads assets using a Decision Tree model.
- Dynamic Adaptation: Adjusts predictions based on
userAgent
andscreenWidth
. - User Context Awareness: Incorporates device type, OS, browser, and screen size.
- Open-Source: Deployed at gitgetgotgotten.github.io/predictpulse.
- Clone:
git clone https://github.com/gitgetgotgotten/predictpulse
- Go:
cd predictpulse
- Install:
npm install
- Generate mock data:
node scripts/generate_mockdata.js
(outputs topredictpulse_mockdata.json
) - Train model:
pip install pandas scikit-learn numpy ua-parser && python train_model.py
(outputs tosrc/utils/predictNextPage.js
,public/encoders.json
,public/asset_map.json
)
- Build:
npm run build
- Deploy:
npm run deploy
- Visit: Your https://gitgetgotgotten.github.io/predictpulse equivalent
git checkout main
Remove-Item -Recurse -Force dist
(Windows PowerShell)- macOS/Linux:
rm -rf dist
- macOS/Linux:
git push origin :gh-pages
python train_model.py
python generate_asset_map.py
npm run build
node scripts/build.js
cp public/asset_map.json dist/asset_map.json
npm run deploy
- Run:
python evaluate.py
- Check:
evaluation_results.json
- Run:
python evaluate_real.py
- Check:
evaluation_results_real.json
Logs are stored in IndexedDB and uploaded to a private GitHub repo (predictpulse-data
, data
branch) after each page visit. To set up:
- Create a private repo:
predictpulse-data
. - Create a
data
branch. - Generate a GitHub Personal Access Token with repo scope.
- Set token:
localStorage.setItem('github_token', 'your_token')
in browser console (for downloads only, manually removed after use). - Test uploads: Navigate pages and check
predictpulse_realdata.json
inpredictpulse-data
. - Aggregate logs:
GITHUB_TOKEN=your_token node scripts/upload_logs.js
(server-side, after collecting logs). - Use Vercel to securely store the GitHub token and request data from there, ensuring safe management and access to the private repo.
User data is anonymized (page visits, device stats) and collected only with consent via a popup. Logs are stored in a private GitHub repo, accessible to collaborators.
MIT