Part A: Build a classification model using text data
For Part A, you will be solving a text classification task. The training data is stored in the Homework 4 Data folder. The data consists of headlines that have beenlabeled for whether they are clickbait.
1. Import the data. The headlines will become your vectorized X matrix, and the labels indicate a binary classification (clickbait or not).
2. Convert the headline data into an X feature matrix using a simple bag of words approach.
3. Run logistic regression to predict clickbait headlines. Remember to train_test_split your data and use GridSearchCV to find the best value of C. You should
evaluate your data with F1 scoring.
4. Run 2 more logistic regression models by changing the vectorization approach (e.g. using n-grams, stop_words, and other techniques we discussed). In
both cases, keep your logistic regression step the same. Only change how you’re generating the X matrix from the text data.
5. Which of your 3 models performed best? What are the most significant coefficients in each, and how do they compare?
Part B: Build a Predictive Neural Network Using Keras
In Part B, you will run a multilayer perceptron on the iris dataset to predict flower type.
1. Load the data. Data can be imported directly using pd.read_csv() and the link http://vincentarelbundock.github.io/Rdatasets/csv/datasets/iris.csv.
2. Using the Sequential interface in Keras, build a model with 2 hidden layers with 16 neurons in each. Compile and fit the model. Assess its performance usingaccuracy on data that has been train_test_split.
3. Run 2 additional models using different numbers of hidden layers and/or hidden neurons.
4. How does the performance compare between your 3 models?
Part A
Part B
Send
5073, Homework, Models, Networks, Neural, QMSS, solved, Text
[SOLVED] Qmss 5073 homework 4: text models & neural networks
$25
File Name: Qmss_5073_homework_4__text_models___neural_networks.zip
File Size: 480.42 KB
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.