NLP Project – Analyzing Amazon Alexa Reviews

Why I am Analyzing Amazon Alexa Reviews?

Well once, I was thinking to buy Voice Controlled speaker, I was confused between Amazon Alexa and Google Mini. But to be frank I was more Inclined towards Amazon Alexa because of its Iridescent Light colors.

So this is how I got the idea to do this Project.

What Is NLP?

Formally, Natural Language Processing or NLP is defined as the application of computational techniques for the analysis and the synthesis of text. The aim of NLP is to give computers the ability to do tasks involving human language.

Uses of NLP

1) Sentiment Analysis — Finding if the text is leaning towards a positive or negative sentiment.

2) Text Classification — Categorizing text to various categories

3) Document Summarization — Compressing a paragraph/document into few words or sentences

4) Parts of Speech Tagging — Figuring out the various nouns, adverbs, verbs, etc in the text.

5) Machine translation — Translate text from one language to another

6) Named Entity Recognition — Identify the entities present in the text

7) Conversational AI — Chat with a machine in natural language and get queries resolved

Importing Libraries:

Loading and Reading the file

Describing the Data:

Now further I have added an extra column to find the length of the Reviews and also described it-

Describe the data according to Ratings-

Describing the data as per feedback-

Accessing the reviews with the below command

Accessing the most frequent words from the reviews

From the above chart we can infer that most of the review are positive as we can see the frequently occurring words are Positive. The word love is used most among all of the reviews.

Getting the Feedback length

We can infer from the above chart that, people giving feedback has given approx. 500 words and max to max 2500 words.

Feature Extraction from the Data

Using Random Forest

Applying the K fold Validation –

Dataset is divided yet in Training and Test set by the authors of the dataset it self.
In proportion approximately 75% Training images, 25% Test images.
Models will be trained considering only Training set and then Test set will be used in order to evaluate their performance in terms of accuracy.
This approach not always the best choice, because due to sample variability between training and test set, our model could gives a better prediction on training data but fail to generalize on test data; and the subset chosen could have bias and not be representative of the entire dataset.

Cross-validation is a statistical technique which involves partitioning the data into subsetstraining the data on a subset and use the other subset to evaluate the model’s performance. To reduce variability we perform multiple rounds of cross-validation with different subsets from the same data. We combine the results from these multiple rounds to come up with an estimate of the model’s predictive performance.
Cross-validation will give us a more accurate estimate of a model’s performance.

Hence, we can conclude that our model has an accuracy of 93.75%.

Silver Prices Prediction Using Machine Learning

Why I chose the silver to predict with Linear Regression?

As In the third week of July 2020, silver prices(SLV) broke out of the $14 to $20 price range in which they have been caged for the most part since the second half of 2014. After breaking out of this long held range, silver prices raced sharply higher, rising to an intraday high of $29.91 on 7 August basis the nearby active September Comex contract. This made the silver the most outperforming asset of the year.

 This gave me the idea of doing a project, to predict Silver with Machine learning Algorithm.

What is Machine Learning?

Machine learning is an application of artificial intelligence (AI) that provides systems the ability to automatically learn and improve from experience without being explicitly programmed. 

What is Linear Regression?

Linear regression may be defined as the statistical model that analyzes the linear relationship between a dependent variable with given set of independent variables.

Mathematically the relationship can be represented with the help of following equation −

Y = mX + b

Here, Y is the dependent variable we are trying to predict

X is the dependent variable we are using to make predictions.

m is the slop of the regression line which represents the effect X has on Y

b is a constant, known as the Y-intercept. If X = 0,Y would be equal to b.

So while brushing up with the above concepts, let me begin with the project:

Therefore I have downloaded all of my data from https://finance.yahoo.com/ . The data was for last year.

Installing the Libraries:

Loading the Data:

Getting the Shape and Visualizing the Data:

Creating a new row to predict named ‘Prediction’ to predict the next 20 Days of SLV

Visualizing the volatility of SLV of last 100 Days

As we can see the above chart SLV has been the most volatile in last 100 Days as compared to Spiders(SPY) and Dow jones Industrial index(DJIA).

Creating a feature Data set (x) and convert it to numpy array and remove the last ‘x’ rows/days:

Creating the target data set(y) and convert it to numpy array and get all of the target values except the last ‘x’ rows/days

Splitting the data into 75% training and 25% testing:

Creating the model:

