Skip to content
Advertisement

Tag: linear-regression

ValueError:Reshape your data either using array.reshape(-1, 1)if your data has a single feature or array.reshape(1, -1) if it contains a single sample

**the code predict the house price with polynomial regression model and fastapi **` make class have an one parameter and have a 4 value #The train_plynomial_model is a function that takes the Features and returns polynomial model The predict is a function that predict the house price “ I tried to put this sentencenewfeature=newfeature.reshape(-1, 1) Answer You should change features

Clustering different sets of points with different linear relationships to each other in Python

I need to cluster groups of points with the same linear relationship, as per the code and figure below. Obviously, I wouldn’t have the points that way; I would just have the following x and y. Note the following: the points respect linear relationships with high slope, they present a slight separation from each other, and they all have the

Simple Linear Regression not converging

In my attempt to dig deeper in the math behind machine learning models, I’m implementing a Ordinary Least Square algorithm in Python, using vectorization. My references are: https://github.com/paulaceccon/courses/blob/main/machine_learning_specialization/supervisioned_regression/2_multiple_regression.pdf https://www.geeksforgeeks.org/linear-regression-implementation-from-scratch-using-python/ This is what I have now: The problem I’m facing is that my weights keep increasing until I end up getting a bunch of nans. I’ve been trying to find out

Advertisement