Mlj.jl: Error: fitted_params(LogisticModel)

Created on 23 Apr 2020  ยท  20Comments  ยท  Source: alan-turing-institute/MLJ.jl

Describe the bug

fitted_params(LogisticModel)

MethodError: no method matching coef(::Tuple{GLM.GeneralizedLinearModel{GLM.GlmResp{Array{Float64,1},Distributions.Bernoulli{Float64},GLM.LogitLink},GLM.DensePredChol{Float64,LinearAlgebra.Cholesky{Float64,Array{Float64,2}}}},CategoricalValue{Int64,UInt32}})
Closest candidates are:
coef(!Matched::Union{StatsModels.TableRegressionModel, StatsModels.TableStatisticalModel}, !Matched::Any...; kwargs...) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\StatsModels\dvYSo\src\statsmodel.jl:28
coef(!Matched::GLM.LinPredModel) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\GLM\6V3fS\src\linpred.jl:255
coef(!Matched::StatsBase.StatisticalModel) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\StatsBase\548SN\src\statmodels.jl:10
...

Stacktrace:
[1] fitted_params(::LinearBinaryClassifier{GLM.LogitLink}, ::Tuple{GLM.GeneralizedLinearModel{GLM.GlmResp{Array{Float64,1},Distributions.Bernoulli{Float64},GLM.LogitLink},GLM.DensePredChol{Float64,LinearAlgebra.Cholesky{Float64,Array{Float64,2}}}},CategoricalValue{Int64,UInt32}}) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\MLJModels\gHake\src\GLM.jl:138
[2] fitted_params(::NodalMachine{LinearBinaryClassifier{GLM.LogitLink}}) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\MLJBase\ESDzL\src\operations.jl:45
[3] iterate at .\generator.jl:47 [inlined]
[4] collect(::Base.Generator{Array{Any,1},typeof(fitted_params)}) at .array.jl:665
[5] fitted_params(::Node{NodalMachine{LinearBinaryClassifier{GLM.LogitLink}}}) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\MLJBase\ESDzL\src\composition\composites.jl:51
[6] fitted_params(::LinearBinaryClassifierPipe, ::Node{NodalMachine{LinearBinaryClassifier{GLM.LogitLink}}}) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\MLJBase\ESDzL\src\composition\composites.jl:55
[7] fitted_params(::Machine{LinearBinaryClassifierPipe}) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\MLJBase\ESDzL\src\operations.jl:45
To Reproduce

# We are using the CollegeDistance dataset from the AER package in R

using Queryverse, MLJ, CategoricalArrays, PrettyPrinting
@load LinearRegressor pkg = GLM
@load LinearBinaryClassifier pkg=GLM

X = copy(dfX)
y = copy(dfYbinary)

X=X[:,1:3]

@pipeline LinearBinaryClassifierPipe(
std = Standardizer(),
hot = OneHotEncoder(drop_last = true),
reg = LinearBinaryClassifier()
)

coerce!(X, autotype(X, :string_to_multiclass))
yc = CategoricalArray(y[:, 1])
yc = coerce(yc, OrderedFactor)

LogisticModel = machine(LinearBinaryClassifierPipe(), X, yc)
fit!(LogisticModel)
fp = fitted_params(LogisticModel).fitted_params

Expected behavior
Get the coefficients by calling fitted_params(LogisticModel).fitted_params

Additional context

# Interesting that the fit! and predict calls work fine but not the call to fitted_params
# report output does not include the coefficients

yฬ‚ = MLJ.predict(LogisticModel, X)
r = report(LogisticModel)

Versions

Most helpful comment

hi, I think :) I did a pull request with a new folder containing the jupyter lab and it data files. let me know if you do not see it. thanks for your help.

All 20 comments

Thanks for reporting. It's great to see this stuff being tested.

Would be helpful if you could provide a MWE with simple data set (eg, a built-in set).

hi there,

enclosed is the lab I am doing for you guys. the data files are in the zip as well. let me know if you need anything else. thank you!!

IssueReport.zip

Nevermind. I found the problem. It is a bug. I fix it ASAP. Again, many thanks for reporting!

thank you very much for fixing it so quickly, impressive! is the new version MLJModelsv0.9.7 available to the public yet? I do not see it.

