Coder Social home page Coder Social logo

sparsepkl's Introduction

sparsePKL - Sparse Pairwise Kernel Learning Software

sparsePKL is a pairwise kernel learning algorithm based on nonsmooth DC (difference of two convex functions) optimization. It learns sparse models for predicting in pairwise data (e.g. drug-target interactions) by using double regularization with both L1-norm and L0-pseudonorm. The nonsmooth DC optimization problem is solved using the limited memory bundle DC algorithm (LMB-DCA). In addition, sparsePKL uses pairwise Kronecker product kernels computed via generalized vec-trick to model interactions between drug and target features. The included loss-functions for the pairwise kernel problem are:

  • squared loss,
  • squared epsilon-insensitive loss,
  • epsilon-insensitive squared loss,
  • epsilon-insensitive absolute loss,
  • absolute loss.

Files included

  • sparsepkl.py

    • Main python file. Includes RLScore calls.
  • pkl_utility.py

    • Python utility programs.
  • sparsepkl.f95

    • Main Fortran file for sparsePKL software.
  • lmbdca.f95

    • LMB-DCA - the limited memory bundle DC algorithm.
  • solvedca.f95

    • Limited memory bundle method for solving convex DCA-type of problems.
  • objfun.f95

    • Computation of the function and subgradients values with different loss functions. Selection between loss functions is made in sparsepkl.py
  • initpkl.f95

    • Initialization of parameters and variables in sparsePKL and LMB-DCA. Includes modules:
      • initpkl - Initialization of parameters for pairwise learning.
      • initlmbdca - Initialization of LMB-DCA.
  • parameters.f95

    • Parameters for Fortran. Inludes modules:
      • r_precision - Precision for reals,
      • param - Parameters,
      • exe_time - Execution time.
  • subpro.f95

    • subprograms for LMB-DCA and LMBM.
  • data.py

    • Contains functions to load the example data sets. Data files are assumed to be in a folder "data" that is not part of the current folder.
    • Contains functions to create train-test-validation splits. Splits are created for every experimental setting S1-S4 (see the reference below).
  • Makefile

    • makefile: builds a shared library to allow sparsepkl (Fortran95 code) to be called from Python. Uses f2py, Python3.7, and requires a Fortran compiler (gfortran) to be installed.

Installation and usage

The source uses f2py and Python3.7, and requires a Fortran compiler (gfortran by default) and the RLScore to be installed.

To use the code:

  1. Select the data, loss function, and the desired sparsity level from sparsepkl.py file.
  2. Run Makefile (by typing "make") to build a shared library that allows sparsepkl (Fortran95 code) to be called from Python.
  3. Finally, just type "python3.7 sparsepkl.py".

The algorithm returns a csv-file with performance measures (C-index and MSE) computed in the test set under different experimental settings S1-S4. The best results are selected using a separate validation set and validated w.r.t. C-index. In addition, separate csv-files with predictions under different experimental settings S1-S4 are returned.

References:

Acknowledgements

The work was financially supported by the Research Council of Finland projects (Project No. #345804 and #345805) led by Antti Airola and Tapio Pahikkala.

sparsepkl's People

Contributors

napsu avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.