Deborah.DeborahCore.MLSequencePyCallLightGBM

Deborah.DeborahCore.MLSequencePyCallLightGBM.flush_pyMethod
flush_py() -> Nothing

Flush Python's stdout and stderr streams using embedded PyCall.jl.

Behavior

  • Calls sys.stdout.flush() and sys.stderr.flush() via PyCall.jl to ensure Python-side output is printed immediately.
  • Useful when embedding Python code that prints output not immediately visible in Julia.

Returns

  • Nothing: This function performs side effects only.
source
Deborah.DeborahCore.MLSequencePyCallLightGBM.l2Method
l2(
    ŷ::Vector{Float64}, 
    y::Vector{Float64}
) -> Float64

Compute the L2 loss (mean squared error) between predicted and true values.

Formula

\[L_2(\hat{\mathbf{y}}, \mathbf{y}) = \frac{1}{N}\sum_{i=1}^{N}\left(\hat{y}_i - y_i\right)^2\]

Arguments

  • : Vector of predicted values.
  • y: Vector of ground truth values.

Returns

  • Float64: Mean squared error between and y.
source
Deborah.DeborahCore.MLSequencePyCallLightGBM.ml_sequence_PyCallLightGBMMethod
ml_sequence_PyCallLightGBM(; 
    model_tag::String,
    X_data::Dict{String, NamedTuple},
    Y_tr_vec::Vector{T},
    Y_bc_vec::Vector{T},
    Y_ul_vec::Vector{T},
    Y_lb_vec::Vector{T},
    tr_conf_arr::Vector{Int},
    bc_conf_arr::Vector{Int},
    ul_conf_arr::Vector{Int},
    partition::DatasetPartitioner.DatasetPartitionInfo,
    X_list::Vector{String},
    paths::PathConfigBuilderDeborah.DeborahPathConfig,
    jobid::Union{Nothing, String}
) -> Dict{Symbol, Matrix} where T<:Real

Train and evaluate a LightGBM model using the Python LightGBM API via PyCall.jl. Generates predicted $Y$ matrices for training, bias correction, unlabeled, and labeled sets. This variant enables direct access to native LightGBM features and uses Python-based training pipelines to support cross-language comparison or advanced tuning not yet available in JuliaAI/MLJ.jl.

All predictions are then reshaped back into $(N_\text{cnf}, N_\text{src})$ matrix form.

Keyword Arguments

  • model_tag::String : Short model identifier.
  • X_data::Dict{String, NamedTuple}: Input feature dictionary. Each key maps to a NamedTuple with vectors for :tr, :bc, :ul, :lb.
  • Y_tr_vec::Vector{T} : Target vector for training set.
  • Y_bc_vec::Vector{T} : Target vector for bias correction set.
  • Y_ul_vec::Vector{T} : Target vector for unlabeled set
  • Y_lb_vec::Vector{T} : Target vector for labeled set.
  • tr_conf_arr::Vector{Int} : Row-wise config index mapping for training set.
  • bc_conf_arr::Vector{Int} : Row-wise config index mapping for bias correction set.
  • ul_conf_arr::Vector{Int} : Row-wise config index mapping for unlabeled set.
  • partition::DatasetPartitioner.DatasetPartitionInfo : Configuration and counts for dataset partitioning.
  • X_list::Vector{String} : Ordered list of feature names to be used.
  • paths::PathConfigBuilderDeborah.DeborahPathConfig : Contains path strings for saving result output.
  • jobid::Union{Nothing, String} : Optional job tag for logging.

Returns

  • Dict{Symbol, Matrix}
    • Y_mats : Dictionary mapping:
      • :YP_tr → predicted $Y$ matrix on training set
      • :YP_bc → predicted $Y$ matrix on bias correction set
      • :YP_ul → predicted $Y$ matrix on unlabeled set

Notes

source