Questions tagged [regression]
Regression analysis is a collection of statistical techniques for modeling and predicting one or multiple variables based on other data.
9,556
questions
-1
votes
0
answers
7
views
Would it be better to have parallel or a shared regression network based on the same input data, and why?
I have several parallel regression networks combined into one model, where the outputs are combined to create a single loss function. The networks are looking for different aspects of the same data, ...
0
votes
0
answers
9
views
Parameterized Function for lcmm model
I want to write a function "lcga0" that does the same as "demomodel" parameterizing the dependent variable, because I want to run the model 2x for 2 different dependent variables. ...
0
votes
0
answers
14
views
How to compute GradCAM for keras regression model with multiple outputs
I have build a DenseNet121 that has 5 regression output layers.
The code to build the model looks like this:
base_model = DenseNet121(include_top=False, input_shape=(224, 224, 3), weights="...
0
votes
0
answers
28
views
How to filter a multi-index stock timeseries dataframe for regression
I'm really struggling with how to filter my dataframe to get ready for a regression analysis.
I have the multi-index dataframe "X_data" which contains all the independent/factor data for ...
0
votes
1
answer
32
views
MSE Value is way bigger than it should be
Any idea what I'm doing wrong here:
My data set is around 20k rows, and the mse is around 11298955095.811989, I'm not really sure what I'm doing wrong?
I'm trying to find which dataset, and which k ...
0
votes
1
answer
22
views
Use LogisticRegression to predict precipitation in sklearn
I have a dataset with some parameters about the weather. All features are numerical and also target is continuous. I want to predict the amount of precipitation. My features look like this (Year, ...
0
votes
0
answers
9
views
How to compute a poisson regression zero truncated and one inflated [migrated]
I'm working with data of trips per tour, with tours as various trips that a person makes consecutively. I'm trying to model this with count models. My dependent variable is Number of trips per tour, ...
-1
votes
0
answers
19
views
Feature selection for Regression
I am doing a school project in which I (1) look for correlation between teacher scores and algorithmically computed scores using computational linguistics (CL) features in creative writing, and (2) ...
0
votes
0
answers
27
views
Error in nls model: singular gradient matrix at initial parameter estimates. Cannot figure out appropriate start values [migrated]
I'm trying to implement equation 3 from this article research paper, for ease here's a screenshot of the equation:
Here's my code for it
taper_model = nls(d ~ (Is*((D^2)*(1+(((b2+(b3/D^3))*((1-(h/H)^...
0
votes
0
answers
22
views
PLS in Python from scratch - matrix dimension problem
I am attempting to write the code for PLS from scratch without using the scikit function. I obtain the following dimension problem that arises
from the coefficient computation ---> 56 self.coef_ = ...
0
votes
0
answers
47
views
TensorFlow.js MLP Regression Model output not returning as expected
I've created a MLP Regression Model with TensorFlow.js that takes as input a tensor like this:
tf.tensor2d([[1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 8]])
The Model was constructed this way:
function ...
0
votes
0
answers
8
views
How to predict %health percentage values for regression model
I am currently working on the a predictive maintenance dataset, that contains data from sensors, the occurrence of any errors and some characteristics of each machine. After feature engineering i have ...
0
votes
0
answers
30
views
How to resolve "Error in confusionMatrix.default(predictions, as.factor(valid$Item)) : The data must contain some levels that overlap the reference."
I have a gold jewelry dataset and I am trying to predict which Item will a customer buy using a multinomial logistic regression. Item has 4 categories: necklace, bracelet, earrings, ring.
Here's my ...
0
votes
0
answers
23
views
multiple linear regression and predict in r-studio?
load dataset marketing from library datarium
apply multiple linear regression and verify the hypotesis
Can the amounts spent on the different channels influence sales?
apply two other methods and ...
0
votes
0
answers
30
views
exporting multiple regression results in R
New R user here.
I have a bunch of regression models that can get quite big, and I'm trying to find some way to export the results into a latex table using stargarzer.
structure(list(country = ...
0
votes
0
answers
40
views
Legend not showing in ggplot graph
Help! Trying to plot a scatter plot, with a regression line, and a horizontal line marking a target level. Below is my code - I can't seem to figure out how to get the legend to show up.
ggplot(...
0
votes
1
answer
56
views
Issue in simple neural network
I tried below code in tensorflow with different variations for a simple regression problem. I have synthesized data as y=10.0*x. One input and one outcome variable. But tensorflow is giving me a loss ...
-4
votes
0
answers
23
views
MACHINE LEARNING ALGORITHM TO DETECT ERRORS IN BIM MODELS [closed]
I'm working on an a school project. I am trying to develop a machine learning algorithm to detect errors in BIM models. For now I have narrowed down to bicycle shelters. I have quite a few Bim models ...
0
votes
1
answer
29
views
RMSE of a multi-output regression model (using sklearn mean_squared_error)
I tried two ways in getting the RMSE of my multi-output regression model:
# method 1
mean_squared_error(y_test, y_pred, squared = False)
AND
# method 2
math.sqrt(mean_squared_error(y_test, y_pred))
...
0
votes
0
answers
8
views
Can I remove hand typed lagged variables when using dynlm?
I am running an ARDL time series regression and was wondering if I need to include hand-typed lagged variables in the regression formulas when I use the dynlm() function. When i add the lagged ...
0
votes
0
answers
43
views
Mixed effect model in python
Hi i have a certain task i want to solve:
i have this task:
For two months, participants played an app, in which they played 5 different
therapeutic games (TGs). At the beginning of each session, they ...
0
votes
0
answers
15
views
pinescript code for plotting linear regression line connecting swing highs does not plot lines for entire history but only for around 50 candles back
this is the code
check the title for question, copy and paste this code in pinescript to view the indicator and trendlines that are only plotting for upto 50 bars
please suggest how to correct the ...
-1
votes
1
answer
32
views
How to fix this issue with categorical variable in R?
I'm struggling with this issue in R.
I'm trying to run a regression. The first variable is a categorical variable, which I'll call DistanceGroup. Distance group has 4 different values - 0, 1, 2, 3. ...
1
vote
1
answer
58
views
How to get out-of-sample predictions for specific subgroups, in Stata?
I have a mixed effects logistic regression model:
quietly melogit y i.x1 i.x2 || x3:
Variable x1 is coded 0/1. I create the predicted probabilities for both values of x1:
margins x1
Then I obtain ...
0
votes
0
answers
23
views
How can I fit a harmonic regression to this circadian gene expression data?
I have spent several days trying to fit a single harmonic regression line to gene expression data (expressed as z-scores of logCPM) for 4 genes (ARNTL, PER3, HOXB5 and TSSK6) but either get no output ...
-2
votes
0
answers
25
views
Why nan values in Statsmodel regression sheet? [closed]
Cannot figure out. Please help.
There are 9 variables with nans across the table. What could be the problem?
All the columns are one hot encoded but there are other such columns that dont face such an ...
0
votes
0
answers
38
views
Regression discontinuity plot using ggplot with binned running variable (x-axis)
I wish to create a regression discontinuity plot using ggplot (I don't wish to use any other package) such that the points that show up on the plot should correspond to binned x-values, rather than ...
-2
votes
0
answers
15
views
How to Predict Climate forecasting model by custom coordinates list
I have the data of the climate projection model (CMIP5 monthly) https://cds.climate.copernicus.eu/cdsapp#!/dataset/projections-cmip5-monthly-single-levels
I want to put my list of coordinates into the ...
0
votes
0
answers
13
views
Auto clicker with Ui Regoniser
please I hope I can find someone help me as I'm not good in programming
all I want android app helps me to press or swipe random button appear on screen which I took screenshots of it so when the app ...
1
vote
0
answers
37
views
sklearn and statsmodels Poisson GLM yield different intercept & coefficient
I'm trying to reproduce the same Poisson GLM with sklearn and statsmodels. Unfortunately, that doesn't work. I get different intercepts/coefficents for the two implementations with the same parameters....
1
vote
1
answer
31
views
"Full rank" error when estimating OLS with statsmodel
I have historical data for crop yield, annual temperature and annual precipitation for a given region. My goal is to estimate the following linear model:
In which y is the crop annual yield, t ...
0
votes
0
answers
26
views
Regression Analysis w/ Dummy Variables in Tableau
The dataset I am working with is an automotive dataset with different vehicle sales. My assignment is to do a regression analysis on the dataset using Tableau. I wanted to do a regression analysis of ...
1
vote
0
answers
21
views
Why do "segmented" and "selgmented" functions in the package "segmented" give different outputs?
I am using the selgmented function in the segmented package to select the number of breakpoints in a time-series regression. This function behaves as expected and provides a segmented object. However, ...
0
votes
1
answer
32
views
How do I build a layer, so a tensor of dynamic shape is transformed into a fixed size in PyTorch?
I am trying to build a PyTorch module based on dynamic dimension sizes.
import torch
from random import randint
from torch.nn import Linear, BatchNorm1d, ReLU, Dropout, Sequential
batch_size = 2
...
-3
votes
0
answers
37
views
bruesch pagan test for "single" time series [closed]
I'm trying to check heteroskedasticity in a "SINGLE" time series. I am modelling through ARIMA (1,0,0) and as im checking for heteroskedasticity by bptest() by 2 codes as below, the errors ...
0
votes
0
answers
22
views
How do you do a rolling window regression (with panel data) to get time-variant firm betas in R?
I have the following dataset of monthly returns of 25 portfolios (the columns) and the market excess returns for corresponding months. I need to get the betas of each of those 25 portfolios but using ...
0
votes
0
answers
19
views
implementing keras version of quantile loss for regression
I am trying to implement Quantile loss for a regression problem based on the formula from this article (number 14 at the end of the article):
Here is my implementation:
import numpy as np
def ...
0
votes
0
answers
17
views
Polynomialize dataset for selected columns of pd.Dataframe
I am new to regression concepts. I have a dataset which has a text column
I am using CatboostRegressor to regress the transaction time based on the other 3 features
Ticket text
Created Hour (Between ...
0
votes
0
answers
7
views
Running exponential decay model in R
Concentration<-c(6.2,6.1,5,4.9,3.7,3.8,3.8,3.9,3.6,3.5,3.9,3.6)
Distance<-c(5,5,15,15,25,25,32,32,42,42,55,55)
b0start <- max(Concentration)
b1start <- -log(1/b0start)
b2start <- (max(...
0
votes
0
answers
12
views
High t statistic with high p value for same variable? [migrated]
I am trying to do a difference in difference model to compare two cities' police departments' uses of force after treatment from a consent decree. When I run the model with clustered standard errors, ...
0
votes
0
answers
60
views
Decomposing a regression in Stata
clear all
set obs 5000
gen studentid = _n
gen teacherid = ceil(_n / (500 / 20))
gen female = cond(runiform() < 0.53, 0,1)
gen testscore = round(rnormal(50, 15))
replace testscore = max(0, min(100, ...
0
votes
0
answers
19
views
How to group Stata coefplot (recast as bar) bars together by dependent variable?
I am trying to make a plot in Stata that examines the probit regression for 7 dependent variables (each observation having a value of 0 or 1) based on a single categorical variable.
My code is quite ...
0
votes
1
answer
21
views
How to update weights of a base Keras PointNet model? [duplicate]
I trained a PointNet regression model and then saved it's weights by
model.save_weights('/home/rev9ai/aleef/Dainsta/model/beta_v0.weights.ckpt')
The saved files were
beta_v0.weights.ckpt.data-00000-...
0
votes
1
answer
25
views
R: Stargazer outputs html code and does not generate a table [duplicate]
I have a problem with stargazer().
I want to regress y on log_GDP and show the result in atable by using stargazer().
The code below only outputs html code and does not generate a table.
I also tried ...
0
votes
0
answers
18
views
Gaussian Process Gradient when X_training is given by N X D dataset
I am trying to compute the gradient of a Gaussian Process when the training data set is given by N X D in MATLAB. Where N is the number of data and D is the number of columns. The Python code for ...
0
votes
1
answer
48
views
Running setup works in jupyter lab but not in vscode debug environment, although using same python path
I am running this code in my jupyterlab and in vscode, it works in jupyterlab but does not in vscode. The error appears in the setup function of pycaret. This is my code:
from pycaret.regression(.oop) ...
0
votes
0
answers
38
views
Obtaining standardized coefficients after multiple imputation with MICE in R
I ran multiple imputations to deal with my missing data. Then I used the with() and pool() functions to run a linear regression for my dataset and get a pooled estimate. I am trying to predict a score ...
0
votes
0
answers
17
views
Cobalt and MatchThem: Post Imputation analysis
I am using propensity score matching with multiple imputation via MatchThem and Cobalt to perform the balancing functions. In my discipline, in psm studies, it is customary to provide a table that has ...
0
votes
0
answers
27
views
SciPy ODR: How to specify bounds for my variables?
I'm using scipy.ODR to fit a nonlinear function to my data. While the overall fit looks reasonable, I find that occasionally one of my fitted variables becomes unphysically large. Is there a way that ...
0
votes
0
answers
6
views
Time Series dataset preparation
I am a bit confused with the time series dataset preparation. From the internet, I saw all examples which used tree-based models, had input features and target defined as:
X = df.drop(['target'], axis=...