All Questions
945 questions
0
votes
0
answers
38
views
AttributeError: module 'scikit_posthocs' has no attribute 'plot_cd_diagram'
I'm trying to plot the critical difference diagram in Nemenyi post-hoc test using the scikit-learn.
# Step 6: Visualize the Results with Critical Difference Diagram
plt.figure(figsize=(8, 6))
sp....
-2
votes
1
answer
87
views
Cannot convert dataframe column to a int64 data type
I have a problem.
In my Pandas DataFrame, I have a column called 'job' column. I've created a simple and custom transformer that will map values in that column that corresponds to the type of job. The ...
5
votes
1
answer
130
views
Python 3.10.4 scikit-learn import hangs when executing via CPP
Python 3.10.4 is embedded into cpp application.
I'm trying to import sklearn library which is installed at custom location using pip --target.
sklearn custom path (--target path) is appended to sys....
0
votes
0
answers
38
views
How to implement pipeline into machine learning model
I would like to implement Onehot encoding and label encoding to my dataset using Pipeline into my random forest model. I have created a function that utilize pipeline from scikit learn together with ...
1
vote
1
answer
72
views
model.compile loss TypeError: Missing required positional argument
The minimum example is
import numpy as np
import tensorflow as tf
from tensorflow import keras
from keras.losses import huber
# create dataset
x = np.random.rand(10, 1)
y = 2 * x + np.random.randn(10,...
0
votes
0
answers
455
views
How to import the California housing dataset in an IDE like google colab
I tried importing the California housing dataset in my Kaggle and google colab notebook but I got an HTTPError. However this code works well on my Jupyter notebook
from sklearn.datasets import ...
0
votes
0
answers
55
views
Sklearn transformer output returns more columns with some columns not having the transformation
I am building a scikit-learn pipeline. I downloaded a dataset from an online ML repository and generated descriptive stats for it. I am using the processed.cleveland.data dataset found here: https://...
1
vote
2
answers
6k
views
ModuleNotFoundError: No module named 'sklearn.ensemble._gb_losses'
i have install the scikit_learn and tried to install multiple version but not able to download
not able to find answer for sklearn.ensemble._gb_losses
from flask import Flask, render_template, request
...
0
votes
2
answers
299
views
Not sure on how to use the make_pipeline of sklearn correctly
I am playing around with the titanic ddataset and trying to make a correct usage of the sklearn make_pipeline, but I'm becoming a little confused on how tu correctly build the pipelines. Here's the ...
0
votes
1
answer
157
views
Automate the calculation in Python of a Distribution Function in a system of equations
I would like to calculate an approximation of the data Distribution Function in a system of equations:
F(t) := P(X <= t) ~ sum_i_frequency(observation_i <=t) / total_observation =: f(t)
My data:...
-1
votes
2
answers
416
views
AttributeError: 'numpy.ndarray' object has no attribute 'columns' -> when I didn't even change dataframe into np.ndarry
Currently I am trying to crack the Spaceship Titanic Dataset from Kaggle and when I was in the process of doing so I got an error (below). In the code below X is the same dataset after removing the ...
-1
votes
1
answer
476
views
The right way of using SMOTE in Classification Problems [closed]
What is the right way to implement SMOTE() in a classification modeling process? I am really confused about how to apply SMOTE() there. Say I have the dataset split into train and test like this as a ...
0
votes
1
answer
637
views
"enable_categorical=True" encoding method for xgboost library in Python
Let's assume X_train contains both numerical and categorical variables.
import xgboost as xgb
dtrain = xgb.DMatrix(data=X_train, label=y_train, enable_categorical=True)
params = {
'objective': '...
0
votes
1
answer
119
views
why is my linear regression line so short?
For a student project, I have to plot the knob position rc as a function of the corresponding wavelength in nanometres.
When doing a linear regression, my line is very short. How can I change this? ...
0
votes
1
answer
79
views
Hyperopt being non deterministic with XGBRegressor [duplicate]
I ran a hyperparameter searching using hyperopt.
Defined the space and objective.
# Define the search space for hyperparameters
space = {
'n_estimators': hp.quniform('n_estimators', 100, 500, 10),
...