(@v1.4) pkg> update MLJModels
Updating registry at C:\Users\BCP\.juliapro\JuliaPro_v1.4.1-1\registries\JuliaPro
Updating C:\Users\BCP\.juliapro\JuliaPro_v1.4.1-1\environments\v1.4\Project.toml
[no changes]
Updating C:\Users\BCP\.juliapro\JuliaPro_v1.4.1-1\environments\v1.4\Manifest.toml
[no changes]

You're welcome.

You can even use MLJModels0.9.8:
https://github.com/JuliaRegistries/General/pull/13558

Hi, I removed and re-added MLJ. However, I am still getting an error for fp = fitted_params(LogisticModel). How do i get the latest version with fix?

(@v1.4) pkg> rm MLJ
(@v1.4) pkg> rm MLJModels
(@v1.4) pkg> add MLJ

MethodError: no method matching coef(::Tuple{GLM.GeneralizedLinearModel{GLM.GlmResp{Array{Float64,1},Distributions.Bernoulli{Float64},GLM.LogitLink},GLM.DensePredChol{Float64,LinearAlgebra.Cholesky{Float64,Array{Float64,2}}}},CategoricalValue{Int64,UInt32}})
Closest candidates are:
coef(!Matched::Union{StatsModels.TableRegressionModel, StatsModels.TableStatisticalModel}, !Matched::Any...; kwargs...) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\StatsModels\dvYSo\src\statsmodel.jl:28
coef(!Matched::GLM.LinPredModel) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\GLM\6V3fS\src\linpred.jl:255
coef(!Matched::StatsBase.StatisticalModel) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\StatsBase\548SN\src\statmodels.jl:10
...

Stacktrace:
[1] fitted_params(::LinearBinaryClassifier{GLM.LogitLink}, ::Tuple{GLM.GeneralizedLinearModel{GLM.GlmResp{Array{Float64,1},Distributions.Bernoulli{Float64},GLM.LogitLink},GLM.DensePredChol{Float64,LinearAlgebra.Cholesky{Float64,Array{Float64,2}}}},CategoricalValue{Int64,UInt32}}) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\MLJModels\gHake\src\GLM.jl:138
[2] fitted_params(::NodalMachine{LinearBinaryClassifier{GLM.LogitLink}}) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\MLJBase\ESDzL\src\operations.jl:45
[3] iterate at .\generator.jl:47 [inlined]
[4] collect(::Base.Generator{Array{Any,1},typeof(fitted_params)}) at .array.jl:665
[5] fitted_params(::Node{NodalMachine{LinearBinaryClassifier{GLM.LogitLink}}}) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\MLJBase\ESDzL\src\composition\composites.jl:51
[6] fitted_params(::LinearBinaryClassifierPipe, ::Node{NodalMachine{LinearBinaryClassifier{GLM.LogitLink}}}) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\MLJBase\ESDzL\src\composition\composites.jl:55
[7] fitted_params(::Machine{LinearBinaryClassifierPipe}) at C:\Users\BCP.juliapro\JuliaPro_v1.4.1-1\packages\MLJBase\ESDzL\src\operations.jl:45

Have you done ]update MLJ ? Failing that try ]instantiate -p to rebuild your environment from the Project.toml using all latest versions of all packages. If you still have a fail, please post the results of ]status -p and ]status -m.

hi,

yes, the error is still there.

(@v1.4) pkg> update MLJ
Updating registry at C:\Users\BCP\.juliapro\JuliaPro_v1.4.1-1\registries\JuliaPro
Updating C:\Users\BCP\.juliapro\JuliaPro_v1.4.1-1\environments\v1.4\Project.toml
[no changes]
Updating C:\Users\BCP\.juliapro\JuliaPro_v1.4.1-1\environments\v1.4\Manifest.toml
[no changes]

(@v1.4) pkg> status -p
Status C:\Users\BCP\.juliapro\JuliaPro_v1.4.1-1\environments\v1.4\Project.toml
[c52e3926] Atom v0.12.10 โšฒ
[336ed68f] CSV v0.6.0
[324d7699] CategoricalArrays v0.7.7
[861a8166] Combinatorics v1.0.0
[a93c6f00] DataFrames v0.20.2
[31c24e10] Distributions v0.23.2
[38e38edf] GLM v1.3.9
[09f84164] HypothesisTests v0.9.2
[7073ff75] IJulia v1.21.1
[e5e0dc1b] Juno v0.8.1 โšฒ
[add582a8] MLJ v0.10.2
[a7f614a8] MLJBase v0.12.5
[6ee0df7b] MLJLinearModels v0.3.2
[e80e1ace] MLJModelInterface v0.2.1
[d491faf4] MLJModels v0.9.2
[4722fa14] PkgAuthentication v0.1.2
[54e16d92] PrettyPrinting v0.2.0
[612083be] Queryverse v0.5.0
[44d3d7a6] Weave v0.9.4
[009559a3] XGBoost v0.4.2
[de0858da] Printf

