Questions tagged [linear-regression]

Techniques for analyzing the relationship between one (or more) "dependent" variables and "independent" variables.

Filter by
Sorted by
Tagged with
0
votes
0answers
25 views

Value Error: Specifying the columns using strings is only supported for pandas Data Frames

I have built a basic Linear Regression model on the Boston house price data set and deployed it using flask. Now when I go to the home page where I have to enter the values of features and click on ...
0
votes
0answers
36 views

Getting error in Visualizing data in ggplot(2) while using Linear Regression Model

I am creating a linear regression model with salary vs years of experience using R. While visualizing the result, it is showing the error: ...
0
votes
1answer
12 views

ValueError: Found input variables with inconsistent numbers of samples: [40, 10]

x_train with shape (40, 6) is as below ...
0
votes
1answer
10 views

Gradient descent different implementation cause error

We know that we can get closer to the local minimum of the function by descending our argument according to that rule $$w1 = w0 − γ∇f$$ For example I have a linear regression model that depends on $b,...
1
vote
2answers
40 views

How do I decide on my X and Y variables for the prediction of a coin toss?

So I'm new to data science and was trying to solve a few problems that my mentor gave to me. I came across this question where there are multiple coin tosses and ten of them are recorded. I am ...
0
votes
0answers
12 views

prove E[(TSS - RSS)/p] > $\sigma^2$ in multiple linear regression

In Intro to statistical learning, Chapter-3 for Linear Regression, in the subsection 3.2.2 , Unit "One: Is There a Relationship Between the Response and Predictors?" , it is mentioned that: ...
0
votes
0answers
24 views

Linear regression to find differences between model performances

For one of my projects I needed to create classification models for each of many products. In order to see which classifier performs best, I created one SVM, RandomForest and Naive Bayes model for ...
0
votes
0answers
11 views

predicting average time with regression

I have a trip duration dataset that looks like this: I want to use other parameters to predict the waiting time (wait_sec). The waiting time refers to the time the vehicle is stuck in traffic or so. ...
0
votes
1answer
24 views

Why is linear regression not doing worse with a low weighted attribute?

I've been able to build a few linear regression models that can predict a material strength quite well: minimum RMSE of 17.95 using 11 attributes that I have selected from 159 original attributes. The ...
0
votes
0answers
11 views

Linear models: Imputing missing not at random

This question is a continuation of a similar question for linear models instead of Tree-based model. Given that linear models (e.g. lasso, ridge, Linear regression, elastic net, etc.) can't handle ...
1
vote
2answers
55 views

Is it usual for Scikit learn's standard scaler to cause non-invertibility?

