|
| 1 | +function details(sem::AbstractSem) |
| 2 | + print("Structural Equation Model") |
| 3 | + print(_subtype_info(sem)) |
| 4 | + print("\n") |
| 5 | + print("- Loss Functions \n") |
| 6 | + for term in loss_terms(sem) |
| 7 | + print(" > ") |
| 8 | + details(term) |
| 9 | + println() |
| 10 | + end |
| 11 | +end |
| 12 | + |
| 13 | +function details(term::LossTerm) |
| 14 | + if !issemloss(term) |
| 15 | + print(term.loss) |
| 16 | + else |
| 17 | + println("Structural Equation Model Loss ($(nameof(typeof(term.loss))))") |
| 18 | + if !isnothing(id(term)) |
| 19 | + print(" - id: $(id(term)) \n") |
| 20 | + end |
| 21 | + println(" - Observed: $(nameof(typeof(observed(term)))) ($(nsamples(term)) samples)") |
| 22 | + println(" - Implied: $(nameof(typeof(implied(term)))) ($(nparams(term)) parameters)") |
| 23 | + println(" - Variables: $(nobserved_vars(term)) observed, $(nlatent_vars(term)) latent") |
| 24 | + if !isnothing(weight(term)) |
| 25 | + print(" - weight: $(round(weight(term), digits=3))") |
| 26 | + end |
| 27 | + end |
| 28 | +end |
| 29 | + |
1 | 30 | function details(sem_fit::SemFit; show_fitmeasures = false, color = :light_cyan, digits = 2) |
2 | 31 | print("\n") |
3 | 32 | println("Fitted Structural Equation Model") |
@@ -325,11 +354,13 @@ function Base.findall(fun::Function, partable::ParameterTable) |
325 | 354 | end |
326 | 355 |
|
327 | 356 | """ |
328 | | - (1) details(sem_fit::SemFit; show_fitmeasures = false) |
| 357 | + (1) details(model::AbstractSem) |
| 358 | +
|
| 359 | + (2) details(sem_fit::SemFit; show_fitmeasures = false) |
329 | 360 |
|
330 | | - (2) details(partable::AbstractParameterTable; ...) |
| 361 | + (3) details(partable::AbstractParameterTable; ...) |
331 | 362 |
|
332 | | -Print information about (1) a fitted SEM or (2) a parameter table to stdout. |
| 363 | +Print information about (1) a SEM, (2) a fitted SEM or (3) a parameter table to stdout. |
333 | 364 |
|
334 | 365 | # Extended help |
335 | 366 | ## Addition keyword arguments |
|
0 commit comments