9
Introduction to AI Technique and Analysis of Time Series Data Using Facebook Prophet Model

S. Sivaramakrishnan1*, C.R. Rathish2, S. Premalatha3 and Niranjana C.4

1Department of Information Science and Engineering, New Horizon College of Engineering, Bangalore, India

2Department of CE, New Horizon College of Engineering, Bangalore, India

3Department of Electronics and Communication, K S R Institute for Engineering and Technology, Tiruchengode, India

4Sri Venkateshwara College of Engineering, Bangalore, India

Abstract

Artificial Intelligence (AI) builds machines to work as human beings by communicating the intelligence to the machines. AI highlights the creation of intelligent machines that accept the desired input data, work on it, operate, and respond like human beings. It is also used for making decisions by reading the real-time data, recognizing the given scenario, and finally responding to the structured set of data fed to interpret the conclusion. To build intelligent machines it is vital to understand the function of the human brain. The machines can only act, operate and react according to the information available about the scenario under which it works. Thus the AI must contain sufficient information which is a tedious task. Hence, to make a machine into a computer-controlled robot or designing software that performs and responds exactly the way a human being does, began the development of AI. The set of inputs will have many classifications and hence requires supervision that is mathematically analyzed by Machine Learning technology. This technology has higher challenges where the information required for the intelligent system will be of higher volume and each time the information must be updated. The set of software programs has no proper guidelines which makes it inefficient in some cases. These challenges can be controlled by some techniques that rectify the error, alter the data depending on scenarios and boost the speed of execution by optimizing the efficiency. Some frameworks come up with the implementation of various intelligent systems. Feature extraction framework identifies a minimal set of informative attributes from the provided dataset assuring zero correlation. A deep learning framework drastically reduces the learning time of models with the usage of parallel-computing GPUs. A Neural Network framework consists of interconnections where each node calculates the weighted sum of values passed on to its input and after a series of epochs the other network parameters merge to optimal values ending up with the appropriate model. AI plays a major role in many sectors. With the enhancement, it improves the quality of our lives or it may show the negative effects of it.

Keywords: Artificial intelligence, machine learning, neural networks

9.1 Introduction

The field of artificial intelligence (AI) strives to build intelligent entities as well as understand them. These built intelligent entities are fascinating and beneficial in their own right. AI during the early stage of development has produced many significant products. AI currently embodies a huge variety of subfields, from general-purpose areas to specific tasks. In 1950 Turing discussed that an intelligent system has the capability to achieve human-level performance in all cognitive tasks [14]. The test he proposed is that the computer must be questioned by a human and passes the test if the investigator cannot tell whether it is a computer or a human at the other end. If the computer passes, then it is said to be intelligent.

9.2 What is AI?

The definitions can be designed in two main dimensions as shown in Figure 9.1

  • The top of the box is concerned with the processes of thoughts and the bottom labels the reflection of thoughts.
  • The definitions on the left measure success in connection with human performance, and the right measure against an ideal concept of intelligence (i.e.) rationality.
Schematic illustration of the four categorized definitions of AI.

Figure 9.1 The four categorized definitions of AI.

Schematic illustration of cognitive model.

Figure 9.2 Cognitive model.

9.2.1 Process of Thoughts – Human Approach

When we need to know about the human way of thinking a given program then one needs to know about how the human mind works. This approach is called the cognitive model and the same is represented as shown in Figure 9.2 [5, 6].

The model can be developed by introspecting the inputs/outputs in the human mind through experiments such that if the program’s input/output and timing matches human behavior it builds up a computer model from AI and experimental techniques from psychology to develop many testing theories of how a human mind works.

Thus the process of converting a computer into a computer-controlled robot with software that thinks and reflects back exactly the way a human mind thinks is what AI is all about. And based on this AI can be classified as weak AI and Strong AI as mentioned in Figure 9.3 [7, 8]. The lateral is designed to carry out a particular task and the former to carry out complex task.

Schematic illustration of classification of AI.

Figure 9.3 Classification of AI.

