
Hi Guys, I am trying to create a training, validation and test dataset in python for bike sharing dataset using Object oriented programming.
I have first created a method called "DATALOADER" to read the file and then split the data into train, validation and test set. However, I am facing some challenges while executing the code.
Pasting the code above and error response below. Need some help with that.
Error Message: **--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-29-29ec681918b0> in <module> ----> 1 dataloader = Dataloader('C:/Users/pbhal/Downloads/hour.csv/hour.csv') 2 train, val, test = dataloader.getData() 3 fullData = dataloader.getFullData() 4 5 category_features = ['season', 'holiday', 'mnth', 'hr', 'weekday', 'workingday', 'weathersit']
TypeError: Dataloader() takes no arguments**
I was trying to create a train, validation and test set out of hour.csv datafile. However , it did not work out
uj5u.com熱心網友回復:
你有一個錯字,你應該使用__init__(兩個下劃線)而不是_init_. 這意味著您的類沒有定義初始化方法,并且回退(object我認為是 Python 類)沒有收到任何引數。
您可以驗證這是一個小的空類的問題:
class Example:
pass
a = Example() # Works
b = Example(1) # Failes with "TypeError: Example() takes no arguments"
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/450763.html
上一篇:針對不同型別的算術運算子多載c