(@v1.4) pkg> status -m
Status C:\Users\BCP\.juliapro\JuliaPro_v1.4.1-1\environments\v1.4\Manifest.toml
[1520ce14] AbstractTrees v0.3.2
[7d9fca2a] Arpack v0.4.0
[68821587] Arpack_jll v3.5.0+3
[4fba245c] ArrayInterface v2.6.2
[69666777] Arrow v0.2.4
[bf4720bc] AssetRegistry v0.1.0
[c52e3926] Atom v0.12.10 โšฒ
[fbb218c0] BSON v0.2.5
[b99e7846] BinaryProvider v0.5.91
[00ebfdb7] CSTParser v2.2.0
[336ed68f] CSV v0.6.0
[5d742f6a] CSVFiles v1.0.0
[7057c7e9] Cassette v0.3.1
[324d7699] CategoricalArrays v0.7.7
[53a63b46] CodeTools v0.7.0
[da1fd8a2] CodeTracking v0.5.8
[944b1d66] CodecZlib v0.6.0
[3da002f7] ColorTypes v0.9.1
[5ae59095] Colors v0.11.2
[861a8166] Combinatorics v1.0.0
[bbf7d656] CommonSubexpressions v0.2.0
[34da2185] Compat v3.8.0
[e66e0078] CompilerSupportLibraries_jll v0.3.3+0
[ed09eef8] ComputationalResources v0.3.2
[8f4d0f93] Conda v1.4.1
[187b0558] ConstructionBase v1.0.0
[a8cc5b0e] Crayons v4.0.1
[9a962f9c] DataAPI v1.1.0
[a93c6f00] DataFrames v0.20.2
[864edb3b] DataStructures v0.17.11
[743a1d0a] DataTables v0.1.0
[e2d170a0] DataValueInterfaces v1.0.0
[e7dc6d0d] DataValues v0.4.13
[5721bf48] DataVoyager v1.0.0
[163ba53b] DiffResults v1.0.2
[b552c78f] DiffRules v1.0.1
[b4f34e82] Distances v0.8.2
[31c24e10] Distributions v0.23.2
[33d173f1] DocSeeker v0.4.1
[ffbed154] DocStringExtensions v0.8.1
[497a8b3b] DoubleFloats v1.1.6
[a1bb12fb] Electron v2.0.1
[89b67f3b] ExcelFiles v1.0.0
[c04bee98] ExcelReaders v0.11.0
[e2ba6199] ExprTools v0.1.0
[8f5d6c58] EzXML v1.1.0
[b675d258] FeatherFiles v0.8.1
[409f5150] FeatherLib v0.2.0
[5789e2e9] FileIO v1.2.4
[8fc22ac5] FilePaths v0.8.0
[48062228] FilePathsBase v0.6.2
[1a297f60] FillArrays v0.8.6
[6a86dc24] FiniteDiff v2.3.0
[53c48c17] FixedPointNumbers v0.7.1
[08572546] FlameGraphs v0.2.0
[53afe959] FlatBuffers v0.5.4
[59287772] Formatting v0.4.1
[f6369f11] ForwardDiff v0.10.10
[de31a74c] FunctionalCollections v0.5.0
[38e38edf] GLM v1.3.9
[01680d73] GenericSVD v0.3.0
[c145ed77] GenericSchur v0.4.0
[cd3eb016] HTTP v0.8.13
[9fb69e20] Hiccup v0.2.2
[eafb193a] Highlights v0.4.5
[09f84164] HypothesisTests v0.9.2
[7073ff75] IJulia v1.21.1
[9b13fd28] IndirectArrays v0.5.1
[83e8ac13] IniFile v0.5.0
[41ab1584] InvertedIndices v1.0.0
[1c8ee90f] IterableTables v1.0.0
[42fd0dbc] IterativeSolvers v0.8.3
[82899510] IteratorInterfaceExtensions v1.0.0
[9da8a3cd] JLSO v2.1.0
[682c06a0] JSON v0.21.0
[7d188eb4] JSONSchema v0.2.0
[98e50ef6] JuliaFormatter v0.3.9
[aa1ae85d] JuliaInterpreter v0.7.13
[e5e0dc1b] Juno v0.8.1 โšฒ
[7c4cb9fa] LNR v0.2.1
[50d2b5c4] Lazy v0.15.0
[7f8f8fb0] LearnBase v0.2.2
[1d6d02ad] LeftChildRightSiblingTrees v0.1.2
[94ce4f54] Libiconv_jll v1.16.0+2
[d3d80556] LineSearches v7.0.1
[7a12625a] LinearMaps v2.6.1
[30fc2ffe] LossFunctions v0.5.1
[add582a8] MLJ v0.10.2
[a7f614a8] MLJBase v0.12.5
[6ee0df7b] MLJLinearModels v0.3.2
[e80e1ace] MLJModelInterface v0.2.1
[d491faf4] MLJModels v0.9.2
[2e2323e0] MLJScientificTypes v0.2.3
[03970b2e] MLJTuning v0.2.0
[1914dd2f] MacroTools v0.5.5
[739be429] MbedTLS v0.7.0
[e89f7d12] Media v0.5.0
[f9f48841] MemPool v0.2.0
[f28f55f0] Memento v0.12.1
[e1d29d7a] Missings v0.4.3
[78c3b35d] Mocking v0.7.1
[6f286f6a] MultivariateStats v0.7.0
[ffc61752] Mustache v1.0.2
[d41bc354] NLSolversBase v7.6.1
[77ba4419] NaNMath v0.3.3
[2bd173c7] NodeJS v1.1.1
[4d1e1d77] Nullables v1.0.0
[510215fc] Observables v0.3.1
[4536629a] OpenBLAS_jll v0.3.9+0
[efe28fd5] OpenSpecFun_jll v0.5.3+3
[429524aa] Optim v0.20.6
[bac558e1] OrderedCollections v1.1.0
[90014a1f] PDMats v0.9.12
[d96e819e] Parameters v0.12.0
[626c502c] Parquet v0.3.1
[46a55296] ParquetFiles v0.2.0
[69de0a69] Parsers v1.0.1
[fa939f87] Pidfile v1.1.0
[4722fa14] PkgAuthentication v0.1.2
[f27b6e38] Polynomials v0.6.1
[2dfb63ee] PooledArrays v0.5.3
[85a6dd25] PositiveFactorizations v0.2.3
[54e16d92] PrettyPrinting v0.2.0
[08abe8d2] PrettyTables v0.8.4
[92933f4c] ProgressMeter v1.2.0
[3349acd9] ProtoBuf v0.8.0
[438e738f] PyCall v1.91.4
[1fd47b50] QuadGK v2.3.1
[be4d8f0f] Quadmath v0.5.4
[1a8c2f83] Query v0.12.2
[2aef5ad7] QueryOperators v0.9.1
[612083be] Queryverse v0.5.0
[988b38a3] ReadOnlyArrays v0.1.1
[d71aba96] ReadStat v1.0.2
[a4dc8951] ReadStat_jll v1.1.1+0
[3cdcf5f2] RecipesBase v0.8.0
[189a3867] Reexport v0.2.0
[ae029012] Requires v1.0.1
[79098fc4] Rmath v0.6.1
[f50d1b31] Rmath_jll v0.2.2+0
[f2b01f46] Roots v1.0.1
[321657f4] ScientificTypes v0.7.2
[efcf1570] Setfield v0.6.0
[1277b4bf] ShiftedArrays v1.0.0
[59d4ed8c] Snappy v0.3.0
[b85f4697] SoftGlobalScope v1.0.10
[a2af1166] SortingAlgorithms v0.3.1
[276daf66] SpecialFunctions v0.10.0
[1463e38c] StatFiles v0.8.0
[90137ffa] StaticArrays v0.12.1
[2913bbd2] StatsBase v0.32.2
[4c63d2b9] StatsFuns v0.9.4
[3eaba693] StatsModels v0.6.10
[88034a9c] StringDistances v0.6.3
[cea106d9] Syslogs v0.3.0
[5e66a065] TableShowUtils v0.2.5
[3783bdb8] TableTraits v1.0.0
[382cd787] TableTraitsUtils v1.0.1
[bd369af6] Tables v1.0.3
[e0df1984] TextParse v1.0.0
[8d9c9c80] Thrift v0.6.2
[f269a46b] TimeZones v1.0.1
[0796e94c] Tokenize v0.5.8
[37b6cedf] Traceur v0.3.0
[3bb67fe8] TranscodingStreams v0.9.5
[a2a6695c] TreeViews v0.3.0
[30578b45] URIParser v0.4.0
[112f6efa] VegaLite v2.0.1
[81def892] VersionParsing v1.2.0
[ea10d353] WeakRefStrings v0.6.2
[44d3d7a6] Weave v0.9.4
[0f1e0344] WebIO v0.8.92
[104b5d7c] WebSockets v1.5.2
[cc8bc4a8] Widgets v0.6.2
[009559a3] XGBoost v0.4.2
[fdbf4ff8] XLSX v0.5.8
[02c8fc9c] XML2_jll v2.9.9+2
[ddb6d928] YAML v0.4.0
[c2297ded] ZMQ v1.2.0
[8f1865be] ZeroMQ_jll v4.3.2+1
[a5390f91] ZipFile v0.9.1
[83775a58] Zlib_jll v1.2.11+9
[2a0f44e3] Base64
[ade2ca70] Dates
[8bb1440f] DelimitedFiles
[8ba89e20] Distributed
[7b1f6079] FileWatching
[9fa8497b] Future
[b77e0a4c] InteractiveUtils
[76f85450] LibGit2
[8f399da3] Libdl
[37e2e46d] LinearAlgebra
[56ddb016] Logging
[d6f4376e] Markdown
[a63ad114] Mmap
[44cfe95a] Pkg
[de0858da] Printf
[9abbd945] Profile
[3fa0cd96] REPL
[9a3f8284] Random
[ea8e919c] SHA
[9e88b42a] Serialization
[1a1011a3] SharedArrays
[6462fe0b] Sockets
[2f01184e] SparseArrays
[10745b16] Statistics
[4607b0f0] SuiteSparse
[8dfed614] Test
[cf7118a7] UUIDs
[4ec0a83e] Unicode

