laser.embedding.prcomp: First 300 principal components of LASER representations of...

laser.embedding.prcompR Documentation

First 300 principal components of LASER representations of tweets in labeled dataset

Description

prcomp object fitted to the LASER embedding representations of tweet texts contained in the training and validation data used to obtain the ensemble classifier distributed with the politicaltweets package

Usage

laser.embedding.prcomp

Format

A prcomp object, which is a list with the following elements:

sdev

standard deviations of the principal components

rotation

a matrix of variable loadings. Row names "e0001", ..., "e1024"; column names "PC1", ..., "PC300"

center

FALSE, since no centering applied

scale

FALSE, since no scaling applied

Examples

## Not run: 
 # create fake 'test' observation (1-row matrix)
 X <- matrix(
   rnorm(1024)
   , nrow = 1
   # column names must be "e0001", ..., "e1024"
   , dimnames = list(c("test"), sprintf("e%04d", 1:1024))
 )

 # use precomp predict method to obtain PCs
 predict(laser.embedding.prcomp, newdata = ndat)

## End(Not run)

haukelicht/politicaltweets documentation built on July 3, 2023, 4:11 a.m.