---
# System prepended metadata

title: GSoC 2024 - Proximity Forest Divya
tags: [aeon-gsoc]

---

# GSoC 2024 - Proximity Forest Divya
###### tags: `aeon-gsoc`

__Contributor:__ Divya Tiwari
__GSoC page:__ https://summerofcode.withgoogle.com/programs/2024/projects/8TYGhJjy
__Project:__ Implement the Proximity Forest Algorithm for Time Series Classification
__Project length:__ 12 Week
__Mentors:__ Matthew Middlehurst, Tony Bagnall, Antoine Guillaume 
__Mid-project evaluation:__ Friday, July 12
__Final evaluation:__ Monday, August 26
__Blog link:__ https://medium.com/@Divya2003/
__Regular meeting time:__ Friday, 14:00 UTC

## Project Summary

This project will implement and benchmark the Proximity Forest Algorithm for Time Series Classification in aeon. With the ever-increasing data, the applications of time series classification are also increasing. Hence, we need classification algorithms that are both efficient and scalable. The Proximity Forest Algorithm is the current state-of-the-art distance-based classifier that creates an ensemble of decision trees, where the splits are based on the similarity between time series measured using various parameterised distance measures. Currently, a version of Proximity Forest which can match the performance of the original implementation has not been implemented in Python. This project aims to implement Proximity Forest in aeon for the classification of univariate time series datasets of equal length and make it accessible for a greater variety of users. The implementation will be benchmarked on the UCR archive to match the results of the original Java implementation in terms of run time and accuracy.

## Project Timeline

Issues: [#159](https://github.com/aeon-toolkit/aeon/issues/159) [#428](https://github.com/aeon-toolkit/aeon/issues/428)

### Week 1-2

- Write framework for the proxmity tree classifier, including `get_splitter` function and tree node class using aeon distances
- Write unit tests for the proximity tree framework with expected functionality and outputs (these do not have to pass yet). 

### Week 3-4

- Complete proximity tree class extending `BaseClassifier`
- Have `_fit`, `_predict` and `_predict_proba` methods implemented.

### Week 5-6

- Write remaining unit tests for proximity tree class to ensure functionality and maximise test coverage
- Document the proximity tree class and methods then add it the aeon API webpage

### Mid-project Deliverables

- Proximity Tree Class
- Proximity Tree Documentation
- Proximity Tree Tests

### Week 7-8

- Write proximity forest class with basic documentation
- Write unit tests for the proximity forest class to ensure functionality and maximise test coverage

### Week 9-10

- Begin benchmarking the proximity forest class, producing results on the UCR archive datasets
- Complete documentation of the proximity forest class and methods then add it the aeon API webpage

### Week 11-12

- Evaluate the proximity forest implentation against other versions
- Improve the proximity tree and forest classes if results are not as expected

### Final Deliverables

- Proximity Forest Class
- Proximity Forest Documentation
- Proximity Forest Tests
- Benchmarked Proximity Forest results

## Community Bonding Period

- [x] Introduce yourself in the community Slack channels. Use __#introductions__ to introduce youself to the wider community if you have not already and __#summer-2024__ to introduce yourself and your project to other students and mentors.
- [x] Go through the contributor guide on the _aeon_ website (https://www.aeon-toolkit.org/en/stable/contributing.html).
- [x] Set up a development environment, including _pytest_ and _pre-commit_ dependencies. This will make development a lot easier for you, as you must pass the PR tests to have your code merged (https://www.aeon-toolkit.org/en/stable/developer_guide/dev_installation.html).
- [x] Review some of the important dependencies for developing aeon at a basic level:
    - [ ] __scikit-learn__ the interface aeon estimators extend from. We aim to keep as compatible as possible with sklearn tools.
	- [x] __pytest__ for unit testing. Any code added will have to be covered by tests.
	- [x] __sphinx/myst__ for documentation. Adding new functions and classes will have to be added to the API docs.
	- [x] __numba__ for writing efficient functions.
- [x] Make some basic Pull Requests (PRs) to gain some experience with contributing to _aeon_ through GitHub. Some suggestions:
    - [x] Improve EE API documentation [#1496](https://github.com/aeon-toolkit/aeon/issues/1496)
    - [x] Update classification API page [#1497](https://github.com/aeon-toolkit/aeon/issues/1497)
    - [x] Write EE parameter test [#1497](https://github.com/aeon-toolkit/aeon/issues/1499)
- [x] Read up on the subject of your project (Proximity Forest and TSC). We will provide some literature, but we encourage you to go beyond that and ask any questions you have.
    - [x] [Proximity Forest](https://link.springer.com/article/10.1007/s10618-019-00617-3)
    - [x] [Proximity Forest 2.0](https://arxiv.org/abs/2304.05800)
    - [ ] [Large Time Series Classification (TSC) benchmark](https://link.springer.com/article/10.1007/s10618-024-01022-1)
- [x] Decide on a project length (https://developers.google.com/open-source/gsoc/help/project-dates).
- [x] Refine the project timeline and deliverables with the project mentors. Agree on some milestones for both mid-project and final evaluations.
- [x] Update the GSoC webpage project to better match any new directions after discussions with mentors.
- [x] Select a tracking/blogging medium to write down and track progress made on the project. Agree on a frequency of updates.
- [x] Set up regular meeting days and times to discuss the project and track progress.

## Week 1: 27th May

A draft PR has been opened for the proximity tree. We discussed some potential issues with the current random_state usage and suggested writing tests to verify the output of the gini function.

Blog post: https://medium.com/@Divya2003/gsoc24-with-aeon-week-1-9dbd4b8753ba

## Week 2: 3rd June

Short meeting, with same suggestions as previously to add pytest functions for the contents of the tree.

Blog post: https://medium.com/@Divya2003/gsoc24-with-aeon-week-2-86b5b1cb7e0f

## Week 3: 10th June

Blog post: https://medium.com/@Divya2003/gsoc24-with-aeon-week-3-8eb28a315a17

## Week 4: 17th June

Tree mostly looks fine, Tony to leave some comments and has to be added to the API documentation.

Good to move onto the forest, evaluating the implementation can be done then and if any issues arise we can look deeper.

Ahead of schedule, if this remains can look at unequal length, multivariate and/or PF 2.0

Blog post: https://medium.com/@Divya2003/gsoc24-with-aeon-week-4-0eaffbd4dfed

## Week 5: 24 June

Blog post: https://medium.com/@Divya2003/gsoc24-with-aeon-week-5-3bd06594c035

## Week 6: 1 July

Blog post: https://medium.com/@Divya2003/gsoc24-with-aeon-week-6-0313f86825d9

## Week 7: 8 July
Blog post: https://medium.com/@Divya2003/gsoc24-with-aeon-week-7-7acc580210e0

## Week 8 and 9: 29 July
Blog post: https://medium.com/@Divya2003/gsoc24-with-aeon-weeks-8-and-9-e462e2b30a5b