(@v1.4) pkg>

Yes, you have a conflict somewhere that prevents the latest MLJModels from loading. Sounds like a pkg management issue, and not an MLJ one.

I suggest you start with a fresh env and install just what you need to check the fix. So something like:

]activate --shared startover
]add MLJModels
]add MLJ
]add GLM
]add <couple others>

Then gradually add other packages you need for your work, noticing when MLJModels drops below the fix (MLJModels 0.9.7) as you do so. You could also substitute ]add [email protected] and ]pin MLJModels to fix the version and see what you can add without a conflict error.

Pkg management is something everyone need to invest more time in than they would like to but there really is no avoiding it ๐Ÿ˜„ .

@drcxcruz @ablaom
I've had this problem multiple times before w/ MLJ & other programs.
I got an error w/o realizing I don't have the latest version of some program usually due to a conflict (Julia's current PKG manager doesn't give a warning).
There are currently 4 Julia issue's about this.

@ablaom it might be worth including a brief note about this in the MLJ README?

@azev77 Thanks for that.

it might be worth including a brief note about this in the MLJ README?

There is already a suggestion under "Installation" to install MLJ in a fresh environment, with instructions. I'm not sure what else we can do.

oh, I see, I agree, Julia definitely needs to provide warning when a package cannot be updated with the ]update command. I would guess 100s if not 1000s of people do not have the latest version of their packages without even know it.

