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

MLJ 0.17, ScientificTypes 3.0 update #174

Closed
7 tasks done
ablaom opened this issue Dec 30, 2021 · 8 comments
Closed
7 tasks done

MLJ 0.17, ScientificTypes 3.0 update #174

ablaom opened this issue Dec 30, 2021 · 8 comments

Comments

@ablaom
Copy link
Member

ablaom commented Dec 30, 2021

Time to update all the tutorials once more. Breaking changes listed here.

Probably the main changes are:

  • EnsmbleModel(atom=...) is now EnsembleModel(model=...) (breaking)
  • @pipeline is deprecated in favour of macro free pipelines (using |> syntax) and the use of the new wrapper TransformedTargetModel(model=..., target=..., ) for target transformations.
  • added If the last predicate in unpack(...) is of the form _ -> true, then it can be dropped (Change unpack to avoid colname -> true mystery MLJBase.jl#621)
  • added the entire section on "arrow syntax" can be dropped, as this syntax has been usurped by pipelines

Todo:

  • Data Basics (D0-)
  • Getting Started (A-)
    • A-learning-networks (removed the arrow section)
    • A-model-choice (unpack)
    • A-model-tuning (ensemble)
    • A-ensemble (ensemble)
    • A-enseemble2 (ensemble)
  • Intro to Stats (ISL-)
    • ISL8 (unpack)
  • End-to-end Examples (EX-)
    • airfoil (unpack)
    • houseking (unpack)

cc @OkonSamuel

@ablaom
Copy link
Member Author

ablaom commented Jan 10, 2022

@OkonSamuel Note that I have added two points to the first list.

@tlienart
Copy link
Collaborator

tlienart commented Jan 10, 2022

Had a quick first go at this but am failing to precompile 0.17 on 1.7.1 which is not ideal. will do a bit of digging but in the meantime if someone has an idea ..

EDIT: fixed

@tlienart
Copy link
Collaborator

To better understand the pipeline stuff, could I get guidance on how to update this?

pipe = @pipeline(
    X -> coerce(X, :age=>Continuous),
    OneHotEncoder(),
    KNNRegressor(K=3),
    target = UnivariateStandardizer());

@tlienart tlienart mentioned this issue Jan 10, 2022
@OkonSamuel
Copy link
Member

pipe = @pipeline(
X -> coerce(X, :age=>Continuous),
OneHotEncoder(),
KNNRegressor(K=3),
target = UnivariateStandardizer())

This would just be

pipe = (X -> coerce(X, :age=>Continuous)) |> 
    OneHotEncoder() |>
    KNNRegressor(K=3)

model = TransformedTargetModel(
    pipe,
    target = UnivariateStandardizer
)

@ablaom
Copy link
Member Author

ablaom commented Jan 10, 2022

I'd probably invert the composition here - first wrap KNN in a target transformer and then insert into the pipeline.

See https://github.com/ablaom/MLJTutorial.jl/tree/dev/notebooks/03_pipelines which is already revised for examples.

@tlienart
Copy link
Collaborator

Ideally if you guys could suggest copy-pastable replacements in the PR for the places where this appears:

  1. A-composing-models
  2. EX-GLM
  3. EX-horse
  4. EX-wine
  5. ISL-lab-5
  6. ISL-lab-6b
  7. ISL-lab-8
    1. ISL-lab-10

(beyond just the pipeline syntax there's usually a couple of lines afterwards which query elements in the pipeline which have to be updated as well).

@tlienart
Copy link
Collaborator

tlienart commented Jan 13, 2022

I've merged the PR as it was causing issues with the deployment, I'll let you guys adjust the @pipeline stuff and review when you have time but at least the site is back online and uses the latest MLJ.

@tlienart
Copy link
Collaborator

all done, thanks @OkonSamuel for the help and fixes!

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

No branches or pull requests

3 participants