Skip to content

clean up, complete and comment logistic regression example - #43

Merged
marcelluethi merged 1 commit into
dimwit-dev:mainfrom
marcelluethi:improve-logreg
Jan 19, 2026
Merged

clean up, complete and comment logistic regression example#43
marcelluethi merged 1 commit into
dimwit-dev:mainfrom
marcelluethi:improve-logreg

Conversation

@marcelluethi

Copy link
Copy Markdown
Contributor

I restructured and cleaned up the logistic regression example, with the intention of showcasing how simple applications are structured and the core components (like permutations, iterators, jit, ...) are used together.

Instead of relying on LinearMap, which is already a higher level abstraction.

@marcelluethi
marcelluethi requested a review from benikm91 January 17, 2026 06:29

@benikm91 benikm91 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I overall like the changes.

Why do you put the loss function into the BinaryLR object? For me the model and loss function should be separate concepts. As we can train a model on various loss functions and use a loss function on various models. For me, having a loss function on the model (or score like SKLearn) is a code smell. But for simple example does not matter.

@marcelluethi

Copy link
Copy Markdown
Contributor Author

There are two reasons, why combining the loss in the Logistic regression object might be justified:

  1. Logistic regression is not only a model but the definition of the loss function is baked into it (if you loose a different loss it's not logistic regression anymore (just another linear model)
  2. The loss takes parameters as a parameter. Hence it is tied to the model. If we want to separate the two, we would have to define the loss in terms of predictions and labels, and not parameters and labels.

@marcelluethi
marcelluethi merged commit 7864823 into dimwit-dev:main Jan 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants