PyCaret ValueError - Cell is Empty

Viewed 736

I encountered an issue using PyCaret where a

ValueError: Cell is empty

is shown when I tried to create my model. Here is my code:

!pip install pycaret
 
from pycaret.utils import enable_colab 
enable_colab()
import tensorflow as tf
import numpy as np
import pandas as pd

income_data = pd.read_csv('/content/drive/MyDrive/Colab Notebooks/Adult Income/train.csv')
income_data.dropna(inplace=True, axis=0)

from pycaret.classification import *

clf1 = setup(income_data, target = 'income_>50K')
lr = create_model('lr') #Returned error

As you can see from my code, I have already dropped cells with NaN values and during the setup, the summary also showed that I did not have any missing values in my Dataframe. For reference, the dataset I was using can be downloaded here: https://www.kaggle.com/mastmustu/income?select=train.csv

1 Answers

Got this reply from the Pycaret Github page, which resolved my issue:

Hey, this is an issue with tensorflow. You need to import it after PyCaret:

from pycaret.utils import enable_colab  
enable_colab()
import numpy as np 
import pandas as pd

income_data = pd.read_csv('train.csv')
income_data.dropna(inplace=True, axis=0)

from pycaret.classification import * 
import tensorflow as tf

clf1 = setup(income_data, target = 'income_>50K') lr =
create_model('lr') 

This should work without issues.

Related