@ablaom
I realize it recommends new users start in a fresh environment, but when I was a new user I didn't understand.

I just did a fresh install of Julia 1.4.1 w/ Juno.
Here is my attempt to interpret this:

""" Fresh install Julia 1.4.1, in Juno. """  
using Pkg; Pkg.status()
"""
Status `C:\Users\azevelev\.julia\environments\v1.4\Project.toml`
  [c52e3926] Atom v0.12.10
  [e5e0dc1b] Juno v0.8.1
"""   
pwd() 
"""   "C:\\Users\\azevelev"   """
Pkg.activate("My_MLJ_env", shared=true)
""" Activating new environment at `C:\Users\azevelev\.julia\environments\My_MLJ_env\Project.toml` """
Pkg.status()
""" Status `C:\Users\azevelev\.julia\environments\My_MLJ_env\Project.toml`
  (empty environment)
""" 
Pkg.add(["MLJ", "MLJModels"])
Pkg.status()
"""
Status `C:\Users\azevelev\.julia\environments\My_MLJ_env\Project.toml`
  [add582a8] MLJ v0.11.0
  [d491faf4] MLJModels v0.9.9
"""
Pkg.add("DecisionTree");
using MLJ;
models()

@load DecisionTreeClassifier
X, y = @load_iris
train, test = partition(eachindex(y), .7, rng=333);

