# Questions tagged [linear-regression]

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

625 questions
Filter by
Sorted by
Tagged with
20 views

### What is the best model for predicting delays?

Supposing we need to predict delays based on a previous dataset that contains the history of several, lets say, providers and their delivery delays. The goal is to minimize the loss due to those ...
3 views

### Multicollinearity vs Perfect multicollinearity for Linear regression

I have been trying to understand how multicollinearity within the independent variables would affect the Linear regression model. Wikipedia page suggests that only when there is a "perfect" ...
14 views

### Does PCA helps to include all the variables even if there is high collinearity among variables?

I have a dataset that has high collinearity among variables. When I created the linear regression model, I could not include more than five variables ( I eliminated the feature whenever VIF>5). But ...
813 views

### Correlation vs Multicollinearity

I have been taught to check correlation matrix before going for any algorithm. I have a few questions around the same: Pearson Correlation is for numerical variables only. What if we have to check ...
24 views

### Why there is a marked difference in metric scores using linear regression or MLP as readout for echo state network?

I am using a reservoir computing architecture comprising of an echo state network as per the paper Reservoir Computing Approaches for Representation and Classification of Multivariate Time Series ...
691 views

### Linear regression : ValueError: operands could not be broadcast together with shapes (3,) (1338,)

I try to use linear regression for insurance data . But had error on the when try to call a function with features parameter. Here is my code: ...
254 views

### Target Variable Encoding for Time Series Change point detection

I am working on a time series data for which I intend to impliment machine learning model for detecting change point in time series data. This data is recorded fom machinary and we have to predict ...
4 views

### Loss function for normal distribution regression problem

My project involves training an input of random uniformly distributed data using regression (this is my approach) to output random normally distributed data. The issue with formulating the problem is ...
693 views

### Gradient descent formula implementation in python

So I recently started with Andrew Ng's ML Course and this is the formula that Andrew lays out for calculating gradient descent on a linear model.  \theta_j = \theta_j - \alpha \frac{1}{m} \sum_{i=1}...
38 views

### What's the correct cost function for Linear Regression

As we all know the cost function for linear regression is: Where as when we use Ridge Regression we simply add lambda*slope**2 but there I always seee the below as cost function of linear Regression ...
23 views

### AI algorithm model that outputs a list of unknown length [closed]

I have a dataset with the following x columns: date time is_weekend is_holiday start_intersection end_intersection The output is a list of intersections, that connect start_intersection with ...
13 views

### data analysis leads to linear regression model: how to proceed with prognosis?

Data analysis of a large dataset of project management data together with working hours led me to a surprisingly simple linear model over the key milestones of all projects. Now I am a bit at loss on ...
106 views

### Regularization for intercept parameter

Why is the regularization parameter not applied to the intercept parameter? From what I have read about the cost functions for Linear and Logistic regression, the regularization parameter (λ) is ...
17 views

38 views

### Does gradient descent always find global minimum for specific regression type?

From my understanding, linear regression is used for predicting an output based on an input using a linear equation that is optimally fitted to some input data. We choose the best fitted linear ...
35 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 ...
68 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 ...
125 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 ...
26 views

### Multiple Linear Regression for House Price Prediction score is 0.28 [closed]

I am trying to make predictions using this dataset What I have done so far: Dropped the Administrative column Encoded the categorical data using ...
21 views

### One predictor variable and 3 response variable (categorical and continuous) [closed]

If I have predictor variables which are a mixture of continuous and categorical, and a response variable that is continuous. What approach should I apply? Linear regression, logistic regression or k ...
1k views

### How to combine nlp and numeric data for a linear regression problem

I'm very new to data science (this is my hello world project), and I have a data set made up of a combination of review text and numerical data such as number of tables. There is also a column for ...
34 views

### Relationships between groups of features against independent variables

I have several groups of features that I'd like to test against independent variables. The idea is to find which groups tend to be associated with a specific value of an independent variable. Let's ...
23 views

### The effect of the λ in the Ridge regression

Why by increasing value of λ in Ridge estimator the slope of the line is decreasing? How exactly λ affects to the y = kx + b?
35k views

### How to force weights to be non-negative in Linear regression

I am using a standard linear regression using scikit-learn in python. However, I would like to force the weights to be all non-negative for every feature. is there any way I can accomplish that? I was ...
10 views

### Error while calculating accuracy and matrix multiplication in tensor flow code for regression [closed]

I was writing a code for linear regression using tensor flow but I was getting errors while calculating matrix multiplication using tensor flow and while calculating accuracy. ...
14 views

### Can I retrain my best model on all available data? [duplicate]

I split data on Zillow single-unit properties into train-validation-test 70-15-15 and trained a few different sklearn linear models to predict selling price. I chose the best one based on validation ...
15 views

### Group points to reduce data set such that the linear regression stays the same

I have a very long dataset and I'm trying to reduce it by grouping the data in periods of 24 hours. In this way, there will be a single data point that represents that day, but they must yield the ...
4k views

### Regression for discrete values?

I am a novice in machine learning/statistical algorithms, but I have worked with some simple classifiers and regression. I would like some opinions on whether I am going the right direction or not, ...
63 views

### Multiple regression (using machine learning - how plot data)

I wonder how I can use machine learning to plot multiple linear regression in a figure. I have one independent variable (prices of apartments) and five independent (floor, builtyear, roomnumber, ...
56 views

### How do I correctly build model on given data to predict target parameter?

I have some dataset which contains different paramteres and data.head() looks like this Applied some preprocessing and performed Feature ranking - ...
7 views

### cost function diverging in batch gradient descent

I am trying to implement the gradient descent method in python. I would like the calculation to stop when abs(J-J_new) reaches a certain tolerance level (i.e. it ...
446 views

...
83 views

### How to find lagged cross correlation between time series?

I have 2 time series, $X$ and $Y$, and I'm trying to find the best lag range that correlates $X$ to $Y$ (find the amount(s) of lag of $X$ that best correlate to the target variable $Y$). For instance, ...
839 views

### normalization/denormalization for linear regression problem

My question is simple actually, I have two features that have big difference in scale. So I used a simple normalization by dividing the scale=np.max(array) for both data and lables. Then after ...
86 views

### Confidence intervals in multivariate linear regression

I am fitting my data to a multivariate linear regression $Y = BX + \Xi$, where the response is bivariate $Y\in R^{n\times 2}$, and the predictor is uni-variate but elevated to the projective plane to ...
49 views

17 views

### Sudden jumps in accuracy with logistic regression and bag of words : "glm.fit: algorithm did not converge"

I work on a bag of words, on the Toxic Comments Classifications challenge. The challenge is closed but the dataset is very nice to learn. I use R, tf-idf, tm, and logistic regression. I have a strange ...