DensityRatioEstimation.KLIEPType
KLIEP(σ=1.0, b=100)

Kullback-Leibler importance estimation procedure (KLIEP).

Parameters

  • σ - Bandwidth of Gaussian kernel (default to 2.0)
  • b - Maximum number of radial basis functions (default to 10)

References

  • Sugiyama et al. 2008. Direct importance estimation for covariate shift adaptation.

Author

  • Júlio Hoffimann (julio.hoffimann@gmail.com)
DensityRatioEstimation.KMMType
KMM(σ=1.0, B=Inf, ϵ=0.01, λ=0.001)

Kernel Mean Matching (KMM).

Parameters

  • σ - Bandwidth of Gaussian kernel (default to 2.0)
  • B - Maximum discrepancy allowed (default to Inf)
  • ϵ - Tolerance for unit sum (default to 0.01)
  • λ - Regularization parameter (default to 0.001)

References

  • Huang et al. 2006. Correcting sample selection bias by unlabeled data.

Author

  • Júlio Hoffimann (julio.hoffimann@gmail.com)
  • Kai Xu (xukai921110@gmail.com)
DensityRatioEstimation.LCVType
LCV(ranges, nfolds=10)

Likelihood cross-validation with parameter ranges ranges and number of folds nfolds.

References

  • Sugiyama et al. 2008. Direct importance estimation for covariate shift adaptation.

Author

  • Júlio Hoffimann (julio.hoffimann@gmail.com)
DensityRatioEstimation.LSIFType
LSIF(σ=2.0, b=100, λ=0.001)

Least squares importance fitting.

Parameters

  • σ - Bandwidth of Gaussian kernel (default to 2.0)
  • b - Maximum number of radial basis functions (default to 10)
  • λ - Regularization parameter (default to 0.001)

References

  • Kanamori et al. 2009. A Least-squares Approach to Direct

Importance Estimation

Author

  • Júlio Hoffimann (julio.hoffimann@gmail.com)
DensityRatioEstimation.uKMMType
uKMM(σ=1.0, B=Inf, ϵ=0.01, λ=0.001)

Unconstrained Kernel Mean Matching (KMM).

Parameters

  • σ - Bandwidth of Gaussian kernel (default to 2.0)
  • λ - Regularization parameter (default to 0.001)

References

  • Huang et al. 2006. Correcting sample selection bias by unlabeled data.

Author

  • Júlio Hoffimann (julio.hoffimann@gmail.com)
  • Kai Xu (xukai921110@gmail.com)
DensityRatioEstimation.default_optlibMethod
default_optlib(dre)

Return default optimization library for density ratio estimator dre. The function can also be called on the type typeof(dre).

DensityRatioEstimation.densratioMethod
densratio(x_nu, x_de, dre; [optlib])

Estimate density ratio p_nu(x_de) / p_de(x_de) with estimator dre and indexable collections of numerator and denominator samples, x_nu and x_de.

Optionally choose an optimization library optlib from the list below:

  • JuliaLib - Pure Julia implementation
  • OptimLib - Implementation with Optim.jl
  • ConvexLib - Implementation with Convex.jl
  • JuMPLib - Implementation with JuMP.jl

See also densratiofunc.

DensityRatioEstimation.densratiofuncMethod
densratiofunc(x_nu, x_de, dre; [optlib])

Similar to densratio, but return a function r(x) = p_nu(x) / p_de(x) that can be evaluated at a new unseen sample x.

See also densratio.

Notes

Only some estimators define a ratio function that can be evaluated outside x_de.

DensityRatioEstimation.safe_diagmMethod
safe_diagm(mat, a)

Generate a squared matrix whose diagonal is a that is compatible to perform addition on mat. It behaves differently based on whether mat is on a CPU or GPU.

It is compatible with

  • CuArrays.jl (see lib/cuarrays.jl)
  • Zygote.jl (see lib/zygote.jl)
StatsAPI.fitMethod
fit(DRE, x_nu, x_de, ranges; [optlib])

Perform hyperparameter tuning of density ratio estimator dre with numerator and denominator samples, x_nu and x_de and with hyperparameter ranges. Optionally, specify the optimization library optlib.

Notes

Hyperparameter tuning is not defined for all density ratio estimators. Therefore, this function may not work with some estimators.