【发布时间】:2021-04-25 11:51:59
【问题描述】:
我正在制作 Automl 的一个对象,我正在调用函数 initial setup,它显示一个文本小部件,当提交文本时,它调用 target_submit_handler,它在内部调用 classification_setup,它调用 pycaret 库的 setup() 但是当设置函数被调用我收到文件结束错误:
from pycaret.classification import *
class AutoMl():
def __init__(self):
self.dataframe=pd.DataFrame()
self.w=None
self.setup=None
def classification_setup(self,data,target):
x=setup(self.dataframe, "Species") //this fucntion is of pycaret library which displays the end of file er
def target_submit_handler(self,text):
# print(self.dataframe,self.target.value) I am geting the correct dataframe and target column name
self.classification_setup(data=self.dataframe,target="Species")
def initial_setup(self,dataframe=None,target=None):
if(dataframe==None and target==None):
if(self.dataframe.empty!=True):
self.target = widgets.Text(description = 'Enter the target column')
self.target.on_submit(self.target_submit_handler)
display(self.target)
f=AutoMl()
f.initial_setup() //end of file error
这是文件结束错误:
【问题讨论】:
标签: python data-science ipywidgets pycaret