9.3 Main Frameworks of Artificial Intelligence

The three frameworks that contribute to the accomplishment of various intelligent systems are Feature Engineering, Artificial Neural Networks, Deep Learning.

9.3.1 Feature Engineering

The description of each individual data object in Machine Learning is represented by a variable called Feature [911]. Informative features are useful for differentiating and characterizing various groups of objects. They produce accurate and predictive models yielding good results in different data analytic tasks. The various stages of feature engineering are shown in Figure 9.4.

This feature engineering helps in constructing new features from existing one, generating new sets of features and extracting the minimal set of data and selecting a set of features to improve the quality of dataset.

Schematic illustration of stages of features engineering.

Figure 9.4 Stages of features engineering.

Table 9.1 Similarity between brain and neural network.

BrainNeural network
NeuronNode
Connection of neuronsConnection weight

9.3.2 Artificial Neural Networks

Neural networks are a small part of AI. Humans use the brain to store knowledge and the computer uses memory to store a set of information. The neural network emulates the process of the brain. The neural network is developed by connecting a number of nodes, which are elements corresponding to the neurons of the brain [1214]. The Table 9.1 encapsulates the similarity between the brain and neural network.

Here each node computes the weighted sum of values generated to its input and forms an appropriate model after feedforward and back propagation stages. In supervised machine learning algorithms, the neural network provides the framework. Most commonly used neural networks are Recurrent Neural Networks (RNN) and Convolutional Neural Networks (CNN).

9.3.3 Deep Learning

Deep Learning is formulated with algorithms to learn numerous levels of representation in order to design complex relationships between data [1517]. The feature that defines higher level concepts from lower level one and vice is called deep architecture. The basic layout representing Architecture of Deep learning is shown in Figure 9.5. It plays a vital role in pattern recognition, speech recognition, optimization etc. The main reasons for the development of deep learning are:

Schematic illustration of architecture of deep learning.

Figure 9.5 Architecture of deep learning.

  • Increased chip processing abilities
  • Increased size of data used for training
  • Advancement in machine learning

For example, in image processing model the computer cannot identify the raw input data (image). Hence it can be represented in the form of pixels. With this value of pixels, it is difficult to predict an image. This difficulty can be broken down by deep learning techniques. First the image is loaded in the visible layer, where the layer contains variables that we are able to observe. There are several hidden layers that extract the set of images that is observed from the other layer. With the help of pixel corners the image is revealed one by one thus making sense to the fed input. Figure 9.6 describes the various stages in processing the image.

Schematic illustration of various stages in processing image.

Figure 9.6 Various stages in processing image.

Thus with each hierarchy of concepts it defines the entire relationship between the input and output forming a flexible and high power model.

9.4 Techniques of AI

9.4.1 Machine Learning

Any form of technology that is embedded with some intelligent feature is called AI. Machine Learning is in fact a branch of AI but it pinpoints to a specific field [18, 19]. Some technological groups of AI are identified by Machine Learning. Machine Learning is an approach where the model is formed with a set of data. The data can be audio, document, image etc. It trains the machine to recognize the correct data and make intelligent decisions with the data or patterns thus forming an end product called a model as shown in Figure 9.7.

Now can this training data be survived in the actual working field?

No. Then how come machine learning plays a vital role in AI. The training data may develop a model in applications like speech recognition and image processing. But when dealing with mathematical equations or physical laws there is an inexorable challenge. The data applied for modeling and the data used in field application are different as mentioned in Figure 9.8.

Machine learning gives over a structural challenge due to the difference between training and input data. The accurate model cannot be achieved with the wrong training data. The outcome of machine learning heavily depends on generalization where the performance of the final model maintains its stability regardless of what data it is. Good generalization yields a good output model.

Example 1: To convert an analog signal to digital signal

There are various analog signals in the real world. Here let us have a look at the microphone. The input (training data) fed to the microphone is analyzed by the intelligent machine and provides us with a good output model. Machine learning does know that the output from the microphone consists of various noise that is to be filtered. So the output model developed will have lower generalizability which is called as overfitting.

