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
1answer
8 views

shapes (127,1) and (13,) not aligned: 1 (dim 1) != 13 (dim 0) [on hold]

i am try to find score of linear regression it gives me this type error my code is below ...
0
votes
1answer
5 views

Using a trained Model from Pickle

I trained and saved a model that should predict a sons hight based on his fathers height. I then saved the model to Pickle. I can now load the model and want to use it but unfortunately a second ...
0
votes
0answers
12 views

Linear Regression Error in feature matrix step

I'm trying to code the design function used in linear regression using numpy and I get this error: Traceback (most recent call last): File "C:\Users\visha\AppData\Local\Continuum\anaconda3\lib\...
2
votes
0answers
23 views

Linear Regression in Python using gradient descent

I am trying to implement a simple multivariate linear regression model without using any inbuilt machine libraries. So far, I have been able to get a root mean squared error for training about $2.93$ ...
0
votes
1answer
24 views

Gradient Descent or Normal Equation?

Hi guys I am really struggling with this question. I need to pick the correct choice: Suppose you have a dataset with m = 50 examples and n = 15 features for each example. You want to use ...
0
votes
1answer
28 views

Which Technique should we use for predicting an integer output?

I'm working on a problem where my target feature of type integer. i.e (n_clicks). In general, if we want to predict categorical target feature then we use classification algorithms and on the other ...
1
vote
1answer
54 views

Why $L2$ loss is strictly convex if number of samples $N$ is larger than input dimension $d$?

I am using $L2$ loss in my linear regression problem and I have to prove that my $L2$ loss is strictly convex if number of samples $N$ is larger than input dimension $d$. I think, if I can prove ...
-4
votes
0answers
22 views

Calculate mathematical relationship between two arrays and find the exact input value - python [closed]

I have two arrays, x and y. Let's say, x is the input array and y is output and that y is calculated as y = f(x). (y is some function of x) ...
0
votes
1answer
23 views

Linear Regression: Why use global basis functions instead of local basis functions

I'm looking through an online course about machine learning and the first big topic is finding a model that approximates our data with linear regression. The model itself is linear function and we ...
0
votes
0answers
10 views

Linear Regression vs Generalized linear regression

What is the difference between Linear Regression and Generalized Linear regression of degree 1? because linear regression uses ordinary least square method to find the best fit but GLM uses least ...
1
vote
1answer
21 views

Multi-Output Regression

I have got an .xlsx Excel file with an input an 2 output columns. And there are some coordinates and outputs in that file such as: x= 10 y1=15 y2=20 x= 20 y1=14 y2=22 ... I am trying to do that ...
1
vote
0answers
24 views

Why do I get such a high MSE when I choose a multivariate target?

I have this dataset: Here's how I currently create my data and univariate target: ...
0
votes
0answers
8 views

How to encode features that encode regular values as well as special categorical values

I was recently playing around with the FICO explainable machine learning challenge dataset. In the dataset, there are a bunch of numerical features which have values values typically in the 0-100 ...
0
votes
1answer
28 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}...
0
votes
0answers
24 views

Linear/Logistic Regression for unknown values or how to get a good prior for new coefficients

Suppose, we model the probability of making holidays by country and town. The input data are people and how many people actually made holiday in that particular town: ...
0
votes
1answer
27 views

How to use a a trained model

I just trained my first model in Python 3.7/scikitlearn (Linear Regression) (well I copied most of the code but its something ^^). Now I want to actually Use the model. Specifically its about sons ...
0
votes
2answers
35 views

Why use deep neural networks over methods like linear regression or SVM?

This is a very broad question, but I was wondering why researchers would choose a deep neural network over linear regression or SVM? As in, what are the advantages and disadvantages of both?
0
votes
0answers
19 views

Linear regression: Selecting number of features with BIC/AIC

Im looking into selecting a linear model based on its BIC/AIC rather than its CV-score. Basically I run 10-fold CV using RFE and I obtain a training-MSE, ...
0
votes
1answer
31 views

Calculate coefficient w*

I'm learning ML from Bishop's book. But I don't know that How should I calculate w* in the below picture.
2
votes
0answers
23 views

Assumptions made when modelling with ML/AI approaches vs. “conventional” statistical models

I was wondering if there is a good paper out there, that informs about model and data assumptions in AI/ML approaches? For example if you look at Time Series Modelling (Estimation or Prediction) with ...
1
vote
1answer
28 views

How Linear SVM Regression and Multiple Linear Regression different in terms of the regression result?

They starts from the same equation as below. y = w*x + b But they solve it differently. MLR specified the w and b by minimizing the square error whereas SVM specified w and b by minimizing the loss ...
0
votes
0answers
44 views

Mean encoding for linear regression: leveraging domain expertise

I'm trying to build a linear model to predict a customer satisfaction score that measures the overall store experience. My customer could interact with my store using an offline channel (physical) or ...
0
votes
1answer
21 views

Appraise the statement: “For the model 𝑦 = 𝛽0 + 𝛽1𝑥 + 𝑒, 𝛽1 reflects the causal effect of 𝑥 on 𝑦.” Ask

not sure if this was the right place to ask my question, but I saw some questions regarding linear regression so I'd thought I would try to get some answers here. I just started learning about linear ...
0
votes
0answers
6 views

Multiple linear the final X output is the same as the imported one despite the fact that p-value are bigger than 0.05

I am making a simple test on multiple linear regression. Importing datasets and libraries ...
0
votes
4answers
38 views

