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

Is `self.predicted_class` ever really used in `database.py`? #52

Closed drewoldag closed 1 month ago

drewoldag commented 1 month ago

From what I can see self.predicted_class is only ever assigned, but the values are never used. If that's really the case, then we can simplify a lot of code in both database.py as well as the API definition for the all the classifiers.

Currently the classifiers have a predict method that will return 2 arrays 1) the list of predicted classes 2) the list of class probabilities for each input. If we don't need the list of predicted classes there is a lot of code that can be cleaned up and it would reduce the computations needed (currently each prediction is run twice - the predicted classes are just argmax of the class probabilties).

drewoldag commented 1 month ago

Chatted with @AmandaWasserman about this, and we'll take the approach of breaking apart the predict method into predict_class and predict_probability such that each will return either the list of classes or the list of probabilities per class for each input data sample.

This will also have the benefit of making it easier to implement subclasses that are not wrappers over sklearn-based classifiers.

drewoldag commented 1 month ago

This was addressed in PR #54