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

Make docstrings #39

Merged
merged 23 commits into from
Aug 10, 2022
Merged

Make docstrings #39

merged 23 commits into from
Aug 10, 2022

Conversation

josephsdavid
Copy link
Contributor

@josephsdavid josephsdavid commented Jun 1, 2022

In service of #38 and #913

@codecov-commenter
Copy link

codecov-commenter commented Jun 6, 2022

Codecov Report

Merging #39 (276427f) into dev (0dc2190) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev      #39   +/-   ##
=======================================
  Coverage   92.71%   92.71%           
=======================================
  Files           5        5           
  Lines         247      247           
=======================================
  Hits          229      229           
  Misses         18       18           
Impacted Files Coverage Δ
src/MLJMultivariateStatsInterface.jl 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0dc2190...276427f. Read the comment docs.

@josephsdavid josephsdavid marked this pull request as ready for review June 20, 2022 21:04
Copy link
Member

@ablaom ablaom left a comment

Choose a reason for hiding this comment

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

@josephsdavid I have completed my first review. Phew! 😥

Please address the todo list above to support #47 .

Ping me when you are ready, and I'll make a final review.

Bayesian Multiclass linear discriminant analysis. Suitable for high dimensional data
(Avoids computing scatter matrices `Sw` ,`Sb`). The algorithm learns a projection
matrix `P = W*L` (`Sw`), that projects a feature matrix `Xtrain` onto a lower
dimensional space of dimension `nc-1` such that the trace of the transformed
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
dimensional space of dimension `nc-1` such that the trace of the transformed
dimensional space of dimension `min(rank(Sw), nc-1)` such that the trace of the transformed

same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be resolved

@josephsdavid
Copy link
Contributor Author

josephsdavid commented Aug 9, 2022

@josephsdavid In service of addressing the documentation counterpart of #47, here's a checklist for you:

I cannot check them out but this checklist is done!

However, I did notice one issue, or have a user error in the following ICA example: making sure i have the right mlj version (I think i do)

using MLJ

ICA = @load ICA pkg=MultivariateStats

time = 8 .\ 0:2001

sine_wave = sin.(2*time)
square_wave = sign.(sin.(3*time))
sawtooth_wave = repeat(collect(0:10) / 4, 182)
signal = [sine_wave, square_wave, sawtooth_wave]
add_noise(x) = x + randn()
signal = map((x -> add_noise.(x)), signal)
signal = permutedims(hcat(signal...))'

mixing_matrix = [ 1 1 1; 0.5 2 1; 1.5 1 2]
X = MLJ.table(signal * mixing_matrix)

model = ICA(k = 3, tol=0.1)
mach = machine(model, X) |> fit! # this errors ERROR: MethodError: no method matching size(::MultivariateStats.ICA{Float64}, ::Int64)

Xproj = transform(mach, X)
@info sum(abs, Xproj - signal)

output of ]st:

  [add582a8] MLJ v0.18.4
  [a7f614a8] MLJBase v0.20.16
  [1b6a4a23] MLJMultivariateStatsInterface v0.3.2

It also appears that ICA is still using k, if i use outdim, i get a methoderror

@ablaom
Copy link
Member

ablaom commented Aug 9, 2022

Well, we probably just need to rebase on the new dev, which has had breaking changes (and, I suspect, a bug fix addressing your issue). I will investigate. Thanks for this progress.

@ablaom ablaom merged commit fd5b524 into JuliaAI:dev Aug 10, 2022
@ablaom ablaom mentioned this pull request Aug 10, 2022
@ablaom
Copy link
Member

ablaom commented Aug 10, 2022

Thanks @josephsdavid for all your work on this mammoth PR. 🚀

@josephsdavid
Copy link
Contributor Author

Woohoo! It's done!

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.

4 participants