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: the first column is the class label yspam or ham; the second column is the content in each email, and transform this raw content to TFIDF feature vector X
Randomly partition the data into training set and testing set
Build the multilayer 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, fscore, etc.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
