Giter Site home page Giter Site logo

love's Introduction

LOVE

LOVE performs overlapping clustering of feature variables under a structured latent factor model.

Installation

You can install the development version from GitHub with:

install.packages("devtools")
devtools::install_github("bingx1990/LOVE")

Example

This is a basic example which shows you how to use the main function of LOVE. We start by generating a synthetic data set.

p <- 6
n <- 50
K <- 2
A <- rbind(c(1, 0), c(-1, 0), c(0, 1), c(0, 1), c(1/3, 2/3), c(1/2, -1/2))
Z <- matrix(rnorm(n * K, sd = 2), n, K)
E <- matrix(rnorm(n * p), n, p)
X <- Z %*% t(A) + E

The following code calls the LOVE function to perform overlapping clustering of the columns of the X matrix.

library(LOVE)

res_LOVE <- LOVE(X, pure_homo = FALSE)
res_LOVE <- LOVE(X, pure_homo = TRUE, delta = seq(0.1, 1.1 ,0.1))

Practical pre-screening

In practice, we recommend a pre-screening procedure before calling the LOVE function. The function Screen_X detects the features that are close to pure noise. The following example demonstrates the usage of Screen_X.

aug_A <- rbind(A, c(0, 0))
aug_p <- nrow(aug_A)
E <- matrix(rnorm(n * aug_p), n, aug_p)
X <- Z %*% t(aug_A) + E

noise_ind <- Screen_X(X)$noise_ind
cat("Features with indices in", noise_ind, "are detected as pure noise.\n")
#> Features with indices in 7 are detected as pure noise.
feature_ind <- setdiff(1:aug_p, noise_ind)

res_LOVE <- LOVE(X[,feature_ind,drop = F], pure_homo = FALSE)

love's People

Contributors

bingx1990 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.