{"id":22127942,"url":"https://github.com/dmunasingha/trip-recommendation-algorithm","last_synced_at":"2025-03-24T08:34:50.990Z","repository":{"id":252440604,"uuid":"840450437","full_name":"dmunasingha/Trip-Recommendation-Algorithm","owner":"dmunasingha","description":"A PHP-based tool that recommends new trips based on the tags of trips the user has previously visited. The system filters out trips that the user has already explored and suggests new trips with similar tags, ensuring personalized recommendations aligned with the user's known interests.","archived":false,"fork":false,"pushed_at":"2024-08-09T18:37:04.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T14:09:55.822Z","etag":null,"topics":["alrogithm","personalization","php","recommendation-system","tag-based","travel"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmunasingha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-09T18:26:33.000Z","updated_at":"2024-08-09T18:36:15.000Z","dependencies_parsed_at":"2024-08-09T20:09:10.072Z","dependency_job_id":null,"html_url":"https://github.com/dmunasingha/Trip-Recommendation-Algorithm","commit_stats":null,"previous_names":["dmunasingha/trip-recommendation-algorithm"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmunasingha%2FTrip-Recommendation-Algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmunasingha%2FTrip-Recommendation-Algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmunasingha%2FTrip-Recommendation-Algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmunasingha%2FTrip-Recommendation-Algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmunasingha","download_url":"https://codeload.github.com/dmunasingha/Trip-Recommendation-Algorithm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245235681,"owners_count":20582286,"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":["alrogithm","personalization","php","recommendation-system","tag-based","travel"],"created_at":"2024-12-01T17:22:38.785Z","updated_at":"2025-03-24T08:34:50.960Z","avatar_url":"https://github.com/dmunasingha.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trip Recommendation System\n\n## Overview\n\nThis PHP-based Trip Recommendation System suggests new trips to users based on the tags of trips they have previously visited. The system filters out trips with tags not associated with the user’s known preferences and avoids recommending trips that the user has already visited.\n\n## Features\n\n- **Tag-Based Recommendations**: Recommends trips based on tags from trips the user has visited.\n- **Excludes Visited Trips**: Avoids recommending trips the user has already visited.\n- **Customizable**: Easily modify the list of trips and user data.\n\n## Requirements\n\n- PHP 7.0 or higher\n- Basic knowledge of PHP\n\n## Installation\n\n1. **Clone the Repository**\n\n   ```bash\n   git clone https://github.com/dmunasingha/Trip-Recommendation-Algorithm\n   cd Trip-Recommendation-Algorithm\n   ```\n\n2. **Set Up Your Environment**\n\n   Ensure PHP is installed and configured on your system. No additional packages are required beyond PHP.\n\n## Usage\n\n1. **Define Your Trips**\n\n   Edit the `$trips` array in `recommendation.php` to include your trips data. Each trip should have an `id` and a list of `tags`.\n\n   ```php\n   $trips = [\n       ['id' =\u003e 1, 'tags' =\u003e ['beautiful', 'hot', 'sunny']],\n       ['id' =\u003e 2, 'tags' =\u003e ['cold', 'beautiful']],\n       ['id' =\u003e 3, 'tags' =\u003e ['sunny', 'hot']],\n       ['id' =\u003e 4, 'tags' =\u003e ['cold', 'snowy']],\n   ];\n   ```\n\n2. **Set User Visits**\n\n   Update the `$userVisitedTrips` array with the IDs of trips the user has visited.\n\n   ```php\n   $userVisitedTrips = [1, 3];\n   ```\n\n3. **Run the Script**\n\n   Execute the PHP script from the command line:\n\n   ```bash\n   php recommendation.php\n   ```\n\n4. **View Recommendations**\n\n   The script will output recommended trip IDs and details based on the tags of trips the user has previously visited.\n\n## Functions\n\n- **`calculateTagSimilarity($tags1, $tags2)`**: Computes similarity between two sets of tags.\n- **`filterTripsByUserTags($trips, $userTags, $visitedTrips)`**: Filters trips based on user tags and excludes visited trips.\n- **`recommendTrips($trips, $userTags, $visitedTrips)`**: Generates recommendations by calculating tag similarity and excluding visited trips.\n\n## Example Output\n\n```php\nArray\n(\n    [0] =\u003e 2\n    [1] =\u003e 4\n)\nArray\n(\n    [id] =\u003e 2\n    [tags] =\u003e Array\n        (\n            [0] =\u003e cold\n            [1] =\u003e beautiful\n        )\n)\nArray\n(\n    [id] =\u003e 4\n    [tags] =\u003e Array\n        (\n            [0] =\u003e cold\n            [1] =\u003e snowy\n        )\n)\n```\n\n## Contribution\n\nFeel free to contribute to this project by submitting issues or pull requests. Please ensure to follow the code of conduct and contribution guidelines.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contact\n\nFor any inquiries, please contact [dunix00@gmail.com](mailto:dunix00@gmail.com).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmunasingha%2Ftrip-recommendation-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmunasingha%2Ftrip-recommendation-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmunasingha%2Ftrip-recommendation-algorithm/lists"}