mdl  = DecisionTreeClassifier()
mach = machine(mdl, X, y)
fit!(mach, rows=train, verbosity=0)
yฬ‚ = predict(mach, rows=test)
yฬ‚ = predict_mode(mach, rows=test)
accuracy(yฬ‚, y[test])


##Install all MLJ relevant packages 
Pkg.add([
    "Clustering",
    "DecisionTree",
    "EvoTrees",
    "GLM",
    "LightGBM",
    "LIBSVM",
    "MLJModels",
    "MLJLinearModels",
    #MLpack,
    "MultivariateStats",
    "NaiveBayes",
    "NearestNeighbors",
    "ParallelKMeans",
    "ScikitLearn",
    "XGBoost"
])
#
Pkg.status()
"""
Status `C:\Users\azevelev\.julia\environments\My_MLJ_env\Project.toml`
  [aaaa29a8] Clustering v0.14.0
  [7806a523] DecisionTree v0.10.1
  [f6006082] EvoTrees v0.4.7
  [38e38edf] GLM v1.3.9
  [b1bec4e5] LIBSVM v0.4.0
  [7acf609c] LightGBM v0.2.1
  [add582a8] MLJ v0.11.0
  [6ee0df7b] MLJLinearModels v0.3.2
  [d491faf4] MLJModels v0.9.9
  [6f286f6a] MultivariateStats v0.7.0
  [9bbee03b] NaiveBayes v0.4.0
  [b8a86587] NearestNeighbors v0.4.4
  [42b8e9d4] ParallelKMeans v0.1.4
 [3646fa90] ScikitLearn v0.5.1        #Latest is v 0.6.1
  [009559a3] XGBoost v0.4.3
""" 
#Force PKG manager to install the latest sklearn.
Pkg.add(Pkg.PackageSpec(url = "https://github.com/cstjean/ScikitLearn.jl"))
"""
Cloning git-repo `https://github.com/cstjean/ScikitLearn.jl`
Updating git-repo `https://github.com/cstjean/ScikitLearn.jl`
Resolving package versions...
Installed Distributions โ”€ v0.22.6
Installed CSV โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ v0.6.1
Installed RDatasets โ”€โ”€โ”€โ”€โ”€ v0.6.7
Updating `C:\Users\azevelev\.julia\environments\My_MLJ_env\Project.toml`
[3646fa90] โ†‘ ScikitLearn v0.5.1 โ‡’ v0.6.1 #master (https://github.com/cstjean/ScikitLearn.jl)
Updating `C:\Users\azevelev\.julia\environments\My_MLJ_env\Manifest.toml`
[336ed68f] โ†‘ CSV v0.3.1 โ‡’ v0.6.1
[944b1d66] โ†“ CodecZlib v0.7.0 โ‡’ v0.6.0
[9a8bc11e] - DataStreams v0.4.2
[31c24e10] โ†“ Distributions v0.23.2 โ‡’ v0.22.6
[48062228] โ†“ FilePathsBase v0.8.0 โ‡’ v0.7.0
[891a1506] โ†“ GaussianProcesses v0.12.0 โ‡’ v0.11.2
[7d512f48] - InternedStrings v0.7.0
[7f8f8fb0] โ†“ LearnBase v0.3.0 โ‡’ v0.2.2
[30fc2ffe] โ†“ LossFunctions v0.6.0 โ‡’ v0.5.1
[df47a6cb] โ†‘ RData v0.6.3 โ‡’ v0.7.1
[ce6b1742] โ†‘ RDatasets v0.6.1 โ‡’ v0.6.7
[3646fa90] โ†‘ ScikitLearn v0.5.1 โ‡’ v0.6.1 #master (https://github.com/cstjean/ScikitLearn.jl)
[2913bbd2] โ†“ StatsBase v0.33.0 โ‡’ v0.32.2
[ea10d353] โ†‘ WeakRefStrings v0.5.8 โ‡’ v0.6.2
""" 

