Eine Pipeline hört nach der Berechnung des Models auf. Was ist, wenn wir anschließend aber noch weitere Schritte ausführen möchten?

Untitled

Voting Classifie can balance multiple classifier out. Die Stärken des einen sind die Schwächen des anderen. Gutes Beispiel im Video (link):

Untitled

With a threshold we can tune the classification. We can optimize for either precision or recall by just tuning the threshold. This way we can make sure to pick yellow dots with high precision (but low recall, because we did not find all yellow dots). Mit GridSearchCV können wir das ganze noch optimieren und grafisch darfstellen um den Sweet Spot zu finden —> link:

Untitled

Mittels FeatureUnion kann ich komplexere Pipeline-Schrite ausführen. Es gibt außerdem einen Weg abhängig von Spaltenwert ein anderes Model zu trainieren (link).

Untitled

Untitled

Im Beispiel wird am Wochenende nichts gekauft, weshalb Target dann immer Null ist. Hier macht es Sinn, auch 2 Classifier zu nutzen. Der erste Bestimmt ob es “0” ist oder nicht. Falls nicht “0” dabb gehts zum 2 Classifier der dann einen genauen Wert bestimmt. Die Umsetzung ist überraschend einfach und recht erfolgreich (link)!

Untitled

If you're interested in using the same dataset X to predict two labels, **y1**and y2, then you may take a shortcut. Instead of making two pipelines, you can also use a single pipeline that contains a copy of a model. One for each model. Scikit-Learn allows you to do this by using a MultiOutputClassifier. Ist ein Trick, aber braucht man nicht zwingend (link)