The Stock Price Analysis of Netflix Prediction

. Since the inception of the stock market, people have been using various data models, machine learning, and data mining to predict the future movement of stock prices to make huge profits. The rise and fall of stock prices are influenced by many factors, such as political, economic, social, and market factors. For stock investors, the prediction of stock market trends is directly related to profit capture. In this paper, we use Netflix's stock price for the past ten years as the dataset for this paper. An LSTM model will be built to predict the stock price trend of NETFLIX in the next 30 days. The dataset will be divided into a training set and a test set to test the degree of fit of the data. The results show that the LSTM model is a good fit for the predicted data and the real data. Finally, Netflix's stock price for the next 30 days will be predicted using Netflix's stock price for the past 10 years, and the results show that Netflix's stock price is on an upward trend for the next 30 days.


Introduction
Currently, there are many methods of forecasting stock prices. Forecasting methods can be broadly classified into two categories. The first category is statistical methods and the second category is artificial intelligence methods. Statistical methods include logistic regression models, ARCH models, etc. Artificial intelligence methods include multilayer perceptrons, convolutional neural networks, naive Bayesian networks, back propagation networks, single-layer LSTM, support vector machines, recurrent neural networks, etc. However, these studies predict only a single value. In order to predict multiple values in one model, it is necessary to design a model that can handle multiple inputs and produce multiple related output values at the same time. For this purpose, a deep recurrent neural network model with multiple input and multiple output correlations based on the LSTM model also known as the long short-term memory network is proposed in machine learning. Long short-term memory (LSTM) is a model that increases the memory of a recurrent neural network (RNN). Recurrent neural networks retain short-term memory because they allow information to be determined earlier in the current neural network. For immediate tasks, RNNs use earlier data, but we may not utilize all the earlier information of the neuron. In RNN, LSTM is widely used. The effectiveness of LSTM has been confirmed in several application areas such as video, natural language processing, geospatial, and time series. This correlation network model can predict the opening price, low price, and high price of a stock at the same time. This neural network model is able to identify the effects and relationships between time series by learning from past stock market data and can use the advanced machine learning function of selective memory to dig deeper into the intrinsic patterns of stock price time series for short-term time series prediction. The correlation network model is compared with the LSTM network model and the deep recurrent neural network model. Experiments show that the correlation network model outperforms the other two models in predicting multiple values simultaneously, with a prediction accuracy of over 95%.
In this paper, the LSTM model will be chosen for prediction. Using LSTM for stock price prediction, the framework used mainly includes TensorFlow2.0, which is mainly used for the construction of deep learning algorithms. This experiment is based on Netflix stock history data from the Kaggle platform and Keras deep learning library for stock price prediction. The LSTM model is used to train the 'close', feature of the stock data to predict the closing price.
The experimental results show that the overall error from the evaluation index can be seen to be small, and the prediction effect can be seen on the graph, the prediction situation is basically consistent with the trend of the actual situation, but the price deviation. Based on the data set, the overall trend of Netflix's stock price in the next thirty days is on the rise.

Firm description
Netflix started as a mail-in DVD business in 1996 with the invention of the DVD player. 1998 saw Netflix launch a website with less than 1,000 DVDs. 2000 saw Netflix launch a personalized movie recommendation system. The company used a user rating system to predict how much members would like a movie. The algorithm was called Cinematch, a collaborative filtering algorithm. It wasn't until Netflix, a Netflix company, launched its streaming service in 2007. It was a free add-on to the DVD-by-mail service. the first pure streaming service was launched in Canada in 2010. Until 2022, Netflix has been working on the ultimate personalization: that is, the customer turns on the TV and Netflix will magically play a movie, that the customer likes. Netflix's 20 years of growth cannot be separated from its strategic choices and algorithmic advancements, and the journey reflects Netflix's long-term commitment to building a personalized experience.
Netflix's largely subscription-based business model earns money through three simple plans: Basic, Standard, and Premium, with access to streaming series, movies, and shows. With the streaming platform, Netflix generated more than $202.1 billion in revenue in 29.6 years, with an operating income of more than $600 million and a net income of more than $500 million. Since 2013, Netflix is shifting from primarily providing licenses within to the media giant which means primarily producing its own content. U.S. video streaming service provider Netflix rose more than 8 percent after hours on Tuesday after the company reported second-quarter 2022 earnings that showed it lost fewer paying subscribers than expected during the quarter. Netflix's revenue for the second quarter of 2022 was $7.970 billion, up 8.6 percent compared with $7.342 billion in the same period last year; net income was $1.441 billion, up 6.5 percent compared with $1.353 billion in the same period last year; and diluted earnings per share were $3.20, compared with $2.97 in the same period last year, the earnings report showed.
Netflix said the company's paid subscriber base for streaming decreased by 0.97 million in the second quarter of 2022, compared to market expectations of a 2 million decrease. The company expects to add a net of 1 million paid subscribers in the third quarter, compared with market expectations for an increase of 1.8 million. Netflix also said it aims to launch a low-cost subscription option with ads in early 2023. Netflix announced last week that it has selected Microsoft as a partner for its ad-supported product. Netflix expects to post revenue of $7.838 billion for the third quarter of fiscal 2022, up 4.7 percent from $7.483 billion a year ago, missing analysts' estimates. operating profit will reach $1.255 billion, with an operating margin of 16.0 percent; net income will reach $961 million and diluted earnings per share will reach $2.14, missing analysts' expectations; the number of paid subscribers for global streaming services will increase by 1 million, and the total number of paid subscribers for global streaming services will reach 221.67 million, representing a year-over-year growth rate of 3.8%. According to data provided by Yahoo Finance, 33 analysts on average expect Netflix to earn $2.77 per share in the third quarter. As of June 30, 2022, Netflix had total assets of 46,350.94, total liabilities of 27,274.96, and total equity of 19,075.97 (Table 1). The numbers above show how Netflix's total membership in the US has grown from 20.19 million in '67 to over 20.21 million in '75. As you can see from the financial data above, Netflix has managed to increase the number of paying members, as well as the rate paid per member. In fact, the average monthly revenue per member grew from $2019 in 12.57 years to $2021 in 14.56 years. This suggests that the platform is currently sticky enough for paying members to stay, even as prices rise. Therefore, churn, a key metric for a subscription-based platform, is stable enough to allow Netflix to achieve sustained revenue growth.

