BCG-X-Official / sklearndf

DataFrame support for scikit-learn.
https://bcg-x-official.github.io/sklearndf/
Apache License 2.0
63 stars 7 forks source link

API: introduce SupervisedLearnerDF #194

Closed mtsokol closed 2 years ago

mtsokol commented 2 years ago

Hi @j-ittner @joerg-schneider!

Here's a PR based on Friday's discussion: a separation of LearnerDF into LearnerDF and SupervisedLearnerDF for easy incorporation of clustering algorithms (introduced in the other PR).

And here's new inheritance hierarchy:

                 ┌───────────┐
            ┌───►│EstimatorDF│  # introduces `fit`
            │    └───────────┘
            │          ▲
            │          │
 ┌──────────┴──┐  ┌────┴────┐
 │TransformerDF│  │LearnerDF│  # introduces `predict` and `fit_predict`
 └─────────────┘  └─────────┘
                   ▲      ▲
         ┌─────────┘      │
         │                │
┌────────┴──┐   ┌─────────┴─────────┐
│ClustererDF│   │SupervisedLearnerDF│ # introduces `score`
└───────────┘   └───────────────────┘
                 ▲               ▲
                 │               │
                 │               │
      ┌──────────┴─┐    ┌────────┴──┐
      │ClassifierDF│    │RegressorDF│
      └────────────┘    └───────────┘

What do you think?