Tarek Atwan is the author of Time Series Analysis with Python Cookbook. We got the chance to sit down with him and find out more about his experience of writing with Packt.
Q: What are your specialist tech area(s)?
Tarek: I have over 16 years in consulting, providing services to global clientele focusing on modern data architecture, data analytics, data science, machine learning, and time series analysis.
Q: How did you become an author for Packt? Tell us about your journey. What was your motivation for writing this book?
Tarek: When I started teaching a FinTech Bootcamp through 2U, Inc., at Arizona State University, in the summer of 2020, middle of the COVID-19 pandemic, I realized many of my students were interested in time series analysis and forecasting, which was the core of the course. However, the motive was more toward investing (e.g., algorithmic trading) given the interest back then, possibly due to people working remotely and having more time to dive into trading in stocks and cryptocurrencies. The more my students became aware of what time series is and how time-series data is all around us and not just limited to financial data, the more it captivated interest. At the time, many of the academic books on the topic were focused on R implementations, and there were very few Python-specific books. And specifically, there was no recipe or cookbook-style book that offered insight into how these methods could be implemented. I realized time series as a topic is dense and complex, and a cookbook is a challenging book style for such a difficult domain. My goal in this book is to fill in that gap. Many excellent books dive into the math and theory behind the different time series analysis and forecasting methods. My goal is to provide a translation of how the reader can implement them in Python. This cookbook will establish a foundation for the reader to take things further on their own once they master some of the techniques in the book.
Q: What kind of research did you do, and how long did you spend researching before beginning the book?
T: In consulting, I am constantly researching to understand emerging trends, the latest research papers, and deployment techniques since my goal is to implement solutions suitable for a real-world setting. In the end, I am solving business problems with data. I took a similar approach to this book. Researching in my field never stops; it is an ongoing process due to the fantastic innovations in technology and techniques within big data, cloud, machine learning, deep learning, and time series forecasting. My research style is a hybrid between academia to understand the theory and potential and the applied side to assess feasibility. The trick is in finding a balance between theory and practical applications.
Q: Did you face any challenges during the writing process? How did you overcome them?
T: I can break the challenges into three categories: personal, writing style, and technical.
Personal: When I started the journey, I had to find a balance between my consulting day job, teaching nights and weekends, studying for my master’s, researching and writing for the book, and most importantly, my family. Finding a balance was challenging, but the experience has been enriching.
Writing Style: Writing a Cookbook is very different from your typical book. You must find that balance between theory, explanations, and the recipes (code). Initially, this was not an easy one, given the complexity of the topic. But as I started to progress, and with the feedback from the reviewers, I picked a rhythm and established a style. At that point, things began to fall in place and made more sense.
Technical: From a technical perspective, the most common challenge I faced was reproducibility. Given that this is a cookbook focused on recipes (code), I had to make sure the code was consistent, reproducible, and updated with the latest library versions. I had to be very selective when using Python libraries. They are well maintained, supported by a large community, and have a good track record of backward compatibility when releasing new versions. I had to be extra cautious of future warnings of potentially deprecated functionalities to avoid confusing the reader later. This was resolved through thorough testing, and the technical reviewers did a great job of letting me know if things did not work for them.
In other instances, some libraries had limited or not very clear documentation, and I found myself digging deeper into the source code to gain an insight into the inner workings.
Lastly, finding a balance between leveraging what is out there to avoid re-inventing the wheel (for example, using libraries) and writing things from scratch. I strive toward clean and straightforward solutions; they are easier to understand and interpret than complex solutions with fancy and complicated code that may be unnecessary (over-engineered).
Q. What’s your take on the technologies discussed in the book? Where do you see these technologies heading in the future?
T: The technologies discussed are a mix of classical and modern techniques for time series analysis. The good news is that these classical methods have been proven and tested through time and are still relevant to this day. Some of the more modern techniques will evolve, and more research and ideas will continue to be released. I think time series, in general, has not been getting the attention it deserves as other areas within machine learning and data science (for example, natural language processing or computer vision). But recently, I have noticed a massive wave of interest. For example, the increasing number of dedicated Python libraries just for time series supported by large firms such as Facebook, Uber, LinkedIn, Google, Microsoft, Salesforce, etc.
Q: Why should readers choose this book over others already on the market? How would you differentiate your book from its competition?
T: I think this book is very different, mainly the focus on the implementation side of the Time Series. I cover various topics such as outlier & anomaly detection, time series analysis, forecasting using statistical “classical” methods, machine learning, and deep learning. Throughout the book, I tied many of the techniques and concepts introduced to show how all these techniques come together. Sometimes books introduce you to a concept for the sake of introducing the idea because it is expected, so I tried to tie things together throughout the book.
Q. What are the key takeaways you want readers to come away from the book with?
T: Do not underestimate statistical “classical” time series methods in favor of fancier and more complex ways. There are numerous instances where a simple ARIMA or Holt-Winters outperforms a deep learning model on univariate time series data. I also emphasized domain knowledge a lot in the book; understanding your data and the nature of the problem you are trying to solve is a critical component before building models. Thus a good section was spent on transforming and pre-processing time series data as we ll as exploratory data analysis techniques (EDA).
Q. What advice would you give to readers learning tech? Do you have any top tips?
T: Expect things to fail. It is the nature of the learning process, especially in technology. No matter which book, blog, course, or video you are following things just may not work for you. Your goal is to get unstuck on your own. You need to be patient because solving the issue is the key to learning. We learn a great deal from making mistakes and learn even better when we overcome them.
Q. Do you have a blog that readers can follow?
T: I am not active but plan to start one after the book’s release to discuss the many topics/recipes in the book. I will probably use Medium for that. I currently have a personal blog that I have not maintained, but I may also publish it here https://tarekatwan.com/.
Readers can follow me or connect with me on LinkedIn – https://www.linkedin.com/in/tarekatwan/.
Q. Can you share any blogs, websites, and forums to help readers gain a holistic view of the tech they are learning?
T: One of the best resources that are referenced by many libraries, blogs, and books is the Forecasting: Principles and Practice 3rd edition, which you can find here https://otexts.com/fpp3/ (not that all the code is in R).
A great blog from Uber on the importance of forecasting https://eng.uber.com/forecasting-introduction/.
Lastly, the University of California, Riverside (UCR) and the University of East Anglia (UEA) have one of the largest collections of time series data and associated research papers that you can find here https://www.timeseriesclassification.com/index.php.
Q. How would you describe your author journey with Packt? Would you recommend Packt to aspiring authors?
T: It was an incredible journey, given this was my first experience writing a book. Writing a Cookbook is very different from your typical book, so finding that balance between theory, explanations, and the recipe(code)was not easy. The feedback and support from the Packt team were instrumental in the completion of this book.
Q. What are your favorite tech journals? How do you keep yourself up to date on tech?
T: I subscribe to many newsletters that deliver weekly insights to my email box (very helpful when you have a busy life). Generally, as I mentioned, I am usually in research mode whenever I am trying to solve a problem as a consultant and advisor to my clients, which helps me always stay engaged with what is new and emerging. This includes technology journals, attending webinars, and conferences. I also follow leaders and pioneers in the field on social media, mainly through LinkedIn.
Q. How did you organize, plan, and prioritize your work and write the book?
T: It all starts with an outline. This was key to keeping me guided and focused. More ideas keep flowing when you begin your writing journey, and you want to shove everything in. Sticking, when possible, to the outline helps you stay focused and avoid distraction. There is always more that you want to include and hundreds of recipe ideas that keep pouring in once I complete a chapter. It is essential to prioritize these ideas, keep thinking of the reader, and consider the different backgrounds reading the book. I keep thinking from their perspective. This helped me control the urge and avoid overcomplicating things or introducing ideas pre-maturely. Always keep the reader in mind.
Q. What is the one writing tip that you found most crucial and would like to share with aspiring authors?
T: My tip is to be patient. We all have ideas, and you need to be ready to accept criticism and be willing to hold off an idea you are passionate about if it is not suitable yet. And most importantly, think from the reader’s perspective. When you introduce concepts or write things, remember your audience, their background, and what you are trying to convey to them. Putting fancy ideas or complex thoughts to impress the reader should not be the goal; instead, try to simplify as if you are talking to them. This will allow you to connect with your audience better
You can find Tarek’s book on Amazon by following this link: Please click here.