For example, I am trying to perform linear regression on the following set of data Data examples: $X = [[1, 20], [3, 40], [5, 60]]$ (each row is an example, there are three examples, each with a ...
0
votes
2answers
45 views

Definition of linear model

I am new to machine learning and am a bit confused about the definition of a linear model. I've searched many sources and the most common definition is: The term linear model implies that the model ...
1
vote
0answers
19 views

Statistical significance of SVD least squares

I was not able to find any info on how least squares using singular value decomposition should be statistically evaluated. I have a dataset for which I did both multivariate regression and regression ...
0
votes
0answers
20 views

Best approach for univariate time series predictions?

I have a univariate time series. where I'm trying to predict a current value of a variable based on the previous 10 values of the same variable. I tried three approaches: 1- linear regression where I ...
1
vote
0answers
9 views

Does anyone know of literature regarding a Neural Net boosted GBM?

For obvious reasons, most GBMs created in the private sector are tree boosted. Occasionally, one might want a linear boosted GBM so that the residual models collapse into a simple linear combination. ...
1
vote
1answer
42 views

Extremely negative r^2

I use a linear regression to predict house prices (https://www.kaggle.com/c/house-prices-advanced-regression-techniques/overview). My linear regression sometimes works great with R^2 of 0.8 and ...
1
vote
1answer
15 views

Creating radial basis for linear regression Python

I'm trying to do time series forecasting with linear regression like it's done in this video: Radial basis forecasting starting from 5:50. I understand the basic idea of basis, but I don't think I ...
2
votes
1answer
59 views

is SST=SSE+SSR only in the context of linear regression?

the problem of regression is to minimize the sum of squared errors, i.e. $\sum\limits_{i=1}^n (y_i - \hat{y}_i)^2 = 0$ . But only in linear regression could you use the expression $\hat{y}_i = \beta_0 ...
1
vote
0answers
31 views

I have a data set of optimal values after simulations, How can I find if this dataset follows a specific pattern or any relation exists?

In the simulation I am conducting, I have a set of triangles and I select the optimal triangle based on my metric. After every simulation, I obtain an optimal triangle and I note down the lengths of ...
1
vote
0answers
21 views

Linear regression on sparse matrix?

I have a matrix with sparse data. A small extract from it is seen below. The columns represent years and the rows represent different race tracks. The feature values are velocities on that specific ...
1
vote
2answers
49 views

ideal algorithms to demonstrate overfitting or underfitting

When one tries to look up concepts such as overfitting and underfitting, the most common thing that pops up is polynomial regression. Why is polynomial regression often used to demonstrate these ...
0
votes
0answers
8 views

Downward trend in the residuals vs fit plot with constant variance interpretation?

I have build a regression model where the residual vs fit plot indicates a downward trend with a constant variance. I am having trouble interpreting and understand the problem at hand. Below is the ...
0
votes
0answers
23 views

How can I use transfer learning to predict height given age in Japan, using a model developed with USA data?

Suppose I have a (training) set of $n$ observation $\{(Y_i^{(U)},X_i^{(U)})\}_{i=1}^n$ of age $X_i^{(U)}$ and height $Y_i^{(U)}$ from people in the USA. Now suppose I also have a (test) set of $m$ ...
1
vote
0answers
75 views

Linear Regression error - InvalidArgumentError: assertion failed: [Labels must be <= n_classes - 1] [Condition x <= y did not hold element-wise:] [closed]

I am doing a linear regression model in TensorFlow. I have applied the code I saw on a course with my own dataset but I am getting an error I don't understand: This is a link to the Google ...
0
votes
0answers
18 views

Why is my training score below my testing score?

I'm learning data science, and currently practicing with the Titanic Dataset. I'm doing a simple logistic regression using scikit-learn, and plotting the learning curves of that model with Matplotlib: ...
2
votes
1answer
31 views

How to fit a KNN and then a linear regression with those neighbors?

How do I fit a KNN to get the $k$ nearest neighbors and then aggregate the those neighbors into a fit using a linear regression (instead of a weighted average) in Scikit-Learn? I've tried creating a ...
4
votes
1answer
94 views

Linear Regression bad results after log transformation

I have a dataset that has the following columns: The variable I'm trying to predict is "rent". My dataset looks a lot similar to what happens in this notebook. I tried to normalize the rent ...
0
votes
0answers
8 views

Gaussian Mixture Classification Implementation with multidimensional trainning data

I'm trying to implement the gaussian mixture classification (GMC) implementation from scratch using python. The training dataset consists of 10 folds each of size $\left[100x64\right]$. In addition, ...
3
votes
2answers
33 views

Good approach to increase accuracy for a continuous value that is highly variable/sensitive to the inputs?

I am trying to predict a continuous 'Y' variable using a variety of algorithms and feature engineering techniques. My issue is that Y is extremely variable and I reached a asymptote in accuracy. This ...
0
votes
2answers
25 views

What's the intuition behind nonlinear predictors in multivariate regression?

I'm learning statistical learning with the well known ISLR (Introduction to Statistical Learning with Applications in R) and doing the exercises, right now in the linear chapter regression. Despite ...
1
vote
2answers
44 views

Does Homoscedasticity applies only for linear regression models?

In statistics, a sequence of random variables is homoscedastic if all its random variables have the same finite variance. This is also known as homogeneity of variance (Wikipedia). Is this assumption ...
0
votes
0answers
20 views
1
vote
2answers
33 views

Linear Regression with Category variables

I'm currently learning and exploring machine learning and understand the basics of linear regression based on two numerical variables, but now I wish to go a little further and need some guidance ...
0
votes
1answer
29 views

Using Linear Regression to Learn Polynomial Regression

Let's start by considering one-dimensional data, i.e., $d=1$. In OLS regression, we would learn the function $$ f(x)=w_{0}+w_{1} x, $$ where $x$ is the data point and $\mathbf{w}=\left(w_{0}, w_{1}\...
0
votes
1answer
35 views

Why not using linear regression for finetuning the last layer of a neural network?

In transfer learning, often only the last layer of the network is retrained using gradient descent. However, the last layer of a common neural network performs only a linear transformation, so why do ...
0
votes
1answer
24 views

Regression and Classification, which is better in financial market price prediction?

I want to use a model to trade in finanical market. which i have several features, like macd, rsi, or other common features. and my target is to make a tradeable predict in every time point. so my ...
0
votes
0answers
17 views

Is it a good idea to use the mean and standard deviation of coefficients from other models as my prior in Bayesian Regression?

I have a dataset that I’ve been playing around with for school I have gotten very good results with a bunch of methods (Ridge, Lasso, ElasticNet, SVM, Bagging, Stacking and NN even) Now I’m having a ...
0
votes
1answer
26 views

Why is shuffling timeseries a bad thing?

I'm trying to understand precisely why it is a bad idea to shuffle time-series when splitting train and test data. Like, what is false about shuffling time-series? How does it tamper with the model?
1
vote
0answers
39 views

How to maximize a log linear regression equation satisfying a constraint?

I have a log linear equation of the form $y = w_1(\log{X1}) + w_2(\log{X2}) + ... + w_n(\log{Xn})$. How can I find the value of X's that maximize the value of y subject to a constraint $(X_1+X_2+...+...
1
vote
1answer
31 views

Mathematical bias and weight vs machine learning bias and weight

I am a little confused about the term Bias and Weight with respect to machine learning. Say we want to predict the heights of people whose weights are given. So plot weights to x-axis and height to ...
0
votes
1answer
52 views

unable to predict by LinearRegression

Should I add csv as text in SO question? There's lot more data. ...
1
vote
0answers
20 views

How to generate data for future price predictions with Linear regression and Python

I have written the following Python code that makes predictions using linear regression model. However, I'll appreciate you pointing out what went wrong with how I generated data['X_forecast']. I'm ...
0
votes
0answers
14 views

Theano error when performing Linear Regression

I'm trying to perform Linear Regression using Theano, but there is something I might be missing or doing wrong because I receive an error message, here you have a reproducible example: ...
1
vote
1answer
29 views

Has anyone heard of a model similar to a random forest which fits a linear regression model in its leaf nodes?

That is, each leaf node in each decision tree learns a linear model. Anyone heard of this kind of model? Even better, anyone know of implementations?
0
votes
0answers
123 views

sklearn gridsearch lasso regression: find specific number of coefficients

I am using GridSearchCV and Lasso regression in order to fit a dataset composed out of Gaussians. I keep this example similar to this tutorial. My goal is to find the best solution with a restricted ...
0
votes
1answer
29 views

How does the equation “dW = - (2 * (X^T ).dot(Y - Y_hat)) / m” comes in Linear Regression (using Matrix + Gradient Descent)?

I was trying to code the Linear Regression in Python using Matrix Multiplication method using Gradient Descent and followed a code where there was no mention what is the loss but just a code as Per ...
0
votes
1answer
36 views

LinearRegression with fixed slope parameter

I have some data $(x_{1},y_{1}), (x_{2},y_{2}), ..., (x_{n},y_{n})$, where both $x$ and $y$ represent real numbers (float). I want use Scikit-learns LinearRegression model to fit a model of the form: $...
2
votes
0answers
25 views

How to process categorical variable having lots of unique values in linear regression?

I have House Price dataset and I am using linear regression to predict the house price. while data preprocessing I found a variable called "Location" and it have around 342 unique value. For ...
0
votes
2answers
58 views

Selecting most important features for multilinear regression

I have a set of 25 features. I would like to choose the best features for my model. Originally, I was looking at the correlation of features with respect to response, and only taking those which are ...
0
votes
0answers
16 views

Regression for prediction: is there any benefit of regularization?

What is the benefit of having flatter regression line in linear regression? Is there a proven benefit for prediction? Are there experiments that show regression with regularization performs better on ...

1
2 3 4 5
13