Fig 1. The stock price of the Netflix
The main trend of Netflix stock price is down from September 2021. From June 2022 there is an upward trend (Fig 1).

Methods and results
Build an LSTM model to predict stock price trends over the next 30 days using Netflix stock prices over the last ten years. The forecasting process is divided into 4 main steps：1. Pre-process the data. Divide the data into two data sets (training and test). 2. Create a stacked LSTM model 3. Predict the test data and plot the output 4. Predict the data for the next 30 days and plot the output. Step1. Preprocess the data. This step is to normalize the data features. the LSTM is sensitive to the size of the input data, especially when using the default function. The data needs to be rescaled to 0 to 1 (also called normalization). This experiment transforms the values in the data with the help of the "fit_transform" function. The min-max scaler is used to scale the data so that we can normalize all the price values Then, we use 65% of the data for training and the remaining 35% for testing and assign them to separate variables. Step2: Building the LSTM model. This experiment uses the Keras deep learning framework for rapid model building. A sequential model is built and an LSTM layer is added to it. The first step is to create an instance of the Sequential class. Then, layers are created and added in the order in which they should be connected. The LSTM loop layer consisting of memory cells is called LSTM (). The fully connected layer that usually follows the LSTM layer and is used for output prediction is called Dense (). The first layer in the network must define the expected number of inputs. The inputs must be three-dimensional and include samples, time steps, and features. The data is loaded as a NumPy array and is required to convert the 2D dataset into a 3D dataset using the reshape() function in NumPy. The type of predictive modeling problem imposes constraints on the type of loss function that can be used. Some standard loss functions for different predictive model types. For this experiment, the loss function was used, and the loss function was set as Mean Absolute Error (MAE). The optimization algorithm uses Adam. Step3. Predict the test data/training data and plot the output. Combine the prediction results with the test set data because we preprocessed the original data (along with the output value y), the error loss calculation at this point is done on the processed data, and in order to calculate the error on the original scale the data needs to be transformed.
The size of the matrix at inversion must be scaled to the original size and also to the expected values of the test set.
In the graph below, the blue curve indicates the overall trend of Netflix data, and the green curve indicates the test predict data. orange indicates the train predicts data. it can be seen that the degree of fit is high (Fig 2).

Fig 2. Forecasting result of the Netflix
Since a good fit of the data can be seen, the fourth step uses the predict() equation for prediction. The orange curve below shows that the stock price of Netflix is trending upward for the next thirty days, i.e. September 2022 (Fig 3).

Discussion
Compared to econometric models such as linear regression or the time series forecasting statistic ARIMA, LSTM is well suited to deal with time series-related problems. Linear regression is a simple technique that is easy to interpret but has some obvious drawbacks. One problem with using regression algorithms is that the model over-fits the date and month. The model will consider values from the same date one month ago or the same date/month one year ago instead of considering previous values from a forecasting perspective. ARIMA models use past values to predict future values. Using these values, the model captures the growth trend in the series. Although the forecasts using this technique are better than those of linear regression models, the accuracy of these forecasts is still very low. However, LSTM has some significant drawbacks, the training time of the LSTM network is too long. Each LSTM cell implies 4 fully connected layers (MLP), which can be computationally intensive and time-consuming if the LSTM spans a large time horizon and the network is very deep. Although LSTM is an excellent variant model of RNN, which inherits most of the characteristics of the RNN model and solves the Vanishing Gradient problem due to the gradient backpropagation process. And the gradient problem of RNN has been solved to some extent inside LSTM and its variants, but it is still not enough. It can handle sequences of 100 magnitudes, while it will still be tricky for sequences of 1000 magnitudes, or longer.

Conclusion
More and more investors want to use machine learning to make predictions on stocks. In this paper, we use the LSTM model to predict the stock price trend for the next 30 days using Netflix's stock Close price for the past 10 years. The model shows that it is concluded that the Netflix stock price will show an upward trend in the next 30 days. However, the stock market is affected by various factors such as the economic environment, political policies, and market news. Although the LSTM model is a good fit for the predicted and actual data. But it also cannot predict the stock price accurately. Because the stock market is not very different from the stock price in the recent period. So it is challenging to predict the data for a longer period of time The limitations and future plan: a and The dataset used in this experiment 65% of the data is divided into train data. 35% of the dataset is divided into test data. so the experiment can be divided with more proportions and tested. The data derived from this experiment has some limitations. In the future, we can use longer-term data, divide it into different proportions, and compare the results to draw conclusions.