All Questions
273 questions
2
votes
1
answer
109
views
Why does SequentialFeatureSelector return at most "n_features_in_ - 1" predictors?
I have a training dataset with six features and I am using SequentialFeatureSelector to find an "optimal" subset of the features for a linear regression model. The following code returns ...
0
votes
1
answer
72
views
How do I make a neural network class with fit and predict functions like with sklearn models, when my train and test data are different sizes?
I'm trying to make a neural network model that will answer a linear regression problem (I've already made a model using sklearn's LinearRegression and I'd like to compare the two). Ultimately I'd ...
-2
votes
1
answer
192
views
Scikit learn cross validation score negative value
I was trying to build a linear regression model to predict the price of houses to begin with machine learning but come accross negative values of score when using cross validation in this code:
from ...
0
votes
1
answer
50
views
ValuerError: Found input variables with inconsistent numbers of samples [closed]
I wrote the following code to learn the score in the machine learning methods. but I get the following error. what would be the reason??
ValueError: Found input variables with inconsistent numbers of ...
0
votes
1
answer
73
views
sklearn PolynomialFeatures: Is the bias required if LinearRegression generates a y intercept
I'm new to machine learning so I have been playing around with some of the models trying to get a better understanding.
When I create a matrix of features:
X_Poly3 (X_Poly3 = PolynomialFeatures(3))
...
0
votes
1
answer
62
views
Find the threshold that returns the highest precision
I have this dataset:
(26.5625,0)
(29.5625,0)
(30.390625,0)
(18.640625,0)
(27.984375,0)
(26.984375,0)
(25.703125,0)
(25.78125,0)
(32.09375,0)
(25.59375,0)
(27.703125,0)
(30.828125,0)
(23.578125,0)
(21....
1
vote
1
answer
340
views
scikit-learn 1.1.3. import cannot import name 'METRIC_MAPPING64' in python
I am trying to import linear model from scikit-learn into my python code in vscode and get an unexpected error message.
import sklearn
from sklearn import linear_model
the error:
cannot import name '...
1
vote
0
answers
29
views
Problem with cros_val_score with Linear Regression
I have this code where I don't understand where the error is when I calculate the cross_val_score.
You can find the code at the end.
When I insert X and Y into cross_val_score I get this output=
[-1....
1
vote
1
answer
805
views
SHAP Partial Dependence Plot Misalignment with Train-Test Split in Linear Regression
I'm experiencing an issue with SHAP's partial dependence plot when using a train-test split for a linear regression model in Python. When I calculate SHAP values and plot the partial dependence for ...
0
votes
1
answer
136
views
Issue with Metrics Interpretation after Log Transformation in Regression Task
I am currently working on a house price prediction task where I have logarithmically transformed the target variable (price) due to its non-normal distribution. I am using metrics such as RMSE, MAE, ...
1
vote
2
answers
8k
views
The feature names should match those that were passed during fit
Im trying to calculate the r squared value after the creation of a model using sklearn linear regression.
Im simply
importing a csv dataset
filtering the interesting columns
splitting the dataset in ...
1
vote
1
answer
282
views
Keep 0.1% samples to be outliers in HuberRegressor
When I run Huber regression on a certain data set using HuberRegressor() form sklearn.linear_model, I want to keep 0.1% of all samples to be outliers. As I know, HuberRegressor() controls the size of ...
0
votes
0
answers
136
views
How to use Histogram or table DataFrame as a predictor in linear regression?
I'm trying to build a model that can calculate the concentration of dark matter particles in a halo, There are already packages and methods to spawn particles in a radial grid according to a specific ...
1
vote
1
answer
797
views
Detecting Multiple Lines in 2D Point Data using RANSAC
I have datasets of points plotted on an XY axis, and in each dataset, I know in advance the number of lines that the points should form. My goal is to detect these lines using a method like RANSAC. In ...
0
votes
1
answer
1k
views
Compare predicted values with true values
I've split my data into X_train, X_test, y_train, and y_test, and is trying to compare y_pred (my model's prediction of the X_test set) with the ground truth values, y_test.
# Splitting data
X_train, ...