scverse / pertpy

Perturbation Analysis in the scverse ecosystem.
https://pertpy.readthedocs.io/en/latest/
MIT License
92 stars 19 forks source link

Add logistic regression for perturbation space creation #538

Closed Lilly-May closed 3 months ago

Lilly-May commented 4 months ago

Description of feature

We already offer several methods for creating the perturbation space. In addition to rather simple ones (Pseudobulk and Centroid Space), we also provide the DiscriminatorClassifierSpace where we train an MLP. Depending on the dataset, the training process can take quite long. Therefore, I would like to propose an additional ML-based approach, but one that is very simple.

I have done some tests with a logistic regression classifier using the Norman dataset, and the results look quite promising. Hence, I suggest adding a logistic regression classifier as an alternative to the MLP-based discrimination classifier.

Regarding the integration into the API, there are two options, and I would like to use this issue to start a discussion on which option people prefer:

  1. Integrating it as another independent class and renaming the DiscriminatorClassifierSpace to something that clearly indicates the use of an MLP.
  2. Integrating it into the already existing DiscriminatorClassifierSpace class and adding a parameter model, which can be either Regressor or MLP.
Zethson commented 4 months ago

I'd probably opt for option 2. Seems cleaner to me