Schematic illustration of machine learning model.

Figure 9.7 Machine learning model.

Schematic illustration of machine learning model with distinct data.

Figure 9.8 Machine learning model with distinct data.

Schematic illustration of process of avoiding overfitting.

Figure 9.9 Process of avoiding overfitting.

The two methods regularization and validation as shown in Figure 9.9 are used to overcome the challenge. Regularization builds a simple model which is cost effective. Although it fails to produce an accurate model it specifies the overall characteristics of the output. Validation is used to monitor the performance of training data.

Based on the training method the machine learning technique has been divided as supervised, unsupervised and reinforcement learning as shown in Figure 9.10 [20, 21].

Schematic illustration of types of machine learning.

Figure 9.10 Types of machine learning.

Schematic illustration of supervised learning model.

Figure 9.11 Supervised learning model.

9.4.1.1 Supervised Learning

The aim of supervised learning is the learning standard where the datasets are optimized to shrink the difference between the target output and the computed output as represented in Figure 9.11.

Here the model has a set of correct input and output data. The output that a model needs from each training input is called target output, the one that is computed by the learning algorithm is called computed output. In supervised learning, each training input data should consist of target output and that is what the model is expect to produce for the given input. In some cases, the machine learning may fail to produce the targeted output causing an error between the computed and target output. So the Supervised learning minimizes the error with a revision of model producing set of input and correct output pairs.

9.4.1.2 Unsupervised Learning

The Unsupervised learning maximizes the similarities between the target and computing output. This algorithm does not work with data that is not trained properly forming clusters of unknown data outputs. The clusters of unknown output are iterated until it produces a good performance output model.

9.4.1.3 Reinforcement Learning

Let’s consider the input is received from the external environment and the output is achieved as per the action. The environment offers reward or the penalty to the received output. If the reward is given, the current output forms the final model or the output is again updated with new inputs. The evaluator gives the feedback about the penalty or reward. These types of algorithms are mainly used in games. If one wins a stage it will be declared as winner or one should start the game from the beginning to reach the desired level as represented in Figure 9.12.

Schematic illustration of unsupervised learning model.

Figure 9.12 Unsupervised learning model.

9.4.2 Natural Language Processing (NLP)

Natural language processing (NLP) represents the function of software and hardware components in a computer system that explores the spoken and written language [22]. It converts the human language to computer language like C, C++, Java. NLP uses two approaches to analyses the type of input:

  • Linguistic analyses
  • Statistical analysis

The language can be processed in different approaches:

  • Machine Translation approach
  • Lingual approach
  • Transfer approach
  • Empirical approach

The source language is directly converted into the target language is called as Machine language approach. The lingual approach converts source language into an inter lingual transition language then to target language. The transfer approach converts source language into a representation that a machine can recognize then it is converted to target language. At last the final text is generated. Empirical approach is used when there is a memory based translation (Large amount of raw data). Figure 9.13 represents the NLP pyramid.

Schematic illustration of NLP pyramid.

Figure 9.13 NLP pyramid.

9.4.3 Automation and Robotics

The best example for intelligent robots is humans. A robot is an intelligent system that connects a human action. Humans can cope up with any uncertain situations thinking what needs to be done at what time. We think of obstacles in many sorts of objects and recover from errors. The industrial robots that were developed at first were not flexible and did repetitive tasks in a sequence. Of course practical robots need not resemble humans exactly like humans. After the introduction of AI technology in robots the picture started changing. All industries started to take a bold move with intense development efforts underway.

9.4.4 Machine Vision

Machine vision has developed building tools that empower the understanding of visual information that will never be accompanied with illustrative text information [23]. The text data needs nothing to interpret what it is and it is easy for the machine to understand the given text whereas image inspection needs a combination of high-level concepts to process and interpret inherent visual characteristics. The interaction between humans and machines has influenced the evolution of machine vision systems. The development of flexible and rugged vision algorithms has come to play from machine learning technology therefore improving the power of vision systems.

