LSSTDESC / RESSPECT

The RESSPECT project is a result from an inter-collaboration agreement established between the Cosmostatistics Initiative (COIN) and the LSST Dark Energy Science Collaboration (DESC) with the goal of developing a recommendation system for telescope resource allocation able to optimize photometric supernova cosmology anaylsis.
MIT License
1 stars 0 forks source link

Allow loading a pretrained classifier in `learn_loop`. #55

Closed drewoldag closed 1 month ago

drewoldag commented 1 month ago

Initial commit to add ability to pass a pretrained classifier pickle filepath to ResspectClassifier to use instead of training.

This PR adds a attribute to LoopClassifier, pretrained_model_path that will be used in learn_loop when calling database.classify.

If the filepath is not None, we will attempt to unpickle and assign the result to the classifier in ResspectClassifier. Otherwise we raise a FileNotFound exception.

Something similar will need to be done for time_domain_loop, but we'll wait on that until after the configuration dataclass has been implemented.

github-actions[bot] commented 1 month ago
Before [e4266f46] After [e811d916] Ratio Benchmark (Parameter)
2.51±0.01s 2.54±0.01s 1.01 benchmarks.time_learn_loop('RandomForest', 'RandomSampling')
173M 173M 1 benchmarks.peakmem_learn_loop('KNN')
168M 168M 1 benchmarks.peakmem_learn_loop('RandomForest')
133±0.8ms 133±1ms 1 benchmarks.time_feature_creation
159±0.6ms 159±2ms 1 benchmarks.time_learn_loop('KNN', 'RandomSampling')
161±0.9ms 160±2ms 1 benchmarks.time_learn_loop('KNN', 'UncSampling')
2.51±0.01s 2.52±0.01s 1 benchmarks.time_learn_loop('RandomForest', 'UncSampling')

Click here to view all benchmarks.