Skip to main content

Questions tagged [pickle]

Pickle is a common way of serializing objects in Python. It is mostly used to save trained machine learning models

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

scikit-learn upgrade - how to fix breaking change?

i've inherated a solution that runs in databricks runtime 7.3, and it is using scikit-learn 0.21. Databricks runtime must be upgraded, and so existing scikit-learn version is not compatible with ...
otk's user avatar
  • 101
2 votes
1 answer
168 views

ValueError when loading sklearn DecisionTreeClassifier pickle in Python 3.10

I'm encountering an issue while transitioning from Python 3.7.3 to Python 3.10 due to the deprecation of the older version. The problem arises when attempting to load a pickled sklearn ...
user3369545's user avatar
1 vote
0 answers
24 views

saving ML models with pickle to be deployed using Flask

I trained some ensemble Ml to predict, I needed to save with pickle so as to be able to deploy using Flask. To save with pickle I have tried several methods and read several articles but could not get ...
Kehinde Olatunji's user avatar
0 votes
0 answers
187 views

Can we extract data types of features/variables from pickled model for Logistic Regression, Decision Tree, Random Forest?

I am trying to extract data types of variables/features from a pickled ML model file. I could see there is no information of the data types of variables in pickle file except for XG Boost. Is there ...
Bhageerath Nayini's user avatar
1 vote
1 answer
11k views

How can I solve it ,TypeError: cannot pickle 'dict_keys' object?

My code: ...
Tariq Hussain's user avatar
1 vote
1 answer
1k views

Can anyone help with me how to train new data with already saved pickle file? [closed]

Can anyone help me with the code me to train new data with already saved pickle file? I've trained the model with RandomForestClassifier from sklearn and saved the model into .pickle Now I'm trying to ...
Nithin Reddy's user avatar
3 votes
2 answers
4k views

Why we use Pickle instead of saving the weights in HDF5 format in Deep Learning

I have read that, Pickle library is used to save trained model into a .pkl file to use it later. Also, we can save the weights of a trained model into a hdf5 format using ...
Shiv's user avatar
  • 709
1 vote
1 answer
683 views

Drastic increase in accuracy while using pickle file with sklearn

I trained a xgboost classifier and it gave an accuracy of 49.99 % and i saved that model into a pickle file. When i ran the same data with pickle file (.pkl) it's giving an accuracy of 88.99 percent. ...
Nithin Reddy's user avatar
0 votes
1 answer
387 views

Convert bin model to pickle [closed]

I trained a word2vec model using Gensim library which is of type .bin Q1: can we convert this trained model in bin format to pickle? Q2: would it speed up the execution time?
Vinay Sharma's user avatar
1 vote
3 answers
11k views

PicklingError in pyspark (PicklingError: Can't pickle <class '__main__.Person'>: attribute lookup Person on __main__ failed)

I am unable to pickle the below class. I am using data bricks 6.5 ML (includes Apache Spark 2.4.5, Scala 2.11) ...
kamal kumawat's user avatar
1 vote
1 answer
21 views

extract classifier properties from pickled file

I have *.clf file which I get from fit() of sklearn. I fit my data with ...
mend4x's user avatar
  • 113
3 votes
1 answer
10k views

No module named "" error when loading the pickle file

I created a model and I saved it in a pickle file using the Algorithm SVR(Support Vector Regression) ...
HelloWorld's user avatar
1 vote
1 answer
6k views

TypeError: 'GridSearchCV' object is not callable - how do I use a pickle of an SVM (Scikit-learn)?

I have created an SVM in Scikit-learn for classification. It works; it prints out either 1 or 0 depending on the class. I converted it to a pickle file and tried to use it, but I am receiving this ...
Finn Williams's user avatar
1 vote
2 answers
2k views

Attribute error when loading pickle file in python jupyter notebook

I have created a config file with the following code for an object detection task and saved in the local disk. ...
Malathi's user avatar
  • 135
0 votes
1 answer
20k views

How to save/load a Model (Pickle) with a specific path/directory

I seems like a very basic think but I couldnt find an answer to it. I want to save my model to a specific directory using pickle. The two algorithms below work fine for saving it in the same ...
G.M's user avatar
  • 181
1 vote
1 answer
1k views

Using a trained Model from Pickle

I trained and saved a model that should predict a sons hight based on his fathers height. I then saved the model to Pickle. I can now load the model and want to use it but unfortunately a second ...
G.M's user avatar
  • 181
1 vote
1 answer
178 views

Transform test data when using a persistent model

I'm quite new to data science and only slowly following the necessary steps to get valid results using scikit-learn. As far as I understand you fit and transform the training data and only transform ...
Daten_Raten's user avatar
0 votes
2 answers
959 views

The actual results and results from pickle files are not matching in pandas for DBSCAN clustering

I've built a DBSCAN clustering model. The output result and the result after using the pickle files are not matching. Based on HD and MC column, I am clustering WT column. ...
anagha s's user avatar
  • 111
0 votes
0 answers
329 views

Can I update my model using partial_fit after training my model using fit?

I have trained my model using MLPClassifier using fit method and saving in pickle object for the first time. ...
Shanmuga PriyaV sp's user avatar
0 votes
0 answers
74 views

Should I load my model pkl object every time when I predict?

I am predicting the data in real time , when I hit the url it should predict but I should not load my model again and again . Can someone help to optimize the code ? Can I load globally or how can I ...
Shanmuga PriyaV sp's user avatar