Machine vision combines one or more sensing methods and computer technologies. For example, a camera receives a light from an image, it converts the light energy to a format that the computer can recognize as represented in Figure 9.14. The computer extracts the data from the image and processes the data, compares the data with other standards and provides the results in the form of a response to the machine.

Schematic illustration of machine vision standards.

Figure 9.14 Machine vision standards.

9.5 Application of AI in Various Fields

AI has significant demand in several fields and few are listed below.

  1. Marketing: With advancement in AI, more real time applications will be possible in this field [24]. The products needed for daily basis was once purchased from the shop but now there are many platforms that deliver products to the doorstep showing us the results just by reading our mind
  2. Optimization: The particle swarm optimization (PSO) is used to find the effective path from the various paths available and this algorithm was inspired from the flock of birds searching for a food in a specific region of interest [25, 26].
  3. Banking sector: The development of AI protects us from online frauds [27]. It provides solutions for all our queries through an online chatbot application.
  4. Finance sector: AI plays a major role in prediction of future profit margin with past data.
  5. Healthcare: Using AI technique there is a lot of equipment to predict the health condition. Many clinical support systems have been developed in recent times [28].
  6. Time series analysis: The time series analysis helps in understanding the pattern of the data and analysis of the data will help in predicting future forecast [29]. The time series analysis also will be greatly helpful in marketing and finance sectors. There are many model used for time series analysis like Moving average model (MA), Auto Regression Moving average model (ARMA), Auto Regression Integrated Moving Average Model (ARIMA) etc. Recently Facebook launched a Facebook Prophet model for forecasting that involves the time series data [30]. The next session elaborates the time series analysis with the help of Facebook prophet model using the Google trend data.

9.6 Time Series Analysis Using Facebook Prophet Model

Facebook has launched prophet model for analyzing the time series data and the significance of this method is it can automatically recognize the weekly, monthly, and yearly trend. This model studies the data and could predict the forecast more accurately. This model can even handle the effect of holiday in predicting the future sales, profit etc. The programming language supported by this model includes R and Python. For analyzing a data, necessary cleaning of the data has to be carried out, in the sense to remove the missing data or to replace missing data with overall average value, median value etc. And as the size of data increases the complexity in cleaning the data also increases and the advantage of the Facebook prophet model is it takes care of the missing data and there is no need of manual effort to clean up the data and it take care of outliers in the data.

The Google trend data for vitamin D is used as a source data for the prophet model. The Google trend is normalized between 0 and 100 and the maximum 100 indicates that it was trending heavily in that period of time. The data collected over past five years from 2016 for vitamin D is used in this prophet model and the model will predict analysis for the next one year.

The description of the vitamin D data collected over the past five years is shown in Figure 9.15.

The above figure indicates that there are total of 260 data available from the Google trend data and as mentioned the data are normalized and will have a maximum value of 100.

This data is used by the prophet model and the model analysis the data and with this it can able to forecast the feature values. The prediction is carried out for the next one year and the resultant visualization is represented as shown in Figure 9.16.

In the above figure the dark circles represents the actual value and the blue color line indicates the forecasted value using the prophet model. The x axis indicates the year and the y axis indicates the normalized value of the search of vitamin D which varies from 0 to 100. From the figure it can be noted clearly that the model trains from the past five year of data from 2016 to 2021 and predicts the data for the year 2022 to 2023. It could be clearly seen that the model follows the trends in the past and predicts the feature trend.

Schematic illustration of data description.

Figure 9.15 Data description.

Schematic illustration of visualization of predicted value.

Figure 9.16 Visualization of predicted value.

The important significance of this model is forecasting the overall trend, weekly and yearly trend as represented in Figures 9.17 to 9.19.

From the above figure understanding the pattern becomes easier. Looking at the early trend as represented in Figure 9.19 it could be clearly noted that the search of vitamin D peaks in June and gradually reduces by the end of December. Figure 9.18 represents the weekly trend of the vitamin D. The above Figure 9.19 will be very useful for vitamin D manufacturing company and based on the above data they can plan the production of the vitamin D capsule. Thus the AI helps in forecasting the data which can be used to increase or decrease the production. One more interesting fact to note in Figure 9.17 is after the COVID-19 break out the search for the vitamin D has increased sharply and the forecast suggestion that the trend will follow.

