#—————————————— #—————————————— ############## Homework #6 ##############

#——————————————

#——————————————

Haven’t Found The Relevant Content? Hire a Subject Expert to Help You With
#—————————————— #—————————————— ############## Homework #6 ##############
Post Your Own Question And Get A Custom Answer
Hire Writer

############## Homework #6 ##############

#——————————————

#——————————————

# Directions: cluster a sample of Amazon product

# reviews. Your sample will include 250 automotive products

# from a population of over 20,000 amazon product reviews, with

# corresponding product information.

#——————————————

######### Preliminary Code #########

#——————————————

#——————————————

## Get/Set Your Working Directory

#——————————————

#——————————————

## Load Packages (libraries)

#——————————————

library(tm)

library(cluster)

#——————————————

## Load Functions & Data (.RData File)

load(“HW6-1.RData”)

#——————————————

# load the data used in this HW

load(“HW6-1.RData”)

# load the cluster functions

load(“clusterFunctions.RData”)

#——————————————

######### Solutions #########

#——————————————

## 1. First, learn about the objects that you loaded into your

# workspace. Next, set your birthday seed, before running the code in the

# answer section. In words, describe what is this code doing.

#——————————————

## ANSWER 1##

# Set your seed.

products <- sample(unique(autorevs$asin), 250, replace=FALSE)

docs <- autorevs$doc_id[autorevs$asin %in% products]

#

#——————————————

## 2. Next, create a TDM and dataframe subsets based on

# the docs and products vectors created in step 1.

# How many documents are in your subsets?

#——————————————

## ANSWER 2##

#——————————————

## 3. First, we will cluster review text to find clusters of terms.

# First, create the distance matrix. Use the dist() function to create

# a distance matrix for the automotive review terms named rev_tdist.

# Then, perform hierarchical clustering using Ward’s Method.

#——————————————

## ANSWER 3##

#——————————————

## 4. Evaluate the best number of clusters, k, using plots of the average

# silhouette width and within-cluster SSE across k values to guide your choice.

# Consider k values up to 15. Based on your plots, how many clusters would your choose?

#——————————————

## ANSWER 4##

#——————————————

## 5. Based on your chosen k in answer 4, cut your dendogram. Plot the

# distribution of terms. Are the terms evenly distributed across clusters?

#——————————————

## ANSWER 5##

#——————————————

## 6. Choose one of the clusters and view the terms in that cluster. Do

# they appear to be related? Explain.

#——————————————

## ANSWER 6##

#——————————————

## 7. Next, we will apply kmeans clustering to the documents. First, use the

# plot of the average silhouette width across k values up to 25 to choose

# the optimal k.

#——————————————

## ANSWER 7##

#——————————————

## 8. Use your choice of k from answer 7 and perform kmeans clustering. Plot

# the distribution of documents. Then, use the doc_clus_overview() function

# to view the cluster size and the most important terms in each cluster.

# Hint: don’t forget to apply the function to the DTM, not TDM!

# Hint 2: dont forget to set your seed!

#——————————————

## ANSWER 8##

#——————————————

## 9. Now that we know a little more about the naturally existing clusters

# of terms and documents, explore your dataframe subset further. Use

# summary(), table(), etc. to learn more about your metadata. Are there

# any variables that may help you to understand the clustering solution?

# Which ones? Explain.

#——————————————

## ANSWER 9##

Why Hire a Professional Essay Writer from MyHomeworkGeeks

Quality Urgent Essays

Domyhomeworkk online platform provides the best essay writing service ever received elsewhere, thanks to our professional essay writers. Experience gained in the 10+ years of being in the assignment writing industry is also an added advantage.

Professional and Experienced Academic Writers

A lot is done to maintain us as the best essay writing service provider. Besides owning a degree from a recognized university, a writer must pass the rigorous tests we take them through before they are considered eligible to offer urgent essay help on our website.

Affordable Urgent Assignment Help

Who said a reliable website should not be cheap also? While it is human nature to associate prices with quality, that does not always work. At domyhomeworkk.com, we guarantee you cheap and urgent essay help without compromising the quality.

24/7 Available Urgent Essay Writing Service

Whether it is a ‘write my essay for me cheap’ or ‘edit my essay’ order you want to request, always feel free to reach us at any time of the day. Our experts work in shifts to ensure that you access urgent essay writing services at any time of the day.

Plagiarism Free Essays Online

The punitive measures that come with plagiarized content are so harsh, and we understand that. We consequently ensure to write each client’s papers from scratch no matter how urgent the essay is. To acknowledge borrowed content, our quick writer references and cites the work.

Wow Customer Support 24/7

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

So much stress and so little time? Take care of yourself: let us help you with your tasks. We offer all kinds of writing services.

Essays

Custom Essay Writing Services

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission and Business Papers

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Editing

Editing and Proofreading

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Coursework

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.

Have a homework question? Get help from verified tutors now!