(upbeat music)
- [Tutor] My goal was to train a machine learning model,
which would help me identify fragrance combinations
which have a tendency to become popular.
And since I did not have my own data set,
I went into AWS Data Exchange
and looked for a Retail data set product.
And I came across this Retail Data set Package
from Vertical Knowledge,
which had data from Bath & Body Works Company.
Bath & Body Works sells a lot of fragrance products.
So potentially I'll be able to use this data
to train my machine learning module.
So I subscribed to the product
and then I exported the data into an S3 bucket.
And once data was in S3 bucket,
I spun up this Jupyter Notebook
in order to perform some data analysis
and feature engineering.
So you can see that I opened this particular file,
and I looked at the different columns it had.
I loaded the data into a Panda's DataFrame,
and I dropped all the columns,
which were not relevant for my problem.
So these are the columns which I ended up retaining.
You can see that review_count, average_rating
and lasted_for.
These columns can definitely help us understand
whether the product became popular or not.
So I analyze these three columns
and I created this rule
in order to combine these three columns
into a single label column.
The product has pretty good number of reviews
and all the reviews are pretty positive.
And if the product lasted
in the market for a long time,
then it's a popular product.
So you can see,
how I took this data and formulated my problem
as a binary classification problem.
So after doing that my data set looked pretty simple.
It had a name column, it had category column,
it had label column.
So I decided to do further feature engineering
on my data set.
So I created this new column called length.
I also did some basic cleansing
on the name column.
And I also created a new column
called sub_category based on the common suffixes
in the name.
So after doing a little bit of analysis,
I thought that the data was in pretty good condition.
So I decided to generate embeddings for my data
in order to map the name column
into all feature vector space.
And you can see that each name was mapped
to a bunch of numbers.
And since the algorithm which I wanted to use
actually required all the variables to be in numeric space,
I think I was set with everything that I wanted to do.
So now that my training data set was in the format,
which is accepted by the algorithm.
I went ahead into AWS Marketplace.
And in this case, I ended up using
Decision Forest Classification Algorithm from FinTech.
However, I can also use
any other machine learning algorithm,
which can help me solve this Tableau classification problem,
including built-in algorithms from Amazon SageMaker.
Next, I loaded this data into S3,
and I specified hyper-parameters
and I trained a machine learning model.
You can see that I got auto back error of 0.299,
which was not bad for my particular use case.
I can also potentially tune the machine learning model,
but for my today's demo,
I simply decided to deploy the machine learning model,
which I had.
And then after I had deployed the machine learning model,
I used the test data set which I had kept aside
in order to see how good the machine learning model is,
and you can see that I got the accuracy of 70 percent,
which was not bad for today's demo.
So I went ahead and I did a little bit of analysis to see
how the machine learning model was responding.
For example, when I specified this particular,
name as the product name and this particular category,
the model told me that the product
is not going to become popular.
So you can see how this machine learning model
was able to extract patterns
from this third-party data from Vertical Knowledge,
in order to train a machine learning model,
which was 70 percent confident.
And this is the model which I can potentially use
for making smarter decisions.
So despite not having any of my own data set,
I was able to go into AWS Data Exchange
and identify a potential data set
that I could use for solving the problem at hand.
(upbeat music)