Schematic illustration of overall trend of the vitamin D.

Figure 9.17 Overall trend of the vitamin D.

Schematic illustration of weekly trend of vitamin D.

Figure 9.18 Weekly trend of vitamin D.

Schematic illustration of yearly trend of vitamin D.

Figure 9.19 Yearly trend of vitamin D.

Figure 9.20 and 9.21 represented below shows the forecasted value. The column ds represented in Figure 9.20 indicates the year of prediction and the column yhat represented in Figure 9.21 is the predicted values of the trend for the corresponding year.

Schematic illustration of prediction (ds column indicates the year).

Figure 9.20 Prediction (ds column indicates the year).

Schematic illustration of predicted trend (yhat column indicates predicted trend).

Figure 9.21 Predicted trend (yhat column indicates predicted trend).

9.7 Feature Scope of AI

Today the technological field is said to be weak AI because of its limitations. But the future of AI will be stronger. AI accomplishes many specific tasks that are predetermined but it is expected to overcome humans in all cognitive tasks in future. The world’s education will have many transformations, inculcating classical ways of education. Moreover, the industries will have robots and automation replacing labours. AI will protect our nation developing military robots which will perform the task of soldiers.

9.8 Conclusion

Artificially intelligent systems will have a greater impact on our lives. It is a boon to the world. It sets milestones to all industries like biotechnology, medicines, telecommunication, gaming etc. It provides noticeable results and it has a long way to prove its true power. Modern technologies cannot be dreamt without computers, algorithms, hardware and software that simplify every task. With AI most of the process will be managed without human force. The main theory is that intelligence can be represented in terms of structured data that is programmed to a digital computer. AI has a high challenge in finding ways to program the machine that cuts down the complexity of human thoughts.

