knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

WTSNE

The goal of WTSNE is to ...

Installation

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("chenxuepu/WTSNE")

Example

This is a basic example which shows you how to solve a common problem:

library(WTSNE)
library(ggplot2)
library(MASS)
## basic example code
iris_uni <- unique(iris)
iris_lda <- MASS::lda(Species~.,iris_uni)
iris_p <- predict(iris_lda,iris_uni)$posterior
iris_p_max <- apply(iris_p,1,max)

good_fit <- (iris_p_max > quantile(iris_p_max,0.50))
weight <- ifelse(good_fit,2,1)
set.seed(123)
iris_tsne <- WTSNE(iris_uni[,1:4],weight=weight)
y <- as.data.frame(iris_tsne$Y)
y <- cbind(y,iris_uni$Species)
names(y) <- c("x","y","Species")
ggplot(y,aes(x=x,y=y,color = Species)) +
  geom_point()


chenxuepu/WTSNE-R documentation built on Dec. 31, 2020, 9:58 p.m.