Analyzing country data. Does duplicating observations by population for regression make sense?

Question: While analyzing country happiness data via OLS regression, should I duplicate observations based on country population? Example: If duplicating per million, the U.S. would have 327 ...
0
votes
1answer
38 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
0answers
73 views

SKLearn Boston dataset gradient descent not working

I am trying to compare some simple methods for linear regression as an exercise. I have already used LinearRegression from the SKLearn library in python as well as the formula of linear regression. ...
0
votes
0answers
21 views

Temperature in Farenheit : Interval or ratio data

According to the Level of Measurement classification, there are four types of data: nominal, ordinal, interval and ratio. The temperature in Fahrenheit and Celsius is often classified as interval ...
1
vote
2answers
61 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 ...
6
votes
3answers
86 views

xgboost: Is there a way to perform regression on rates/percentages data?

I have a dependent variable, $Y$, that is made up of rates/percentages data, so each value is between $0$ and $1$. I was attracted to the xgboost library because it allows focusing in on specific ...
1
vote
1answer
25 views

For a regression model, can you transform all your features to linear to make a better prediction?

I was thinking. Would it be a good approach to check your features one by one (assuming you have a manageable amount of them) and see the relationship they have with your target variable, if they ...
1
vote
0answers
10 views

Poisson Model (w/ multiple levels X)

Question Is Poisson model the best method for predicting counts among multiple levels within nominal variable? Details Imagine data of 7000 observations, where output= Obs.Count {numeric,0,1,2..8} ...
1
vote
0answers
22 views

How to identify multiple lines/clusters in a single dataset

I'm currently struggling to wrap my head around how multi-linear regression could be done to find separate sets of linear models in a single data set. I can perform regression on single data set for a ...
0
votes
0answers
14 views

How do different fraud detection methods compare with each other?

I am trying to do a comparison of methods of fraud detection and show the improvement of using some methods over others. Specifically, I'm trying to obtain statistics about the average accuracy rate ...
-1
votes
1answer
33 views

I can't understand polynomial in the book

I'm reading a book called Bishop - Pattern Recognition and Machine learning. I came across the following equation, in which I don't understand what $W$ stands for. So, what is $W$?
0
votes
1answer
29 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
0answers
10 views

How to predict a binary output from a dataframe? [duplicate]

I have a data set with a huge amount of variables for an output that can either be A or not A. How can I predict the output to ...
2
votes
2answers
54 views

Why does feature scaling improve the convergence speed for gradient descent?

From this article, it says: We can speed up gradient descent by scaling. This is because θ will descend quickly on small ranges and slowly on large ranges, and so will oscillate inefficiently down ...
0
votes
2answers
24 views

How to restrict the values of predicted variable to be positive?

I am using Python Linear Regression to predict the weekly orders for a food deliver company. But some of my orders are coming out as negative. Is there any way to restrict the predicted values to be ...
2
votes
0answers
34 views

Why do you need to use group lasso with categorical variables?

From what I've read you should you use group lasso to either discard the dummy encoded variables (of the category) or use all of them. If you use normal lasso then some of the variables in the group ...
0
votes
1answer
21 views

Coefficients of Linear regression for minimizing MSE

(I asked this in mathematics site, but nobody responded, it seems the whole problem is more related to data science than math.) In a regression problem, loss function is: $$L(a,b) = {\sum_{i=1}^n (y^...
0
votes
0answers
35 views

Given $x_1,…,x_n$, predict $y$ without being able to train on $y$

Say we have some large training data (a time series) of a few thousand rows, i.e. $$X_1=\{x_{1,1},\ldots,x_{1,n}\} \in\mathbb{R}^n, \quad y_1\in\mathbb{R}$$ $$\quad\quad \vdots$$ $$X_m=\{x_{m,1},\...
0
votes
1answer
45 views

Include time as a variable in regression model

I am currently working on a regression problem which requires me to predict the costs of a fixed asset. I have used several variables to do so and derived a predicted cost. However, my superior has ...
0
votes
1answer
15 views

How do I fix mis-rendered matplotlib?

How do I correct my data or format it so that it is presentable, and fix my graphs? Dataset is 345551 rows × 7 columns. I am using numpy, pandas, seaborn and matplot lib. It seems that my pricing ...
0
votes
1answer
20 views

Is it possible to build a regression model for predicting movie gross using sections on their wikipedia pages?

I got this as an assignment from a company recruiter and I've successfully scraped a dataset of about 650 movies with their 'Plot', 'Music' and 'Marketing' sections and gross. I've tried tfidf and ...
2
votes
1answer
26 views

How to cluster/identify points away from a regression line

For many vine plots, I have NDVI and Leaf Area values for each vine. I already know that NDVI and LA has a strong positive correlation as you can see in this picture. But as you can see too, there ...
0
votes
1answer
24 views

How to interpretate multiple histograms corresponding to each feature in multiple linear regression for relationship?

Used matplotlib to plot the histograms for each feature in Boston dataset available in scikitlearn library. How to interpretate the histograms to determine the correlation or significance of that ...
4
votes
3answers
136 views

Reward negative derivative on linear regression

I'm actually new to Data Science and I'm trying to make a simple linear regression with only one feature X ( which I added the feature log(X) before adding a polynomial features) on a motley dataset ...
4
votes
2answers
200 views

Is it valid to shuffle time-series data for a prediction task?

I have a time-series dataset that records some participants' daily features from wearable sensors and their daily mood status. The goal is to use one day's daily features and predict the next day's ...