References

  1. 1. Turing, A.M. and Jack Copeland, B., The Essential Turing: Seminal Writings in Computing, Logic, Philosophy, Artificial Intelligence, and Artificial Life, Plus the Secrets of Enigma, Clarendon Press, New York, Oxford University Press, 2004.
  2. 2. Nirenburg, S., Cognitive systems: Toward human-level functionality. AI Mag., 38, 4, 5–12, 2017.
  3. 3. Jackson, P.C., Toward Human-Level Artificial Intelligence: Representation and Computation of Meaning in Natural Language, Dover Publications, Mineola, New York, 2019.
  4. 4. Goertzel, B., Artificial general intelligence: Concept, state of the art, and future prospects. J. Artif. Gen. Intell., 5, 1, 1–4, 2014.
  5. 5. Ackerman, R., Gal, A., Sagi, T., Shraga, R., A cognitive model of human bias in matching, in: Pacific Rim International Conference on Artificial Intelligence, Springer, Cham, pp. 632–646, August 2019.
  6. 6. Bourgin, D.D., Peterson, J.C., Reichman, D., Russell, S.J., Griffiths, T.L., Cognitive model priors for predicting human decisions, in: International Conference on Machine Learning, PMLR, pp. 5133–5141, May 2019.
  7. 7. Coppin, B., Artificial Intelligence Illuminated, Jones & Bartlett Learning, London, UK, 2004.
  8. 8. Wei, L., Legal risk and criminal imputation of weak artificial intelligence. IOP Conf. Ser. Mater. Sci. Eng. IOP Publishing, 490, 6, 062085, April 2019.
  9. 9. Zheng, A. and Casari, A., Feature Engineering for Machine Learning: Principles and Techniques for Data Scientists, O’Reilly Media, Inc, USA, 2018.
  10. 10. Heaton, J., An empirical analysis of feature engineering for predictive modeling, in: SoutheastCon 2016, IEEE, pp. 1–6, March 2016.
  11. 11. Harika, V.R. and Sivaramakrishnan, S., Image overlays on a video frame using HOG algorithm. 2020 IEEE International Conference on Advances and Developments in Electrical and Electronics Engineering (ICADEE), pp. 1–5, 2020.
  12. 12. Yegnanarayana, B., Artificial Neural Networks, PHI Learning Pvt. Ltd, New Delhi, India, 2009.
  13. 13. Gurney, K., An Introduction to Neural Networks, CRC Press, London, UK, 2018.
  14. 14. Yu, J., Yang, L., Xu, N., Yang, J., Huang, T., Slimmable Neural Networks, 2018, arXiv preprint arXiv:1812.08928.
  15. 15. Sivaramakrishnan, S. and Vasupradha, Centroid and path determination ofplanets for deep space autonomous optical navigation. IJARESM, 8, 11, 42–48, 2020.
  16. 16. Yan, L.C., Yoshua, B., Geoffrey, H., Deep learning. Nature, 521, 7553, 436– 444, 2015.
  17. 17. Xin, Y., Kong, L., Liu, Z., Chen, Y., Li, Y., Zhu, H., Gao, M., Hou, H., Wang, C., Machine learning and deep learning methods for cybersecurity. IEEE Access, 6, 35365–35381, 2018.
  18. 18. Jordan, M.I. and Mitchell, T.M., Machine learning: Trends, perspectives, and prospects. Science, 349, 6245, 255–260, 2015.
  19. 19. Mohri, M., Rostamizadeh, A., Talwalkar, A., Foundations of Machine Learning, MIT Press, London, UK, 2018.
  20. 20. Kotsiantis, S.B., Zaharakis, I., Pintelas, P., Supervised machine learning: A review of classification techniques, in: Emerging Artificial Intelligence Applications in Computer Engineering, vol. 160, pp. 3–24, 2007.
  21. 21. Kotsiantis, S.B., Zaharakis, I.D., Pintelas, P.E., Machine learning: A review of classification and combining techniques. Artif. Intell. Rev., 26, 3, 159–190, 2006.
  22. 22. Indurkhya, N. and Damerau, F.J. (Eds.), Handbook of Natural Language Processing (Vol. 2), CRC Press, New York, USA, 2010.
  23. 23. Forsyth, D. and Ponce, J., Computer Vision: A Modern Approach, p. 792, Prentice Hall, Essex, England, 2011.
  24. 24. Overgoor, G., Chica, M., Rand, W., Weishampel, A., Letting the computers take over: Using AI to solve marketing problems. Calif. Manage. Rev., 61, 4, 156–185, 2019.
  25. 25. Shi, Y., Particle swarm optimization. IEEE Connections, 2, 1, 8–13, 2004.
  26. 26. Babukarthik, R.G., Sivaramakrishnan, S., Rashmi, S., Roopashree, S., An expert system for solving multi-objective decision making problems: MPSO. Kala Sarovar, 23, 48–58, 2020.
  27. 27. Singh, K., Banks banking on ai. Int. J. Adv. Res. Manage. Soc. Sci., 9, 9, 1–11, 2020.
  28. 28. Babukarthik, R.G., Fernandez, T.F., Sivaramakrishnan, S., Milan, A., 15 lethal vulnerability of robotics in industrial sectors, in: Big Data Management in Sensing: Applications in AI and IoT, pp. 227–238, River Publishers, New York, USA, 2021.
  29. 29. Sivaramakrishnan, S., Fernandez, T.F., Babukarthik, R.G., Premalatha, S., 4 forecasting time series data using ARIMA and facebook prophet models, in: Big Data Management in Sensing: Applications in AI and IoT, pp. 47–60, River Publishers, New York, USA, 2021.
  30. 30. Khayyat, M., Laabidi, K., Almalki, N., Al-zahrani, M., Time series facebook prophet model and python for COVID-19 outbreak prediction. CMC-Comput. Mater. Con., 67, 3, 3781–3793, 2021.

Note

  1. *Corresponding author: [email protected]
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset