id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_50114510 | stackoverflow | MACHINE_LEARNING | ALS (Alternating Least Square) algorithm in multiple rankings for a user | ALS (Alternating Least Square) algorithm in multiple rankings for a user
Hi after significant amount of research, we decided to use Google Cloud infrastructure and also to use ALS algorithm (A collabrative filtering method - https://cloud.google.com/solutions/recommendations-using-machine-learning-on-compute-engine#Tr... | https://stackoverflow.com/questions/50114510/als-alternating-least-square-algorithm-in-multiple-rankings-for-a-user | machine-learning, pyspark, google-cloud-platform | 1,525,168,439 |
se_72012513 | stackoverflow | MACHINE_LEARNING | How pyspark implementation of ALS is handling multiple ratings per user-item combination? | How pyspark implementation of ALS is handling multiple ratings per user-item combination?
I observed that the input data to ALS need not have unique rating per user-item combination.
Here is a reproducible example.
# Sample Dataframe
df = spark.createDataFrame([(0, 0, 4.0),(0, 1, 2.0),
(1, 1, 3.0), (1, 2, 4.0),
(2, ... | https://stackoverflow.com/questions/72012513/how-pyspark-implementation-of-als-is-handling-multiple-ratings-per-user-item-com | machine-learning, pyspark, recommendation-engine, apache-spark-ml, collaborative-filtering | 1,650,969,464 |
se_59851961 | stackoverflow | MACHINE_LEARNING | How to calculate confidence score of a Neural Network prediction | How to calculate confidence score of a Neural Network prediction
I am using a deep neural network model (implemented in keras)to make predictions. Something like this:
def make_model():
model = Sequential()
model.add(Conv2D(20,(5,5), activation = "relu"))
model.add(MaxPooling2D(pool_size=(2,2)))
model.a... | https://stackoverflow.com/questions/59851961/how-to-calculate-confidence-score-of-a-neural-network-prediction | tensorflow, machine-learning, keras, confidence-interval, uncertainty | 1,579,661,552 |
se_78540179 | stackoverflow | MACHINE_LEARNING | Pretrain model developing in tensorflow for image classification | Pretrain model developing in tensorflow for image classification
I have a issue regarding on how to modify a pretrained model to classify 3 classes instead of 1000. These are the 2 methods i came up with so far.. im not sure which one is the best.
NASNetMobile_model = tf.keras.applications.NASNetMobile (
... | https://stackoverflow.com/questions/78540179/pretrain-model-developing-in-tensorflow-for-image-classification | python, tensorflow, machine-learning, tf.keras, pre-trained-model | 1,716,826,932 |
se_58390209 | stackoverflow | MACHINE_LEARNING | ResNet50 Model is not learning with transfer learning in keras | ResNet50 Model is not learning with transfer learning in keras
I am trying to perform transfer learning on ResNet50 model pretrained on Imagenet weights for PASCAL VOC 2012 dataset. As it is a multi label dataset, I am using sigmoid activation function in the final layer and binary_crossentropy loss. The metrics are p... | https://stackoverflow.com/questions/58390209/resnet50-model-is-not-learning-with-transfer-learning-in-keras | tensorflow, machine-learning, keras, conv-neural-network, resnet | 1,571,127,612 |
se_61046588 | stackoverflow | MACHINE_LEARNING | Keras, memoryerror - data = data.astype("float") / 255.0. Unable to allocate 309. MiB for an array with shape (13165, 32, 32, 3) | Keras, memoryerror - data = data.astype("float") / 255.0. Unable to allocate 309. MiB for an array with shape (13165, 32, 32, 3)
I am currently working on the Smiles dataset and then applying Deep learning to detect the smile as positive or negative. The machine I am using is Raspberry Pi 3, and the version ... | https://stackoverflow.com/questions/61046588/keras-memoryerror-data-data-astypefloat-255-0-unable-to-allocate-309 | python, tensorflow, machine-learning, keras, deep-learning | 1,586,107,526 |
se_69899044 | stackoverflow | MACHINE_LEARNING | How to access prediction results of an image classifier ML model in an iOS app using Swift, UIkit, and CoreML | How to access prediction results of an image classifier ML model in an iOS app using Swift, UIkit, and CoreML
I am trying to develop an app that classifies an image taken from camera or chosen from image library using a model trained using Apple's CoreML. The model is properly trained and tested. It showed no problem ... | https://stackoverflow.com/questions/69899044/how-to-access-prediction-results-of-an-image-classifier-ml-model-in-an-ios-app-u | ios, swift, machine-learning, coreml | 1,636,464,648 |
se_51883058 | stackoverflow | MACHINE_LEARNING | L1 norm instead of L2 norm for cost function in regression model | L1 norm instead of L2 norm for cost function in regression model
I was wondering if there's a function in Python that would do the same job as scipy.linalg.lstsq but uses “least absolute deviations” regression instead of “least squares” regression (OLS). I want to use the L1 norm, instead of the L2 norm.
In fact, I h... | https://stackoverflow.com/questions/51883058/l1-norm-instead-of-l2-norm-for-cost-function-in-regression-model | python, machine-learning, regression, least-squares | 1,534,443,122 |
se_79414036 | stackoverflow | MACHINE_LEARNING | How to have reproducibility with Keras, Tensorflow? | How to have reproducibility with Keras, Tensorflow?
I am not getting the same accuracy and loss each time I run the following code. I followed the instructions from previous posts, but I couldn't resolve it. What could be the problem?
import os
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
os.environ["TF_DETERMINISTIC_OPS... | https://stackoverflow.com/questions/79414036/how-to-have-reproducibility-with-keras-tensorflow | python, tensorflow, machine-learning, keras | 1,738,742,942 |
se_79413251 | stackoverflow | MACHINE_LEARNING | PyTorch's seq2seq tutorial decoder | PyTorch's seq2seq tutorial decoder
I am learning through PyTorch's seq2seq tutorial: https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html
I have a question about the decoder
class DecoderRNN(nn.Module):
def __init__(self, hidden_size, output_size):
super(DecoderRNN, self).__init... | https://stackoverflow.com/questions/79413251/pytorchs-seq2seq-tutorial-decoder | python, machine-learning, pytorch, recurrent-neural-network, seq2seq | 1,738,710,104 |
se_21963486 | stackoverflow | MACHINE_LEARNING | troubleshooting random forests classifier in sci-kit learn | troubleshooting random forests classifier in sci-kit learn
I am trying to run the random forests classifier from sci-kit learn and getting suspiciously bad output - less than 1% of predictions are correct. The model is performing much worse than chance. I am relatively new to Python, ML, and sci-kit learn (a triple ... | https://stackoverflow.com/questions/21963486/troubleshooting-random-forests-classifier-in-sci-kit-learn | python, machine-learning, scikit-learn, random-forest | 1,393,123,228 |
se_33948946 | stackoverflow | MACHINE_LEARNING | Random Forest is overfitting | Random Forest is overfitting
I'm using scikit-learn with a stratified CV to compare some classifiers.
I'm computing: accuracy, recall, auc.
I used for the parameter optimization GridSearchCV with a 5 CV.
RandomForestClassifier(warm_start= True, min_samples_leaf= 1, n_estimators= 800, min_samples_split= 5,max_featur... | https://stackoverflow.com/questions/33948946/random-forest-is-overfitting | python, machine-learning, scikit-learn, random-forest | 1,448,585,700 |
se_50629219 | stackoverflow | MACHINE_LEARNING | How do cross_val_score and gridsearchCV work? | How do cross_val_score and gridsearchCV work?
I have been trying to figure out how gridsearchCV and cross_val_score work.
Finding odds results a set up a sort of validation experiment, but still I do not understand what I am doing wrong.
To try to simplify I am using gridsearchCV is the simplest possible way and try t... | https://stackoverflow.com/questions/50629219/how-do-cross-val-score-and-gridsearchcv-work | python, machine-learning, scikit-learn, cross-validation | 1,527,785,439 |
se_64675820 | stackoverflow | MACHINE_LEARNING | what is difference between criterion and scoring in GridSearchCV | what is difference between criterion and scoring in GridSearchCV
I have created a GradientBoostingRegressor model.
I use scoring parameter in GridSearchCV function to return MSE score.
I wonder if I use criterion in param_grids does it change my model? which is the correct way?
GBR = GradientBoostingRegressor()
param_... | https://stackoverflow.com/questions/64675820/what-is-difference-between-criterion-and-scoring-in-gridsearchcv | python, machine-learning, scikit-learn, linear-regression, grid-search | 1,604,475,306 |
se_44181511 | stackoverflow | MACHINE_LEARNING | Hyperparameter tune for Tensorflow | Hyperparameter tune for Tensorflow
I am searching for a hyperparameter tune package for code written directly in Tensorflow (not Keras or Tflearn). Could you make some suggestion? | https://stackoverflow.com/questions/44181511/hyperparameter-tune-for-tensorflow | optimization, tensorflow, machine-learning, bayesian, hyperparameters | 1,495,718,033 |
se_48619800 | stackoverflow | MACHINE_LEARNING | Predictive Maintenance - How to use Bayesian Optimization with objective function and Logistic Regression with Gradient Descent together? | Predictive Maintenance - How to use Bayesian Optimization with objective function and Logistic Regression with Gradient Descent together?
I'm trying to reproduce the problem shown in arimo.com
This is an example how to build a preventive maintenance Machine Learning model for an Hard Drive failures. The section I rea... | https://stackoverflow.com/questions/48619800/predictive-maintenance-how-to-use-bayesian-optimization-with-objective-functio | optimization, machine-learning, logistic-regression, gradient-descent, hyperparameters | 1,517,824,551 |
se_5749867 | stackoverflow | MACHINE_LEARNING | Is a neural network a lazy or eager learning method? | Is a neural network a lazy or eager learning method?
Is a neural network a lazy or eager learning method? Different web pages say different things so I want to get a solid answer with good literature to back it up. The most obvious book to look in would be Mitchell's famous Machine Learning book but skimming through... | https://stackoverflow.com/questions/5749867/is-a-neural-network-a-lazy-or-eager-learning-method | artificial-intelligence, machine-learning, neural-network | 1,303,420,585 |
se_68981874 | stackoverflow | MACHINE_LEARNING | What is sharding in machine learning and how to do sharding in Tensorflow? | What is sharding in machine learning and how to do sharding in Tensorflow?
What is sharding in the context of machine learning specifically ( a more generic antic question is asked here ) and how is it implemented in Tensorflow ?
What is referred to as sharding, why do we need sharding altogether, when speaking about... | https://stackoverflow.com/questions/68981874/what-is-sharding-in-machine-learning-and-how-to-do-sharding-in-tensorflow | python, tensorflow, machine-learning, input, sharding | 1,630,316,108 |
se_79411192 | stackoverflow | MACHINE_LEARNING | Image segmentation ONNX from huggingface produces very diferent results when used in ML.Net | Image segmentation ONNX from huggingface produces very diferent results when used in ML.Net
I have been trying to get an image segmentation model from huggingface (RMBG-2.0) to work for inference using ML.NET. After a lot of trial and error, I finally got the code to compile and produce an output but it is wildly diff... | https://stackoverflow.com/questions/79411192/image-segmentation-onnx-from-huggingface-produces-very-diferent-results-when-use | c#, machine-learning, huggingface, onnx, ml.net | 1,738,661,937 |
se_79410458 | stackoverflow | MACHINE_LEARNING | Different Results (With Seed) For sklearn Random Forest | Different Results (With Seed) For sklearn Random Forest
I am using sklearn to run a random forest. I am setting the seed for the random forest, as well as splitting the data for cross validation. When I re-run the code consecutive times, it gives me the same result. However, re-running the same code after a month, I g... | https://stackoverflow.com/questions/79410458/different-results-with-seed-for-sklearn-random-forest | python, machine-learning, scikit-learn, random-forest, random-seed | 1,738,636,452 |
se_79409259 | stackoverflow | MACHINE_LEARNING | How does Hydra `_partial_` interact with seeding | How does Hydra `_partial_` interact with seeding
In the configuration management library Hydra, it is possible to only partially instantiate classes defined in configuration using the _partial_ keyword. The library explains that this results in a functools.partial. I wonder how this interacts with seeding. E.g. with
... | https://stackoverflow.com/questions/79409259/how-does-hydra-partial-interact-with-seeding | python, machine-learning, pytorch, pytorch-lightning, fb-hydra | 1,738,596,536 |
se_67864721 | stackoverflow | MACHINE_LEARNING | Semantic Segmentation on a bigger image | Semantic Segmentation on a bigger image
I trained a U-net with inputs of satellite images of 120 X 120.
I need to apply my model to a bigger image (size 10980 X 10980). What I tried to do was slice the bigger images into slices of 120 X120 classify these and assemble them into a new image.
My question is: is this a... | https://stackoverflow.com/questions/67864721/semantic-segmentation-on-a-bigger-image | image, machine-learning, semantic-segmentation | 1,623,025,662 |
se_79399452 | stackoverflow | MACHINE_LEARNING | Whisper model Real-time endpoint container deployment failed on Azure ML | Whisper model Real-time endpoint container deployment failed on Azure ML
I tried to deploy Whisper on Azure ML.
I am using the Whipser-openAI-v3 model for deployment.
The endpoint creation successes but deployment failed with the error ResouceOperationFailed
and so the creation of deployment failed.
I think the proble... | https://stackoverflow.com/questions/79399452/whisper-model-real-time-endpoint-container-deployment-failed-on-azure-ml | azure, machine-learning, deployment, azure-machine-learning-service, automatic-speech-recognition | 1,738,230,651 |
se_51063229 | stackoverflow | MACHINE_LEARNING | How to fix ValueError: Found array with 0 sample(s) | How to fix ValueError: Found array with 0 sample(s)
I am really new to python trying to run a linear regression using sklearn, when I try to train the model:
regressIt.fit(X_train, Y_train)
It throws the following exception:
ValueError: Found array with 0 sample(s) (shape=(0, 546)) while a minimum of 1 is required... | https://stackoverflow.com/questions/51063229/how-to-fix-valueerror-found-array-with-0-samples | python-3.x, scikit-learn | 1,530,103,718 |
se_63414169 | stackoverflow | MACHINE_LEARNING | How can implement EM-GMM in python? | How can implement EM-GMM in python?
I have implemented EM algorithm for GMM using this post GMMs and Maximum Likelihood Optimization Using NumPy unsuccessfully as follows:
import numpy as np
def PDF(data, means, variances):
return 1/(np.sqrt(2 * np.pi * variances) + eps) * np.exp(-1/2 * (np.square(data - means) /... | https://stackoverflow.com/questions/63414169/how-can-implement-em-gmm-in-python | python, numpy, machine-learning, scikit-learn, gmm | 1,597,413,321 |
se_78225231 | stackoverflow | MACHINE_LEARNING | What is the cause of my error "Expected a 2-dimensional container but got <class 'pandas.core.series.Series'> instead." | What is the cause of my error "Expected a 2-dimensional container but got <class 'pandas.core.series.Series'> instead."
My code uses scikit-learn fit. I tried to look up this error code online, but couldn't find much information about it. What I understand is that I have to make one Dataframe f... | https://stackoverflow.com/questions/78225231/what-is-the-cause-of-my-error-expected-a-2-dimensional-container-but-got-class | python, pandas, dataframe, scikit-learn | 1,711,455,089 |
se_51129498 | stackoverflow | MACHINE_LEARNING | MemoryError during hierarchical clustering | MemoryError during hierarchical clustering
I have a fairly large data set (1841000*32 matrix) I wish to run a hierarchical clustering algorithm on. Both the AgglomerativeClustering class and the FeatureAgglomeration class in sklearn.cluster give the below error.
------------------------------------------------... | https://stackoverflow.com/questions/51129498/memoryerror-during-hierarchical-clustering | python, opencv, scikit-learn, out-of-memory, hierarchical-clustering | 1,530,508,783 |
se_49869805 | stackoverflow | MACHINE_LEARNING | Categorical classification in Keras Python | Categorical classification in Keras Python
I am doing multi-class classification of 5 classes. I am using Tensorflow with Keras. My code is like this:
# load dataset
dataframe = pandas.read_csv("Data5Class.csv", header=None)
dataset = dataframe.values
# split into input (X) and output (Y) variables
X = dataset[:,0:4... | https://stackoverflow.com/questions/49869805/categorical-classification-in-keras-python | python-3.x, tensorflow, scikit-learn, keras, multiclass-classification | 1,523,938,386 |
se_54093185 | stackoverflow | MACHINE_LEARNING | How to understand sample_weight in sklearn.metrics? | How to understand sample_weight in sklearn.metrics?
Do we need to set sample_weight when we evaluate our model? Now I have trained a model about classification, but the dataset is unbalanced. When I set the sample_weight with compute_sample_weight('balanced'), the scores are very nice. Precision:0.88, Recall:0.86 for ... | https://stackoverflow.com/questions/54093185/how-to-understand-sample-weight-in-sklearn-metrics | machine-learning, scikit-learn | 1,546,955,157 |
se_40937543 | stackoverflow | MACHINE_LEARNING | NotFittedError: Estimator not fitted, call `fit` before exploiting the model | NotFittedError: Estimator not fitted, call `fit` before exploiting the model
I am running Python 3.5.2 on a Macbook OSX 10.2.1 (Sierra).
While attempting to run some code for the Titanic Dataset from Kaggle, I keep getting the following error:
NotFittedError Traceback (most recent... | https://stackoverflow.com/questions/40937543/notfittederror-estimator-not-fitted-call-fit-before-exploiting-the-model | python, machine-learning, scikit-learn | 1,480,698,622 |
se_61609124 | stackoverflow | MACHINE_LEARNING | how to plot a decision tree from gridsearchcv? | how to plot a decision tree from gridsearchcv?
i was trying to plot the decision tree which is formed with GridSearchCV, but its giving me an Attribute error.
AttributeError: 'GridSearchCV' object has no attribute 'n_features_'
However if i try to plot a normal decision tree without GridSearchCv, then it successful... | https://stackoverflow.com/questions/61609124/how-to-plot-a-decision-tree-from-gridsearchcv | python, scikit-learn, decision-tree, cross-validation | 1,588,668,114 |
se_79981101 | stackoverflow | MACHINE_LEARNING | FastAPI event loop blocked by Scikit-Learn Joblib thread-pool exhaustion during concurrent async inference | FastAPI event loop blocked by Scikit-Learn Joblib thread-pool exhaustion during concurrent async inference
I am deploying a Random Forest model using FastAPI. Because Scikit-Learn models are synchronous and CPU-bound, I am offloading the inference to asyncio.get_running_loop().run_in_executor() to prevent blocking the... | https://stackoverflow.com/questions/79981101/fastapi-event-loop-blocked-by-scikit-learn-joblib-thread-pool-exhaustion-during | python, scikit-learn, python-asyncio, fastapi | 1,784,144,861 |
se_79868890 | stackoverflow | MACHINE_LEARNING | best way to leverage polars multithreading with scikit-learn compatibility | best way to leverage polars multithreading with scikit-learn compatibility
I've been working on a project for rapidly testing thousands of outcome variables on a standard set of predictors and covariates using polars. It's working very well, with speed ups as high as 16x compared to a comparable package in R. My quest... | https://stackoverflow.com/questions/79868890/best-way-to-leverage-polars-multithreading-with-scikit-learn-compatibility | python, scikit-learn, python-polars | 1,768,507,070 |
se_79980188 | stackoverflow | MACHINE_LEARNING | skl2onnx conversion for standalone RandomForestClassifier results in massive 41% accuracy drop due to list unpacking shape mismatch | skl2onnx conversion for standalone RandomForestClassifier results in massive 41% accuracy drop due to list unpacking shape mismatch
I am converting a standard Scikit-Learn standalone RandomForestClassifier into an ONNX graph using skl2onnx. While my native Python script logs an expected accuracy of 0.7832 on the Titan... | https://stackoverflow.com/questions/79980188/skl2onnx-conversion-for-standalone-randomforestclassifier-results-in-massive-41 | python, machine-learning, scikit-learn, onnx, onnxruntime | 1,783,910,950 |
se_58306943 | stackoverflow | MACHINE_LEARNING | What do the data analytics data set train and test variables represent? | What do the data analytics data set train and test variables represent?
Within the below code there are a few variables I'm confused about:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import svm,metrics,datasets
train_data=np.zeros((280,10304))
train_target=np.zeros((280))
t... | https://stackoverflow.com/questions/58306943/what-do-the-data-analytics-data-set-train-and-test-variables-represent | scikit-learn, svm, data-analysis | 1,570,632,887 |
se_73446317 | stackoverflow | MACHINE_LEARNING | ImportError: The `scipy` install you are using seems to be broken, (extension modules cannot be imported), please try reinstalling | ImportError: The `scipy` install you are using seems to be broken, (extension modules cannot be imported), please try reinstalling
I'm coniststently getting this error when trying to use scipy or sklearn packages in Python3.9 via a Jupyter notebook.
The error is:
-------------------------------------------------------... | https://stackoverflow.com/questions/73446317/importerror-the-scipy-install-you-are-using-seems-to-be-broken-extension-mo | python, python-3.x, numpy, scikit-learn, scipy | 1,661,176,602 |
se_59514067 | stackoverflow | MACHINE_LEARNING | What is a Verbose Output? | What is a Verbose Output?
I am currently using the GridSearchCV object in python. The function call gives an me option to specify the verbosity. Does anyone know what verbose means in this context? I have not found the documentation to be helpful in this respect. Help on clarifying what this is and what it is used for... | https://stackoverflow.com/questions/59514067/what-is-a-verbose-output | python, scikit-learn, verbose | 1,577,560,154 |
se_79872075 | stackoverflow | MACHINE_LEARNING | sklearn's FactorAnalysis varimax orthogonal rotation increases correlation of factors | sklearn's FactorAnalysis varimax orthogonal rotation increases correlation of factors
I'm using Scikit-Learn's FactorAnalysis in an application that relies on the assumption that the factors are uncorrelated. It would be great to have more interpretable factors, and an orthogonal rotation, such as varimax, should ... | https://stackoverflow.com/questions/79872075/sklearns-factoranalysis-varimax-orthogonal-rotation-increases-correlation-of-fa | python, scikit-learn, factor-analysis | 1,768,920,271 |
se_79939094 | stackoverflow | MACHINE_LEARNING | How Do Machine Learning Algorithms Improve Accuracy Over Time? | How Do Machine Learning Algorithms Improve Accuracy Over Time?
I recently started learning Python and machine learning. I noticed that many developers use libraries like TensorFlow and Scikit-learn for predictive modeling. What are the main advantages of using supervised learning algorithms compared to unsupervised le... | https://stackoverflow.com/questions/79939094/how-do-machine-learning-algorithms-improve-accuracy-over-time | javascript, python, java, tensorflow, scikit-learn | 1,778,460,227 |
se_31279575 | stackoverflow | MACHINE_LEARNING | Using sciki- learn classifier into java program | Using sciki- learn classifier into java program
I've got a trained scikit-learn classifier (Python) and I need to use it into a Java program.
I know that I can store my python classifier (clf) as follow:
joblib.dump(clf, 'my_model.pkl', compress=_)
I also know that there is the python-weka-wrapper library with which ... | https://stackoverflow.com/questions/31279575/using-sciki-learn-classifier-into-java-program | java, python, scikit-learn, weka, svm | 1,436,304,409 |
se_39917683 | stackoverflow | MACHINE_LEARNING | Add new version scikit-learn to spyder | Add new version scikit-learn to spyder
I have downloaded the newest version of scikit-learn (0.18), however, spyder keeps on using the previous version (0.17). How do I make the two compatible?
I have updated both distributions using Anaconda:
conda update spyder
conda update scikit-learn
Edit
Simply forcing An... | https://stackoverflow.com/questions/39917683/add-new-version-scikit-learn-to-spyder | python, scikit-learn, anaconda, spyder | 1,475,844,449 |
se_59286298 | stackoverflow | MACHINE_LEARNING | How to install sklearn on visual studio 2019? | How to install sklearn on visual studio 2019?
I'm working on a sample project with python language and visual studio 2019 IDE and I want to know how/where can I install packages like "sklearn"?
When I run my project I encounter with this error :
Message=No module named 'sklearn'
Source=C:\PythonApplication1\Pyt... | https://stackoverflow.com/questions/59286298/how-to-install-sklearn-on-visual-studio-2019 | python, visual-studio, scikit-learn, package | 1,576,068,824 |
se_79968342 | stackoverflow | MACHINE_LEARNING | The Most Efficient Way for Random Forest Models Serialization Memory-Wise | The Most Efficient Way for Random Forest Models Serialization Memory-Wise
I am training sklearn.ensemble.RandomForestRegressor on 272k rows of data with 38 features.
{
"n_estimators": 200,
"n_jobs": -1,
"random_state": 42
"oob_score": True,
}
The model size without explicitly declaring max_depth, min_... | https://stackoverflow.com/questions/79968342/the-most-efficient-way-for-random-forest-models-serialization-memory-wise | serialization, scikit-learn, random-forest, joblib | 1,782,480,475 |
se_14986893 | stackoverflow | MACHINE_LEARNING | Problems using a custom vocabulary for TfidfVectorizer scikit-learn | Problems using a custom vocabulary for TfidfVectorizer scikit-learn
I'm trying to use a custom vocabulary in scikit-learn for some clustering tasks and I'm getting very weird results.
The program runs ok when not using a custom vocabulary and I'm satisfied with the cluster creation. However, I have already identified... | https://stackoverflow.com/questions/14986893/problems-using-a-custom-vocabulary-for-tfidfvectorizer-scikit-learn | python, scikit-learn, tf-idf, vocabulary | 1,361,383,622 |
se_43834242 | stackoverflow | MACHINE_LEARNING | SKLearn MinMaxScaler - scale specific columns only | SKLearn MinMaxScaler - scale specific columns only
I'd like to scale some (but not all) of the columns in a Pandas dataFrame using a MinMaxScaler. How can I do it? | https://stackoverflow.com/questions/43834242/sklearn-minmaxscaler-scale-specific-columns-only | pandas, scikit-learn | 1,494,176,514 |
se_38420847 | stackoverflow | MACHINE_LEARNING | Apply StandardScaler to parts of a data set | Apply StandardScaler to parts of a data set
I want to use sklearn's StandardScaler. Is it possible to apply it to some feature columns but not others?
For instance, say my data is:
data = pd.DataFrame({'Name' : [3, 4,6], 'Age' : [18, 92,98], 'Weight' : [68, 59,49]})
Age Name Weight
0 18 3 68
1 92 ... | https://stackoverflow.com/questions/38420847/apply-standardscaler-to-parts-of-a-data-set | python, pandas, scikit-learn | 1,468,756,027 |
se_79966343 | stackoverflow | MACHINE_LEARNING | How to use StandardScaler on only specific columns in a pandas DataFrame? | How to use StandardScaler on only specific columns in a pandas DataFrame?
I have a DataFrame with three columns: 'power', 'time', and 'status'. The 'status' column contains 0 or 1 (target variable). I don't want to scale the 'status' column.
How can I apply StandardScaler to only the 'power' and 'time' columns while k... | https://stackoverflow.com/questions/79966343/how-to-use-standardscaler-on-only-specific-columns-in-a-pandas-dataframe | python, pandas, scikit-learn | 1,782,306,997 |
se_43049270 | stackoverflow | MACHINE_LEARNING | Python: loading a kmeans training dataset and using it to predict a new dataset | Python: loading a kmeans training dataset and using it to predict a new dataset
I have a huge amount of data which I would like to run a kmean classification on. The dataset are so big, that I cannot load the files into memory.
My idea is to run the classifiation on some part of the dataset like a training dataset, ... | https://stackoverflow.com/questions/43049270/python-loading-a-kmeans-training-dataset-and-using-it-to-predict-a-new-dataset | python, scikit-learn, k-means | 1,490,625,167 |
se_69488976 | stackoverflow | MACHINE_LEARNING | how to apply soft voting classifier for multi label classification | how to apply soft voting classifier for multi label classification
I applied 3 classifiers and I want to apply soft voting manually not by sklearn, in addition, I have 4 labels.
for example, I have 4 labels (L1, L2, L3, L4), each label has two classes(0/1):
class label: L1 L2 L3 L4
predic... | https://stackoverflow.com/questions/69488976/how-to-apply-soft-voting-classifier-for-multi-label-classification | python, scikit-learn, voting | 1,633,650,587 |
se_75983803 | stackoverflow | MACHINE_LEARNING | dtype='numeric' is not compatible with arrays of bytes/strings. Convert your data to numeric values explicitly instead | dtype='numeric' is not compatible with arrays of bytes/strings. Convert your data to numeric values explicitly instead
I was doing Linear Regression using scikit learn and I've tried in various methods by reshaping them either which resulted in entire error in the code. The dataset is
R&D Spend Administratio... | https://stackoverflow.com/questions/75983803/dtype-numeric-is-not-compatible-with-arrays-of-bytes-strings-convert-your-dat | python, python-3.x, scikit-learn, linear-regression | 1,681,201,161 |
se_15810339 | stackoverflow | MACHINE_LEARNING | How are feature_importances in RandomForestClassifier determined? | How are feature_importances in RandomForestClassifier determined?
I have a classification task with a time-series as the data input, where each attribute (n=23) represents a specific point in time. Besides the absolute classification result I would like to find out, which attributes/dates contribute to the result to w... | https://stackoverflow.com/questions/15810339/how-are-feature-importances-in-randomforestclassifier-determined | scikit-learn, random-forest, feature-selection | 1,365,076,383 |
se_74226688 | stackoverflow | MACHINE_LEARNING | error while installing scikit learn from pip | error while installing scikit learn from pip
I've been trying to install scikit learn by command pip install scikit-learn but it's showing me this error given below.
PS:
Python version 3.8.5
pip version 22.3
Error which is showing:
Collecting scikit-learn
Using cached scikit-learn-1.1.3.tar.gz (7.0 MB)
Installin... | https://stackoverflow.com/questions/74226688/error-while-installing-scikit-learn-from-pip | python, installation, scikit-learn, pip, subprocess | 1,666,895,115 |
se_12615525 | stackoverflow | MACHINE_LEARNING | What are the different use cases of joblib versus pickle? | What are the different use cases of joblib versus pickle?
Background: I'm just getting started with scikit-learn, and read at the bottom of the page about joblib, versus pickle.
it may be more interesting to use joblib’s replacement of pickle (joblib.dump & joblib.load), which is more efficient on big data, but c... | https://stackoverflow.com/questions/12615525/what-are-the-different-use-cases-of-joblib-versus-pickle | python, pickle, scikit-learn | 1,348,727,985 |
se_79946943 | stackoverflow | MACHINE_LEARNING | PyCaret 3.4.0 and scikit-learn return different results | PyCaret 3.4.0 and scikit-learn return different results
I am currently working with PyCaret 3.4.0, since 4.0 lacks some configuration parameters that are useful for my case.
I tried to replicate PyCaret results using scikit-learn.
This is my script, after running Pycaret's setup and obtaining the transformed data:
com... | https://stackoverflow.com/questions/79946943/pycaret-3-4-0-and-scikit-learn-return-different-results | python, machine-learning, scikit-learn, pycaret | 1,779,822,942 |
se_50656471 | stackoverflow | MACHINE_LEARNING | estimator should be an estimator implementing 'fit' method | estimator should be an estimator implementing 'fit' method
when I try to run the code in python I encounter this problem , how can I solve it?
---> 95 validation(sm_classifier, x_test_normal_s, y_n2_test, y_test, classes_names, ' NSLKDD SAE-SAE(test)')
96 #if __name__ == "__main__":main() ##... | https://stackoverflow.com/questions/50656471/estimator-should-be-an-estimator-implementing-fit-method | python, scikit-learn | 1,527,939,177 |
se_79943963 | stackoverflow | MACHINE_LEARNING | uncommon "setting an array with a sequence" error | uncommon "setting an array with a sequence" error
im struggle with an error when creating MRE.
why these code :
from pandas import DataFrame as df
import numpy as np
from sklearn.neighbors import NearestNeighbors as nrb
from sklearn.decomposition import PCA
from pandas import pivot_table
dummy_df = df({"no"... | https://stackoverflow.com/questions/79943963/uncommon-setting-an-array-with-a-sequence-error | python, arrays, numpy, scikit-learn, nearest-neighbor | 1,779,272,317 |
se_79935400 | stackoverflow | MACHINE_LEARNING | KDTree 2d index searching based on pivot_table vector error | KDTree 2d index searching based on pivot_table vector error
i want find 2d index(from PCA). based on pivot_table vector at my custom metric. fastly. that's why im using KDTree. but because it, these error is occur:
ValueError Traceback (most recent call last)
/tmp/ipykernel_9428/753399497.py in <cell line: 0>()
... | https://stackoverflow.com/questions/79935400/kdtree-2d-index-searching-based-on-pivot-table-vector-error | python, numpy, machine-learning, scikit-learn, pca | 1,777,807,145 |
se_79945000 | stackoverflow | MACHINE_LEARNING | Rationale for StandardScaler over MinMaxScaler in spatiotemporal tree-based ensemble models with SHAP interpretability | Rationale for StandardScaler over MinMaxScaler in spatiotemporal tree-based ensemble models with SHAP interpretability
I am developing a spatiotemporal tree-based ensemble framework (utilizing LightGBM, XGBoost, and CatBoost) to forecast dengue outbreaks based on climate variables (temperature, precipitation, humidity... | https://stackoverflow.com/questions/79945000/rationale-for-standardscaler-over-minmaxscaler-in-spatiotemporal-tree-based-ense | python, machine-learning, scikit-learn, xgboost, lightgbm | 1,779,428,707 |
se_79942808 | stackoverflow | MACHINE_LEARNING | What is the difference between SciPy's KNN and Scikit-Learn's KNN? | What is the difference between SciPy's KNN and Scikit-Learn's KNN?
I would like to understand the difference between the KNN algorithm as implemented in scikit-learn (for example, using the kdtree algorithm)
https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsRegressor.html
and the on... | https://stackoverflow.com/questions/79942808/what-is-the-difference-between-scipys-knn-and-scikit-learns-knn | python, scikit-learn, scipy | 1,779,090,532 |
se_75744615 | stackoverflow | MACHINE_LEARNING | Which solver is throwing this warning? | Which solver is throwing this warning?
This warning pops up 10 times. The line number varies between 456 and 305:
C:\Users\foo\Anaconda3\lib\site-packages\scipy\optimize\_linesearch.py:456: LineSearchWarning: The line search algorithm did not converge
warn('The line search algorithm did not converge', LineSearchWarn... | https://stackoverflow.com/questions/75744615/which-solver-is-throwing-this-warning | scikit-learn, scipy, logistic-regression | 1,678,882,823 |
se_66181731 | stackoverflow | MACHINE_LEARNING | LineSearchWarning: The line search algorithm did not converge | LineSearchWarning: The line search algorithm did not converge
I have done hyperparameter tuning using logistic regression and I get the error the line search algorithm did not converge. HOw do I resolve this error?
# grid searching key hyperparametres for logistic regression
# define models and parameters
lr_model =... | https://stackoverflow.com/questions/66181731/linesearchwarning-the-line-search-algorithm-did-not-converge | python, machine-learning, scikit-learn | 1,613,189,422 |
se_79942551 | stackoverflow | MACHINE_LEARNING | ValueError: pos_label=1 is not a valid label: It should be one of [0] | ValueError: pos_label=1 is not a valid label: It should be one of [0]
When executing this code:
import matplotlib.pyplot as plt
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import LearningCurveDisplay, train_test_split
from imblearn.datasets import fetch_dataset... | https://stackoverflow.com/questions/79942551/valueerror-pos-label-1-is-not-a-valid-label-it-should-be-one-of-0 | python, scikit-learn | 1,779,035,409 |
se_78341395 | stackoverflow | MACHINE_LEARNING | Exception Type: ValueError: node array from the pickle has an incompatible dtype | Exception Type: ValueError: node array from the pickle has an incompatible dtype
So I copied a DjangoML project from Github. The ML model is essentially a diagnosis system that predicts whether or not a patient is at risk based on the values of their blood tests.
I'm running this project locally in VSCode but have yet... | https://stackoverflow.com/questions/78341395/exception-type-valueerror-node-array-from-the-pickle-has-an-incompatible-dtype | python-3.x, django, scikit-learn, pickle | 1,713,361,007 |
se_79763327 | stackoverflow | MACHINE_LEARNING | How to correct 3rd party sphinx ambiguous cross-reference warnings? | 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
sklearn.utils._set_output._SetOutputMixin.set_output:6... | https://stackoverflow.com/questions/79763327/how-to-correct-3rd-party-sphinx-ambiguous-cross-reference-warnings | python, scikit-learn, python-sphinx | 1,757,709,183 |
se_34524084 | stackoverflow | MACHINE_LEARNING | Can't import from sklearn.linear_model import LinearRegression | Can't import from sklearn.linear_model import LinearRegression
I have been using iPython notebook to use sklearn for a few months now with no problem and suddenly I can't get the command:
from sklearn.linear_model import LinearRegression
to work. I get the error:
--------------------------------------------... | https://stackoverflow.com/questions/34524084/cant-import-from-sklearn-linear-model-import-linearregression | python, scikit-learn | 1,451,456,630 |
se_79925354 | stackoverflow | MACHINE_LEARNING | What are the key libraries and documentation for implementing anomaly detection in Python? | What are the key libraries and documentation for implementing anomaly detection in Python?
I am starting a role in industry where I will be working on anomaly detection using machine learning, particularly for data analysis tasks.
I would like to understand which tools and libraries are most commonly used in practice,... | https://stackoverflow.com/questions/79925354/what-are-the-key-libraries-and-documentation-for-implementing-anomaly-detection | python, machine-learning, scikit-learn, anomaly-detection | 1,776,169,589 |
se_38749305 | stackoverflow | MACHINE_LEARNING | LabelEncoder order of fit for a Pandas df | LabelEncoder order of fit for a Pandas df
I am fitting a scikit-learn LabelEncoder on a column in a pandas df.
How is the order, in which the encountered strings are mapped to the integers, determined? Is it deterministic?
More importantly, can I specify this order?
import pandas as pd
from sklearn import preproce... | https://stackoverflow.com/questions/38749305/labelencoder-order-of-fit-for-a-pandas-df | python, pandas, scikit-learn | 1,470,242,481 |
se_25902119 | stackoverflow | MACHINE_LEARNING | How to read the output of scikit-learn TfidfVectorizer | How to read the output of scikit-learn TfidfVectorizer
I was reading about TfidfVectorizer implementation of scikit-learn. For example:
new_docs = ['He watches basketball and baseball', 'Julie likes to play basketball', 'Jane loves to play baseball']
new_term_freq_matrix = tfidf_vectorizer.transform(new_docs)
print tf... | https://stackoverflow.com/questions/25902119/how-to-read-the-output-of-scikit-learn-tfidfvectorizer | python, machine-learning, scikit-learn, nlp, feature-extraction | 1,410,997,834 |
se_63801350 | stackoverflow | MACHINE_LEARNING | OneHotEncoding Categorical data | OneHotEncoding Categorical data
I am trying to use OneHotEncoding to transform the second column of my csv file, which consists of company names.
from sklearn.preprocessing import OneHotEncoder
ct = ColumnTransformer(transformers=[('encoder', OneHotEncoder(), [1])]), remainder='passthrough'
X = np.array(ct.fit_transfo... | https://stackoverflow.com/questions/63801350/onehotencoding-categorical-data | python, scikit-learn, neural-network, one-hot-encoding | 1,599,598,034 |
se_57251084 | stackoverflow | MACHINE_LEARNING | The Difference between One Hot Encoding and LabelEncoder? | The Difference between One Hot Encoding and LabelEncoder?
I am working on a ML problem to predict house prices and Zip Code is one feature which will be useful. I am also trying to use Random Forest Regressor to predict the log of the price.
However, should I use One Hot Encoding or Label Encoder for Zip Code? Becaus... | https://stackoverflow.com/questions/57251084/the-difference-between-one-hot-encoding-and-labelencoder | machine-learning, scikit-learn, categorical-data, one-hot-encoding | 1,564,393,269 |
se_50473381 | stackoverflow | MACHINE_LEARNING | Scikit-learn's LabelBinarizer vs. OneHotEncoder | Scikit-learn's LabelBinarizer vs. OneHotEncoder
What is the difference between the two? It seems that both create new columns, which their number is equal to the number of unique categories in the feature. Then they assign 0 and 1 to data points depending on what category they are in. | https://stackoverflow.com/questions/50473381/scikit-learns-labelbinarizer-vs-onehotencoder | python, encoding, scikit-learn, data-science, categorical-data | 1,527,009,910 |
se_79922326 | stackoverflow | MACHINE_LEARNING | How to make a 2 Label Confusion Matrix and exporting into a json file? | How to make a 2 Label Confusion Matrix and exporting into a json file?
I have to train a convolutional neural network on a dataset. The NN itself works and does what it's supposed to but now I want to make a confusion matrix and export it into a json file for further viewing.
I tried using the ConfusionMatrix function... | https://stackoverflow.com/questions/79922326/how-to-make-a-2-label-confusion-matrix-and-exporting-into-a-json-file | python, machine-learning, scikit-learn, pytorch | 1,775,663,708 |
se_37976564 | stackoverflow | MACHINE_LEARNING | Simple plots of eigenvectors for sklearn.decomposition.PCA | Simple plots of eigenvectors for sklearn.decomposition.PCA
I'm trying to understand how Principal Component Analysis works and I am testing it on the sklearn.datasets.load_iris dataset. I understand how each step works (e.g. standardize the data, covariance, eigendecomposition, sort for highest eigenvalue, transform ... | https://stackoverflow.com/questions/37976564/simple-plots-of-eigenvectors-for-sklearn-decomposition-pca | python, matplotlib, machine-learning, scikit-learn, pca | 1,466,623,215 |
se_79918389 | stackoverflow | MACHINE_LEARNING | Sklearn Pipelines, adding features and column transformers | Sklearn Pipelines, adding features and column transformers
I'm just trying out/experimenting with sklearn. I'm using the California housing dataset, and I'm trying to make a pipeline to create some additional features, then take the logarithm of some features, then scale all of the numerical features. It's pretty quic... | https://stackoverflow.com/questions/79918389/sklearn-pipelines-adding-features-and-column-transformers | python, scikit-learn, data-science | 1,775,048,341 |
se_79907381 | stackoverflow | MACHINE_LEARNING | Fitting linear regression and computing metrics in python | Fitting linear regression and computing metrics in python
I have two data series of model prediction and observations. I am able to make line plots of these series. I would like to add a linear regression fit of the two data series. i would also like to add metrics as annotations to the plot. i need assistance how to ... | https://stackoverflow.com/questions/79907381/fitting-linear-regression-and-computing-metrics-in-python | python, pandas, scikit-learn, linear-regression | 1,773,477,002 |
se_79917240 | stackoverflow | MACHINE_LEARNING | How to cluster data based on a single value in python? | How to cluster data based on a single value in python?
I have a object data stored in a JSON:
One Drive link to json
These represent markers which I am placing on a 2D map (the lat/lng in the file are YX positions on the map).
In reality the 3D objects have an alt (Z value) that is fairly stratified, and I would like ... | https://stackoverflow.com/questions/79917240/how-to-cluster-data-based-on-a-single-value-in-python | python, scikit-learn, 3d, cluster-analysis | 1,774,888,354 |
se_57273694 | stackoverflow | MACHINE_LEARNING | How SelectKBest (chi2) calculates score? | How SelectKBest (chi2) calculates score?
I am trying to find the most valuable features by applying feature selection methods to my dataset. Im using the SelectKBest function for now. I can generate the score values and sort them as I want, but I don't understand exactly how this score value is calculated. I know that... | https://stackoverflow.com/questions/57273694/how-selectkbest-chi2-calculates-score | python, machine-learning, scikit-learn, feature-selection, chi-squared | 1,564,495,749 |
se_79915504 | stackoverflow | MACHINE_LEARNING | Generic sklearn template | Generic sklearn template
I am creating a reusable scikit-learn pipeline for tabular data with numeric and categorical columns.
I want to:
Impute missing numeric values with the median
Scale numeric columns
Impute categorical values with the most frequent value
One-hot encode categorical columns
Here is my curren... | https://stackoverflow.com/questions/79915504/generic-sklearn-template | python, pandas, machine-learning, scikit-learn | 1,774,592,450 |
se_79873837 | stackoverflow | MACHINE_LEARNING | Numpy axis rules | Numpy axis rules
I am a Python developer, but I don't understand one thing: what are the numpy axis? Sometimes, when I use Sklearn, I have errors about axis. And I need explanations about values and reshape functions. | https://stackoverflow.com/questions/79873837/numpy-axis-rules | python, pandas, dataframe, numpy, scikit-learn | 1,769,092,188 |
se_79915481 | stackoverflow | MACHINE_LEARNING | Is this modular scikit-learn pipeline design correct for a binary classification task? | Is this modular scikit-learn pipeline design correct for a binary classification task?
I'm building a modular machine learning pipeline for a binary classification problem using scikit-learn.
I structured the code into separate functions for preprocessing, scaling, and model training.
I would like to verify whether th... | https://stackoverflow.com/questions/79915481/is-this-modular-scikit-learn-pipeline-design-correct-for-a-binary-classification | python, pandas, dataframe, machine-learning, scikit-learn | 1,774,589,221 |
se_63649503 | stackoverflow | MACHINE_LEARNING | AttributeError: 'Functional' object has no attribute 'predict_proba' | AttributeError: 'Functional' object has no attribute 'predict_proba'
For printing the ROC curve with multiple models, I am facing this particular error. Help is needed
from tensorflow.keras.models import load_model
def dense():
return (load_model('DenseNet201.h5'))
def mobile():
ret... | https://stackoverflow.com/questions/63649503/attributeerror-functional-object-has-no-attribute-predict-proba | python, matplotlib, scikit-learn, roc | 1,598,719,689 |
se_79915485 | stackoverflow | MACHINE_LEARNING | XGBoost Pipeline with ColumnTransformer: Handling categorical + numerical data and improving accuracy | XGBoost Pipeline with ColumnTransformer: Handling categorical + numerical data and improving accuracy
I am building a classification model using XGBoost with a Scikit-learn Pipeline that includes preprocessing for both numerical and categorical features.
import pandas as pd
import numpy as np
from xgboost import XGBCl... | https://stackoverflow.com/questions/79915485/xgboost-pipeline-with-columntransformer-handling-categorical-numerical-data-a | python, pandas, machine-learning, scikit-learn | 1,774,589,704 |
se_72322579 | stackoverflow | MACHINE_LEARNING | How to fix error with importing skforecast using Jupyter | How to fix error with importing skforecast using Jupyter
When I use pip install skforecast in Jupyter, the install completes successfully.
Next, when I use from skforecast.ForecasterAutoreg import ForecasterAutoreg I get the following error:
ModuleNotFoundError: No module named 'skforecast'
I have tried pip and pip3... | https://stackoverflow.com/questions/72322579/how-to-fix-error-with-importing-skforecast-using-jupyter | python, scikit-learn, jupyter-notebook | 1,653,066,880 |
se_63967530 | stackoverflow | MACHINE_LEARNING | ImportError: cannot import name 'plot_confusion_matrix' from 'sklearn.metrics' | ImportError: cannot import name 'plot_confusion_matrix' from 'sklearn.metrics'
I am attempting to run below code.
from sklearn.metrics import plot_confusion_matrix
And I am receiving below error.
---------------------------------------------------------------------------
ImportError ... | https://stackoverflow.com/questions/63967530/importerror-cannot-import-name-plot-confusion-matrix-from-sklearn-metrics | python, scikit-learn, confusion-matrix | 1,600,509,873 |
se_42603772 | stackoverflow | MACHINE_LEARNING | Create a dataframe from cross-validation scores | Create a dataframe from cross-validation scores
I have a dataset stored in a variable, file, and I try to apply 10 fold cross-validation with logistic regression. What I am looking for is the way to list the average of clf.coef_.
print(file.head())
Result Interest Limit Service Convenience Trust Speed
0 ... | https://stackoverflow.com/questions/42603772/create-a-dataframe-from-cross-validation-scores | python, pandas, scikit-learn, cross-validation | 1,488,680,706 |
se_76650079 | stackoverflow | MACHINE_LEARNING | Difference between predict() and predict_proba() functions in scikit learn | Difference between predict() and predict_proba() functions in scikit learn
After training a tree:
clf = DecisionTreeClassifier()
clf.fit(Xtrain, ytrain)
I have decided to test its performance on the training data itself (just to compare, later, with the test data, in terms of Sensitivity Specificity and ROC-AUC). But... | https://stackoverflow.com/questions/76650079/difference-between-predict-and-predict-proba-functions-in-scikit-learn | python, scikit-learn, statistics, data-science | 1,688,949,463 |
se_57464134 | stackoverflow | MACHINE_LEARNING | How does the MAE and MSE criterion affect the way a tree splits in scikit's RandomForestRegressor() | How does the MAE and MSE criterion affect the way a tree splits in scikit's RandomForestRegressor()
I want to understand what actually happens when a node splits depending on the chosen 'criterion' in the latest scikit version of RandomForestRegressor (RFR).
RandomForestClassifier() has criterion options such as ... | https://stackoverflow.com/questions/57464134/how-does-the-mae-and-mse-criterion-affect-the-way-a-tree-splits-in-scikits-rand | python, machine-learning, scikit-learn, regression, random-forest | 1,565,623,923 |
se_50230385 | stackoverflow | MACHINE_LEARNING | How to get accuracy for all the predicted class labels | How to get accuracy for all the predicted class labels
How can I find the overall accuracy of the outputs that we got by running a decision tree algorithm.I am able to get the top five class labels for the active user input but I am getting the accuracy for the X_train and Y_train dataset using accuracy_score().Suppos... | https://stackoverflow.com/questions/50230385/how-to-get-accuracy-for-all-the-predicted-class-labels | python, machine-learning, scikit-learn | 1,525,771,900 |
se_79900176 | stackoverflow | MACHINE_LEARNING | How to maintain feature alignment when passing a custom model wrapper to SHAP KernelExplainer? | How to maintain feature alignment when passing a custom model wrapper to SHAP KernelExplainer?
I'm working on an Explainable AI (XAI) project where I compare different model-agnostic frameworks (SHAP, LIME, DALEX). I'm using a custom wrapper to standardize my model's output (similar to a Scikit-Learn pipeline) to ensu... | https://stackoverflow.com/questions/79900176/how-to-maintain-feature-alignment-when-passing-a-custom-model-wrapper-to-shap-ke | python, pandas, scikit-learn | 1,772,546,110 |
se_79900391 | stackoverflow | MACHINE_LEARNING | sklearn_boilerplate anything else should be included for everyday use? | sklearn_boilerplate anything else should be included for everyday use?
this are sklearn imports I use in every notebook, is anything else to be included for everyday use?
import numpy as np
import pandas as pd
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import OneHotEncoder, StandardScaler, Mi... | https://stackoverflow.com/questions/79900391/sklearn-boilerplate-anything-else-should-be-included-for-everyday-use | scikit-learn, import | 1,772,566,362 |
se_79876537 | stackoverflow | MACHINE_LEARNING | How to identify users' profiles based on the output uplift values | How to identify users' profiles based on the output uplift values
I am currently learning the Causal Forest algorithm in Python. In an exercise, I need to evaluate a marketing campaign where a certain group of users have already received coupons. Given that Y is the list of expense of each user, T is the list of b... | https://stackoverflow.com/questions/79876537/how-to-identify-users-profiles-based-on-the-output-uplift-values | python, machine-learning, scikit-learn | 1,769,448,106 |
se_46603513 | stackoverflow | MACHINE_LEARNING | Nested cross-validation example on Scikit-learn | Nested cross-validation example on Scikit-learn
I'm trying to work my head around the example of Nested vs. Non-Nested CV in Sklearn. I checked multiple answers but I am still confused on the example.
To my knowledge, a nested CV aims to use a different subset of data to select the best parameters of a classifier (e.g... | https://stackoverflow.com/questions/46603513/nested-cross-validation-example-on-scikit-learn | python, scikit-learn, nested, cross-validation, grid-search | 1,507,285,131 |
se_58265633 | stackoverflow | MACHINE_LEARNING | What's the difference between df.iloc[:,1:2].values and df.iloc[:,1].values in pandas? | What's the difference between df.iloc[:,1:2].values and df.iloc[:,1].values in pandas?
When I used x = dataset.iloc[:,1:2].values and later on in my code
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
dataset = pd.read_csv('Position_Salaries.csv')
x = dataset.iloc[:,1:2].values #look here p... | https://stackoverflow.com/questions/58265633/whats-the-difference-between-df-iloc-12-values-and-df-iloc-1-values-in-p | python, pandas, scikit-learn | 1,570,435,660 |
se_40298966 | stackoverflow | MACHINE_LEARNING | How to handle nominal data in scikit learn, python? | How to handle nominal data in scikit learn, python?
I am new to data mining. I have a data set which includes directors' names. What is the right way to convert them to something that Scikit learn estimators can use without problem?
From what I found on the internet I thought that sklearn.preprocessing.LabelEncoder ... | https://stackoverflow.com/questions/40298966/how-to-handle-nominal-data-in-scikit-learn-python | python, scikit-learn, data-mining, categorical-data | 1,477,634,695 |
se_38989896 | stackoverflow | MACHINE_LEARNING | How to install scikit-learn | How to install scikit-learn
I know how to install external modules using the pip command but for Scikit-learn I need to install NumPy and Matplotlib as well.
How can I install these modules using the pip command? | https://stackoverflow.com/questions/38989896/how-to-install-scikit-learn | python, windows, scikit-learn | 1,471,416,569 |
se_79867833 | stackoverflow | MACHINE_LEARNING | What does PoissonRegression.predict() actually return in sklearn? | What does PoissonRegression.predict() actually return in sklearn?
What is being returned by PoissonRegression.predict() in sklearn when I am predicting target values from data? Is it the actual predicted value of the target? | https://stackoverflow.com/questions/79867833/what-does-poissonregression-predict-actually-return-in-sklearn | scikit-learn, prediction, poisson | 1,768,401,166 |
se_62646058 | stackoverflow | MACHINE_LEARNING | How does the predict method work on scikit-learn? | How does the predict method work on scikit-learn?
How does the predict() method in scikit-learn work? Does it return random values or is there a calculation under the hood? | https://stackoverflow.com/questions/62646058/how-does-the-predict-method-work-on-scikit-learn | python, machine-learning, scikit-learn, supervised-learning | 1,593,461,890 |
se_47664061 | stackoverflow | MACHINE_LEARNING | How to apply Polynomial Transformation to subset of features in scikitlearn | How to apply Polynomial Transformation to subset of features in scikitlearn
Scikitlearn's PolynomialFeatures facilitates polynomial feature generation.
Here is a simple example:
import numpy as np
import pandas as pd
from sklearn.preprocessing import PolynomialFeatures
# Example data:
X = np.arange(6).reshape(3, 2... | https://stackoverflow.com/questions/47664061/how-to-apply-polynomial-transformation-to-subset-of-features-in-scikitlearn | python, scikit-learn | 1,512,514,713 |
se_55113978 | stackoverflow | MACHINE_LEARNING | What is the difference between Freidman mse and mse? | What is the difference between Freidman mse and mse?
I'm looking into a GradientBoostingClassifier in sklearn. Then, I found there are 3 kind of criterion. Friedman mse, mse, mae.
the descriptions provided by sklearn are:
The function to measure the quality of a split. Supported criteria are “friedman_mse” for the... | https://stackoverflow.com/questions/55113978/what-is-the-difference-between-freidman-mse-and-mse | scikit-learn, statistics | 1,552,363,440 |
se_48079973 | stackoverflow | MACHINE_LEARNING | XGBOOST: sample_Weights vs scale_pos_weight | XGBOOST: sample_Weights vs scale_pos_weight
I have a highly unbalanced dataset and am wondering where to account for the weights, and thus am trying to comprehend the difference between scale_pos_weight argument in XGBClassifier and the sample_weight parameter of the fit method. Would appreciate an intuitive explanati... | https://stackoverflow.com/questions/48079973/xgboost-sample-weights-vs-scale-pos-weight | python, scikit-learn, xgboost | 1,514,991,788 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.