taddylab / textir Goto Github PK
View Code? Open in Web Editor NEWInverse regression analysis of text
Inverse regression analysis of text
I have a small matrix with one column containing long strings (1 string per row). If I pass only the one data frame column to tfidf, then I get the error rror in log(nrow(x)) : non-numeric argument to mathematical function
. If I pass the whole data frame, I get Error in base::rowSums(x, na.rm = na.rm, dims = dims, ...) : 'x' must be numeric
as well as two identical warnings: In Ops.factor(left, right) : โ>โ not meaningful for factors
. I would be very grateful for some insight on what kind of argument this function accepts. thanks!
Hi Matt,
I've been using mnlm for a new text dataset and the predictions don't seem to be working. Here's an example that produces the same error as in my data...
library(textir)
data(we8there)
exes<-we8thereCounts
covars<-we8thereRatings
cl <- makeCluster(detectCores(), type="FORK")
inverse.reg<-mnlm(counts=exes, covars=covars, cl=cl)
PP<-predict(inverse.reg, newdata=exes,type="response")
The error I get is just from this matrix multiplication in predict.dmrcoef:
eta <- t(tcrossprod(t(object[-1,,drop=FALSE]),newdata) + object[1,])
"Cholmod error 'A and B inner dimensions must match' at file ../MatrixOps/cholmod_ssmult.c, line 82"
It works fine with the Cushings and fgl example data, and I've tried monkeying around, but I can't figure out the general solution. Am I just using this wrong or is there a deeper issue?
Any help would be appreciated! I have a dataset that's just begging for a multinomial inverse regression, and the coefficients from the projection functions are already fascinating. But I want to validate the model out-of-sample and this particular error is holding me back.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.