FAQ Database Discussion Community


Why does Sympy cut off polynomial terms with small coefficients?

python,sympy,polynomials,coefficients
I am trying to convert an expression containing terms with various degrees of a symbolic variable z_s into a polynomial in python using sympy.Poly() so that I can then extract the coefficients using .coeffs(). The expression I have is a high-order polynomial with independent, symbolic variable z_s. For some reason,...

obtain individual coefficent value from clogit in R

r,logistic-regression,survival-analysis,coefficients
Lets take the conditional logisitc regression example from the Survival Package And using the following commands library(survival) data(logan) resp <- levels(logan$occupation) n <- nrow(logan) indx <- rep(1:n, length(resp)) logan2 <- data.frame(logan[indx,], id = indx, tocc = factor(rep(resp, each=n))) logan2$case <- (logan2$occupation == logan2$tocc) B <- clogit(case ~ tocc + tocc:education...

Linking sklearn LogisticRegression coefficients to terms in a sparse matrix, and getting statistical significance / C.I

python,scikit-learn,logistic-regression,coefficients
This is a continuation of a question that started in another thread. I have run a logistic regression using sklearn using code similar to that below: from pandas import * from sklearn.feature_extraction.text import CountVectorizer from sklearn import linear_model vect= CountVectorizer(binary =True) a = read_table('text.tsv', sep='\t', index_col=False) X = vect.fit_transform(c['text'].values) logreg...

Constructiong a coefplot from a data frame

r,plot,ggplot2,coefficients
I would like to construct a coeffencient plot from a data frame, however I am runing into the following error. Error: $ operator is invalid for atomic vectors Is anyone able to help with this? Thanks Example code library(coefplot) model1 <- lm(price ~ carat + cut, data=diamonds) df <- coefplot:::buildModelCI(model1)...

Jaccard Coefficient

language-agnostic,metrics,coefficients
I have been given a formula to calculate the Jaccard Coefficient for two real vectors a and b of length n. Is this formula correct? If I calculate the coefficient for the vectors {5, 3, 1, 0, 3} and {7, 1, 3, 2, 1} I get a negative number which...