Skip to content

densratio

Density Ratio Estimation

v0.3.1 · Apr 29, 2026 · MIT + file LICENSE

Description

Density ratio estimation. The estimated density ratio function can be used in many applications such as anomaly detection, change-point detection, covariate shift adaptation. The implemented methods are uLSIF (Hido et al. (2011) <doi:10.1007/s10115-010-0283-2>), RuLSIF (Yamada et al. (2011) <doi:10.1162/NECO_a_00442>), and KLIEP (Sugiyama et al. (2007) <doi:10.1007/s10463-008-0197-x>).

Downloads

CRAN

587

Last 30 days

6120th

1.7K

Last 90 days

5K

Last year

Trend: -7.6% (30d vs prior 30d)

r2u CRAN

0

Last 30 days

48

Last 90 days

132

Last year

Trend: -100% (30d vs prior 30d)

autoCRAN

3

Last 7 days

14

Last 30 days

0

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 9, 2026
NOTE 12 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 8, 2026
NOTE r-devel-linux-x86_64-debian-gcc

for unstated dependencies in vignettes

Error: inferior call failed
Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Code

Structure

Lines of code

951

Files

36

Compiled share

0%

Has compiled src

No

Language breakdown

R 412 (43.3%)Tests 127 (13.4%)Docs 174 (18.3%)Vignettes 238 (25%)

API

Exported functions

4

Internal functions

12

Recent export changes

v0.2.1+1 RuLSIF
v0.0.3+3 KLIEP, densratio, uLSIF

Testing & CI

Has tests

Yes

Test-to-code ratio

0.31

testthat edition

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

100%

\dontrun example ratio

0%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

Unsafe pattern score

0

Dep constraint coverage

0%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

System requirements

C++ standard

License

MIT + file LICENSE

License flags

SPDX valid, OSI approved

History

Versions

4

First release

2016-03-29

Latest release

2026-04-29

Avg cadence

1135 days

Cold removal rate

Dep drift

0

LOC over versions

v0.0.3: 642 LOCv0.1.1: 757 LOCv0.2.1: 882 LOCv0.3.1: 951 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Reverse Dependencies (4)

depends

imports

suggests

Dependency Network

Dependencies Reverse dependencies APPEstimation S4DM flexCausal DataSimilarity densratio

Version History

5 tracked
updated 0.3.1 ← 0.2.1 diff Apr 29, 2026
new 0.2.1 Mar 10, 2026
updated 0.2.1 ← 0.1.1 diff Jun 29, 2019
updated 0.1.1 ← 0.0.3 diff May 8, 2019
new 0.0.3 Mar 28, 2016