Getting the last ‘x’ rows of the feature data set:

Showing the model tree prediction:

Finally Visualizing the output:

Conclusion:

What does the above chart shows?

The last data for the Silver was till 10th of September,2020. I have Predicted the Silver prices for the next 20 Days which is till the end of this month.

My model’s prediction has been very accurate as the prices of silver falls around $23 in the September month as you can see in the below chart. But there is a whole lot of parameters to be considered and the equation needs to be improvised, to actually make the decision on the market data.

Pros of Linear Regression

  1. Simple to implement.
  2. Used to predict numeric values.

Cons of Linear Regression:

  1. Prone to overfitting
  2. Cannot be used when the relation between independent and dependent variable are non linear.

THE DEAD CAT BOUNCE

This blog is about the Perfect Dead Cat Bounce Analysis pattern on the Indian stock DHFL (Dewan Housing Finance Limited), As the shares of DHFL crash 55% on bond default concerns on Sept 21,2018.

What this blog will tell you?

This is about to understand THE DEAD CAT BOUNCE pattern, and how you can trade this pattern professionally, whenever you spot this next time.

UNDERSTANDING WHAT IS DEAD CAT BOUNCE

The name “dead-cat bounce” comes from the behavior of a stock after an
unexpected negative event. In this the Negative catalyst was the “Bond Default by the Company”.

UNDERSTANDING TECHNICALS

DHFL 1 DAY 1 YEAR CHART

As you can see DHFL fall from 618 to 274 on a single day on a Negative catalyst, which is a 55% fall on a single day. But the decline was not over and it fall further to 80 in the next 6 months.

HOW TO TRADE IT?

Catching the falling knife can be very scary and can lead to blood bath. Anyway the Patience and discipline can lead to good entry always and this pattern always gives the second chance which you can enter on the pullback to short the stock with the help of Fibonacci levels. which you can see in the below chart.

DHFL with Fibonacci

After drawing the Fibonacci levels the stock had the perfect bounce at the 38.2% levels, this is the perfect price level to enter the position to short the stock. This bounce happens because the bargain hunters began buying what they then perceived to be cheap stocks.

Where is the Bounce?

In the Image below, the candle formed after the big red candle on 2nd day is the bounce area.

Playing dead cat bounces allows you to capitalize on other people’s inability to trade wisely, as they amateurishly go after cheap stocks at the wrong time. Almost always, stocks are priced low for a reason—usually a very good reason. These types of stocks should be avoided in most instances as potential long setups. Understanding how to play violent contratrend rallies is something that should be left to a very skilled professional.

Also you can always predict successfully the next price level of the stock as I have predicted which is the -38.2% as shown in the image below.

Also for the perfect entry’s,these indicators can be used, a Negative MACD pullback, and a Detrended Oscillator reading that shows the oversold condition is over . These indicators shows that the oversold condition has worked its way off before going short.

Trendline & Head and Shoulder

This is a simple chart of Tesla, a 1d 1m chart of March 29,2019. I will teach you to analyse the patterns form with these charts and how to profit with them.

Trend line

As you may see the TSLA had a morning dip which was a best opportunity to buy, as mornings dips are always profitable. from there I just draw the trend line, every time the stocks touches the upper trend-line is an opportunity to short and when it touches lower trend line its an opportunity to buy, this is the best way to trade the stock on the basis of trend lines with minimum risk is to reward ratio.

2nd trendline

As you see in the above image this is the second trendline, this can also be traded as explained above to generate good profits. All the yellow lines are the resistance and supports of the stocks.

Double top

As you see in the above chart the stock makes the double top.

How to trade double tops?

The only best way to trade the double top is to short the stock when it makes double tops. Because the stock is struggling to reach high and has a lot of sellers pressure.

Head and shoulder Pattern

This is the simple head and shoulder pattern formed.

How to trade Head and Shoulder?

In the above image the head is at 277.54, and its two shoulder is around 277.26. When the stocks reaches around the 277.26 you must short the stock till the 276.5 level, which is the resistance level this would be your profit i.e 75 cents per share and risk would be around 28 cents. So your roughly, risk to reward ratio is around 1:3. which is very good.

Conclusion

TSLA stock was a great stock to play, as it had numerous patterns on the same day. Also it had great opportunity to make profits.

As this is my first blog, there is a lot to go, so Keep Calm and Make the Learning on.