Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

python 3.6 with ftlearn and skit-learn I tried to read csv file and build model

ID: 3598844 • Letter: P

Question

python 3.6 with ftlearn and skit-learn

I tried to read csv file and build model using CNN but that gave me error to read that data set

I have nine coulmns in my csv file and last coulm is class label which is 0,1

# Load CSV file, indicate that the last column represents labels
from tflearn.data_utils import load_csv
data, labels = load_csv('car.csv', target_column=0,
                        categorical_labels=True, n_classes=2)

# Build neural network
net = tflearn.input_data(shape=[None, 8])
net = tflearn.fully_connected(net, 32)
net = tflearn.fully_connected(net, 32)
net = tflearn.fully_connected(net, 2, activation='softmax')
net = tflearn.regression(net)

# Define model
model = tflearn.DNN(net)
# Start training (apply gradient descent algorithm)
model.fit(data, labels, n_epoch=10, batch_size=16, show_metric=True)

types of error:

How can I fix that error ?

Thanks

Explanation / Answer

This error highly depends on the environmental setup of the system. In your system you may not have the environment variables in the correct name, so only this error was occuring.

you need to get the proper directory and use in the comment to overcome this issue, since you've not posted the csv file it is not possible to give you the get directory line of code.

Also kindly check if you're using any functions in the code that needs to return any value. Because,'NoneType' has no len(), indicates there is no return value for function.