linear-regression

What is causing this error? Coefficients not defined because of singularities

♀尐吖头ヾ 提交于 2021-01-27 03:53:47
问题 I'm trying to find a model for my data but I get the message "Coefficients: (3 not defined because of singularities)" These occur for winter, large and high_flow I found this: https://stats.stackexchange.com/questions/13465/how-to-deal-with-an-error-such-as-coefficients-14-not-defined-because-of-singu which said it may be incorrect dummy variables, but I've checked that none of my columns are duplicates. when I use the function alias() I get: Model : S ~ A + B + C + D + E + F + G + spring +

What is causing this error? Coefficients not defined because of singularities

我只是一个虾纸丫 提交于 2021-01-27 03:52:42
问题 I'm trying to find a model for my data but I get the message "Coefficients: (3 not defined because of singularities)" These occur for winter, large and high_flow I found this: https://stats.stackexchange.com/questions/13465/how-to-deal-with-an-error-such-as-coefficients-14-not-defined-because-of-singu which said it may be incorrect dummy variables, but I've checked that none of my columns are duplicates. when I use the function alias() I get: Model : S ~ A + B + C + D + E + F + G + spring +

ggplot2: how to get values for the regression line equation, r^2 and p value?

怎甘沉沦 提交于 2021-01-15 18:54:23
问题 I cant work out how to get the regression line equation, r^2 and p value of the linear regression I have plotted using the function geom_smooth. This is my code: g <- ggplot(data=data.male, aes(x=mid_year, y=mean_tc, colour=data.male$survey_type)) g <- g + geom_point(shape = 20, size =2) g <- g + geom_smooth(method=lm, na.rm = FALSE, se = TRUE, aes(group=1), colour = "black") g <- g + theme_gray(base_size=24) g <- g+ xlab("Year") g <- g + ylab("Mean serum total cholesterol (mmol/L)") g <- g +

ggplot2: how to get values for the regression line equation, r^2 and p value?

萝らか妹 提交于 2021-01-15 18:52:47
问题 I cant work out how to get the regression line equation, r^2 and p value of the linear regression I have plotted using the function geom_smooth. This is my code: g <- ggplot(data=data.male, aes(x=mid_year, y=mean_tc, colour=data.male$survey_type)) g <- g + geom_point(shape = 20, size =2) g <- g + geom_smooth(method=lm, na.rm = FALSE, se = TRUE, aes(group=1), colour = "black") g <- g + theme_gray(base_size=24) g <- g+ xlab("Year") g <- g + ylab("Mean serum total cholesterol (mmol/L)") g <- g +

Loss: NaN in Keras while performing regression

天大地大妈咪最大 提交于 2021-01-05 11:34:32
问题 I am trying to predict a continuous value (using a Neural Network for the first time). I have normalized the input data. I can't figure out why I am getting a loss: nan output starting with the first epoch. I read and tried many suggestions from previous answers to the same question but that none of them helped me. My training data shape is: (201917, 64) . Here's my code: model = Sequential() model.add(Dense(100, input_dim=X.shape[1], activation='relu')) model.add(Dense(100, activation='relu'

Filling NA using linear regression in R

会有一股神秘感。 提交于 2020-12-30 04:12:58
问题 I have a data with one time column and 2 variables.(example below) df <- structure(list(time = c(15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26), var1 = c(20.4, 31.5, NA, 53.7, 64.8, NA, NA, NA, NA, 120.3, NA, 142.5), var2 = c(30.6, 47.25, 63.9, 80.55, 97.2, 113.85, 130.5, 147.15, 163.8, 180.45, 197.1, 213.75)), .Names = c("time", "var1", "var2"), row.names = c(NA, -12L), class = c("tbl_df", "tbl", "data.frame")) The var1 has few NA and I want to fill the NA with linear regression between

Python scikit learn Linear Model Parameter Standard Error

跟風遠走 提交于 2020-12-02 05:37:49
问题 I am working with sklearn and specifically the linear_model module. After fitting a simple linear as in import pandas as pd import numpy as np from sklearn import linear_model randn = np.random.randn X = pd.DataFrame(randn(10,3), columns=['X1','X2','X3']) y = pd.DataFrame(randn(10,1), columns=['Y']) model = linear_model.LinearRegression() model.fit(X=X, y=y) I see how I can access to coefficients and intercept via coef_ and intercept_, prediction is straightforward as well. I would like to

ValueError: continuous is not supported

余生颓废 提交于 2020-11-29 03:37:05
问题 I am using GridSearchCV for cross validation of a linear regression (not a classifier nor a logistic regression). I also use StandardScaler for normalization of X My dataframe has 17 features (X) and 5 targets (y) (observations). Around 1150 rows I keep getting ValueError: continuous is not supported error message and ran out of options. here is some code (assume all imports are done properly): soilM = pd.read_csv('C:/training.csv', index_col=0) soilM = getDummiedSoilDepth(soilM) #transform