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
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 ...
0
votes
0answers
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" ...
2
votes
1answer
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 ...
4
votes
3answers
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 ...
2
votes
0answers
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 ...
2
votes
1answer
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: ...
2
votes
1answer
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 ...
0
votes
0answers
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 ...
1
vote
2answers
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}...
1
vote
1answer
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 ...
1
vote
0answers
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 ...
0
votes
0answers
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 ...
2
votes
1answer
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 ...
1
vote
0answers
17 views

Does the appliance of R-squared to non-linear models depends on how we calculate it?

Does the appliance of R-squared to non-linear models depends on how we calculate it? $R^2 = \frac{SS_{exp}}{SS_{tot}}$ is going to be an inadequate measure for non-linear models since an increase of $...
0
votes
1answer
62 views

I am getting very minimal mse values and not sure if it is correct?

Below is the linear regression model I fitted and not sure if I am doing the right way as I am getting neat to 99% accuracy Fitting Simple Linear Regression to the Training set ...
1
vote
0answers
19 views

Implementation of a perceptron

I want to implement a single perceptron for linear regression using the following formulas: the input data for the first case is one column (x(392, 1); y(392, 1)) and for the second case is (x(392, 7)...
0
votes
0answers
20 views

average of two models with training set N/2 vs one model with training set N

I'm new to ML and I got a question about training model. Imagine linear regression $Y=\beta^TX+ \epsilon$ and we have training set D (size=N). I have two options: Train model use whole D and we get $\...
2
votes
1answer
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 ...
2
votes
1answer
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 ...
0
votes
1answer
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 ...
4
votes
1answer
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 ...
1
vote
2answers
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 ...
1
vote
1answer
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 ...
1
vote
1answer
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 ...
1
vote
1answer
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 ...
1
vote
1answer
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?
43
votes
5answers
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 ...
1
vote
0answers
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. ...
0
votes
0answers
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 ...
1
vote
0answers
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 ...
3
votes
2answers
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, ...
1
vote
1answer
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, ...
1
vote
2answers
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 - ...
0
votes
0answers
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 ...
4
votes
1answer
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, ...
3
votes
2answers
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 ...
2
votes
2answers
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 ...
2
votes
1answer
49 views

Adding high p-value and low R square features in linear regression model to improve result

I am working on a linear regression problem. The features for my analysis have been selected using p-values and domain knowledge. After selecting these features, the performance of $R^2$ and the $...
1
vote
1answer
17 views

Approximating weight of individual items from sum of their weight

Problem I have a list of orders, approximation of their total weight and list of items they contain. I need to determine approximate weight of individual items. In other words, I have a few thousand ...
1
vote
0answers
19 views

Linear regression of times series data with heteroskedasticity

I am trying to find out if stock market movements, on average and in extreme conditions, affect gold prices. I am following the regression model proposed by Baur and McDermott (2010) which is given as:...
5
votes
3answers
19k views

Feature Selection in Linear Regression

I have a insurance dataset as given below. For which I need to build a model to calculate the charges. ...
1
vote
1answer
65 views

How to find the weights for weighted least squares regression?

When we are doing weighted least squares how do we find the weights? Where ever I see tutorials are just using $w_i = \frac{1}{(sigma)i^2}$ and doing it with basic data. But I want to know how to find ...
2
votes
2answers
54 views

Dealing with diverse groups in regression

What happens if a certain dataset contains different "groups" that follow different linear models? For example, let's imagine that examining the scatterplot of a certain feature $x_i$ against $y$ we ...
3
votes
2answers
117 views

Constraining linear regressor parameters in scikit-learn?

I'm using sklearn.linear_model.Ridge to use ridge regression to extract the coefficients of a polynomial. However, some of the coefficients have physical ...
0
votes
0answers
32 views

Gradient descent in linear regression converges but the trend line is incorrect

For the dataset https://physics.info/linear-regression/dash-world.txt, I have been trying to implement linear regression for predicting the men record times as a function of year. I have used gradient ...
0
votes
0answers
18 views

Ordinary Least Squares: How to find the two features that jointly minimize mean squared error given individual coefficients?

Say you are given $d$ features with $N$ data points and trying to predict target $y$. You first try to fit an ordinary least squares model to each feature (+ bias term), that is finding $(\beta_{0i}, \...
1
vote
0answers
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 ...
0
votes
1answer
52 views

A multivariate linear regression for explaining impacts of the predictors

I am trying to build a multivariate linear regression and the main goal is to understand how the various features impact the response by understanding the coefficients and their confidence intervals. ...
0
votes
1answer
60 views

Linear regression doesn't return the expected number of $\beta_i$

I have a dataset of precincts and results of parties on different elections. After reading this article I really wanted to use linear regression to answer the question : how did voters changed their ...

1
2 3 4 5
13