""" AZ: packages needed to train all models. """
Pkg.add(["RDatasets", "TableView", "DataFrames", "Plots"])

thanks for your teaching and time. I finally not getting the error. I will continue with jupyter lab next week. Have a great weekend!! the no warning from ]update is a serious issue, I feel.

[add582a8] MLJ v0.11.0
[a7f614a8] MLJBase v0.13.1
[e80e1ace] MLJModelInterface v0.2.2
[d491faf4] MLJModels v0.9.9
[2e2323e0] MLJScientificTypes v0.2.5
[03970b2e] MLJTuning v0.3.3

(machines = Any[NodalMachine{LinearBinaryClassifier{LogitLink}} @ 4โ€ฆ69, NodalMachine{OneHotEncoder} @ 1โ€ฆ49, NodalMachine{Standardizer} @ 6โ€ฆ12],
fitted_params_given_machine = OrderedCollections.LittleDict{Any,Any,Array{Any,1},Array{Any,1}}(NodalMachine{LinearBinaryClassifier{LogitLink}} @ 4โ€ฆ69 => (coef = [0.18847098193147224, 0.1640372742325821, 0.28416713352352335, 0.9997176751990827, -0.6091714435601638, -0.537733964521816, -0.24922378428063735], intercept = -0.5193557525233037),NodalMachine{OneHotEncoder} @ 1โ€ฆ49 => (fitresult = OneHotEncoderResult @ 4โ€ฆ13,),NodalMachine{Standardizer} @ 6โ€ฆ12 => (mean_and_std_given_feature = Dict(:score => (50.88902933684601, 8.701909614072397)),)),)

hello again!

Because your teachings, I completed the jupyter lab I like you to consider adding to the MLJ tutorial labs documentation. Please let me know of any comments or corrections in the lab code or approach.
MLJ_GLM_Lab.zip

I do have one question. The GLM.jil documentation says
coef: extract the estimates of the coefficients in the model
stderror: standard errors of the coefficients

I understand the two definitions imply that the number of coef = number of stderr. However, that is not the case in our lab. MLJ is showing one extra value in the stderr array. I assume MLJ is including the stderr of the intercept. If yes, how do we know which strderr value is for the intercept? Taking the linear regression example in our lab to show the issue. There are 5 coefs but 6 stderr values. or am misunderstanding? :)

Coefficients: [1.0207869497405524, 1.03242891546997, 0.009406292423317655, 0.026633915171207473, 0.29985915636370225]

Standard Error per Coefficient
[0.015876403107805682, 0.015862782503144914, 0.01515900587321476, 0.01515667698600387, 0.016546721612329368, 0.015148210698700702]

@drcxcruz could you please open a PR at MLJTutorials following the instructions mentioned in the README there and I'll review it. Thank you.

hi,

I am brand new to github :) today is my first day using github. I will try to create the Pull Request. I assumed I just needed to add the data files and the jupyter lab to the repository. however, it is not very clear into what folder in the repository i need to add the new lab. I was expecting a LABS folder in the repository where to put the new lab. And perhaps, another repository folder where to put the data files of the lab.

please let me know of any tips in how to create the pull request. I do not think I would to follow the "for developers" steps. the lab might not be ready for release yet so adding it the web page is premature.

Thanks

@drcxcruz don't worry, just open a PR do what you can and let me know in the comment of the PR what's missing or what you struggled with, it doesn't matter if the PR doesn't pass CI, I'll try to help you from there.

hi, I think :) I did a pull request with a new folder containing the jupyter lab and it data files. let me know if you do not see it. thanks for your help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aviatesk picture aviatesk  ยท  7Comments

darrencl picture darrencl  ยท  4Comments

tlienart picture tlienart  ยท  4Comments

ExpandingMan picture ExpandingMan  ยท  7Comments

ChrisRackauckas picture ChrisRackauckas  ยท  7Comments