28,214 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
0
answers
62
views
MLflow doesn’t log or show model artifacts after training run
I’m working on a machine learning project using MLflow for experiment tracking (on macOS, Python 3.12, scikit-learn, and DagsHub as the tracking server). The experiment runs successfully — I see the ...
-1
votes
0
answers
62
views
How to use sklearn imputation methods on numpy.void (record or structured array, I'm not sure) ndarray
Code:
import numpy as np
import sklearn as skl
data = np.genfromtxt("water_potability.csv", delimiter = ",", names = True)
print(data)
print(data.shape)
print(type(data[0]))
...
0
votes
0
answers
120
views
Shape of tree_.value
According to the sklearn docs the shape of tree_.value is [n_nodes, n_classes, n_outputs]. I just wanted to ask if this is still correct.
I think the correct shape is [n_nodes, n_outputs, n_classes] ...
2
votes
1
answer
112
views
PCA with arpack returns different values when the order of observations change, but why?
I have recently noticed that when I change the order of the observations in a sparse array, scikit-learn PCA with svd_solver="arpack" returns different floating point numbers. Is this an ...
2
votes
0
answers
57
views
Qiskit Problem: Why does this not work with COBYLA and how do i optimize it?
I'm doing a small program that is supposed to classify the data of the Wisconsin Breast Cancer database contained in sklearn.datasets using Quantum Neural Networks (specifically EstimatorQNN).
I think ...
0
votes
0
answers
63
views
How to correct 3rd party sphinx ambiguous cross-reference warnings?
I'm trying to document a variety of classes that use scikit-learn bases BaseEstimator and TransformerMixin. Sphinx builds with a warning that,
/home/jake/github/proj/pkg/__init__.py:docstring of
...
0
votes
3
answers
196
views
n_jobs>=2 breaks reproducibility
I am facing a problem in maintaining the reproducibility in the ML project. I believe the core snippet of my issue is
clf = Clf(random_state=cfg.seed)
# instantiate the K-fold cross-validation ...
0
votes
0
answers
75
views
Flask ML App Stuck on "Loading" Status Despite Successful Model Training
I'm deploying a Flask ML application with book recommendations to Render, but I'm experiencing a persistent issue where my health endpoint always returns "model_loaded": false, "status&...
0
votes
1
answer
57
views
Brier Skill Score returns NaN in cross_val_score with imbalanced dataset
I’m trying to evaluate classification models on a highly imbalanced fraud dataset using the Brier Skill Score (BSS) as the evaluation metric.
The dataset has ~2133 rows and the target Fraud_Flag is ...
2
votes
1
answer
144
views
how to pass pre-computed folds to successiveHalving in sklearn
I want to undersample 3 cross-validation folds from a dataset, using say, RandomUnderSampler from imblearn, and then, optimize the hyperparameters of various gbms using those undersampled folds as ...
4
votes
3
answers
87
views
Evaluate transformations with the same model in scikit-learn
I would like to perform a regression analysis and test different transformations of the input variables for the same model. To accomplish this, I created a dictionary with the different pipelines, ...
3
votes
1
answer
172
views
Why am I getting ModuleNotFoundError: No module named 'numpy._utils' when importing scikit-learn or TensorFlow on Python 3.12?
I’m trying to run Python scripts that import scikit-learn and TensorFlow, but I keep running into a NumPy-related error.
code example:
from packaging import version
import sklearn
assert version....
1
vote
2
answers
106
views
ValueError when fitting model: Expected 2D array, got 1D array instead
import numpy as np
from sklearn.linear_model import LinearRegression
X = np.array([1, 2, 3, 4, 5]) # Features
y = np.array([2, 4, 6, 8, 10]) # Target
model = LinearRegression()
model.fit(X, y) # &...
-2
votes
2
answers
77
views
Version unsupported imbalanced-learn
I am trying to install scikit-learn and imbalanced-learn for ML project using poetry.
# File pyproject.toml
[project]
name = "hello"
version = "0.1.0"
description = ""
...
4
votes
1
answer
68
views
Plot confusion matrix in black and white
I currently have the following code:
disp = ConfusionMatrixDisplay(confusion_matrix=cm)
disp.plot()
plt.show()
This results into something like:
However, I want the diagonal to be depicted with a ...