Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model input types #31

Merged
merged 4 commits into from Sep 27, 2016
Merged

Model input types #31

merged 4 commits into from Sep 27, 2016

Conversation

pacman82
Copy link
Collaborator

@pacman82 pacman82 commented Sep 26, 2016

This branch splits the old Model trait into a new Model trait for accessing the coefficients and an Expert trait for modeling the relation between that coefficients and the target.

Motivation:
This branch started out with the humble goal to remove the std::marker::PhantomData hack in model::Constant which has been required for type inference to kick in, so that the user does not have to specify the feature type explicitly. However the only way to get rid of it without breaking type inference, has been to split the Model trait as stated above. Despite born out of technical necessity to please the compiler, I found that this split has intriguing consequences for the domain of ML:
Consider the urban legend about the barometer question. Niels Bohr was supposedly asked to determine the height of the building using a barometer. Among others he suggested:

  1. Throwing the barometer from a building
  2. Marking off the number of barometer lengths vertically along the emergency staircase
  3. Measuring the pressure difference between ground and roof
    Let's say we'd have to set of measurements for 1,2 and 3. We can write three Experts for the same set of coefficients (in that case the height of the building). The generalization still works even if not all experts use all coefficients (e.g. if the length of the barometer would be unknown. We would when need to learn it, but only 2 is influenced by this).

On a less philosophical note this branch allowed to implement the Model trait directly for f64 and get rid of Constant. Once the target type is generic it will allow the same classifier to implement an Expert returning a crisp prediction (true | false) or a probability (f64)

@HolgerPeters HolgerPeters merged commit ee33b14 into master Sep 27, 2016
@pacman82 pacman82 deleted the model_input_types branch September 30, 2016 02:05
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.

None yet

2 participants