Question: Read the data from the csv file spam.csv , and create a dataframe object. Build the dataset ( X , y ) as follows:

Read the data from the csv file "spam.csv", and create a dataframe object.
Build the dataset (X, y) as follows: (1) the first column is the class label "y"(spam or ham); 2the second column is the content in each email, and transform this raw content to TF-IDF feature vector "X".
Randomly partition the data into training set (60%) and testing set (40%).
Build the multi-layer perceptron (MLP) model (design the network architecutre of MLP by yourself) using training set, and apply the pretrained model to predict the class label (spam or ham) of each data point in testing set.
Analyze the predicted results using confusion matrix and evaluation metrics such as accuracy, precision, recall, f1-score, etc.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!