Skip to content
/ pykliep Public

A density ratio estimator package for python using the KLIEP algorithm.

License

Notifications You must be signed in to change notification settings

srome/pykliep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pykliep

A density ratio estimator package for python using the KLIEP algorithm.

The DensityRatioEstimator class implements the Kullback-Leibler Importance Estimation Procedure by Sugiyama et al. Estimator uses likelihood cross validation (LCV) to tune the num_params and sigma parameters.

Usage

from pykliep import DensityRatioEstimator 

kliep = DensityRatioEstimator()
kliep.fit(X_train, X_test) # keyword arguments are X_train and X_test
weights = kliep.predict(X_train)

rf = RandomForestRegressor()
rf.fit(X_train, y_train, sample_weight=weights) # Train using the sample weights!

About

A density ratio estimator package for python using the KLIEP algorithm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages