Accurately demand forecasting is vital for effective supply chain planning activities and all related applications. The demand patterns which generated to forecast including horizontal pattern which happens when the data values vary horizontally around a constant mean. For example, a product whose sales are stable and do not increase or reduce such as dairy milk. Seasonal pattern occurs if a series depending on seasonal factors (e.g., the quarter of the year, the month, or the day of the week such as flu vaccine, soft drinks and ice creams. A trend pattern When data shows a long-term growth or decline. An example of a trend pattern in many firms' sales, businesses, such as electrical vehicles and cell phones. However, all forecasting models have distinct advantages and limitations where the generally accepted principle that no individual forecasting model is the best for all situations under all circumstances. Selecting appropriate forecasting methods from numerous alternatives is crucial to success. In this work, we conduct a comparative study between classical and machine learning forecasting algorithms via a statistical programming language R, which is used to generate time series data. The generated data has a mean of 2000 units and standard deviation ranges from 10 to 50, and has a different factor that influence the forecasting ability of classical methods and machine learning algorithms in how to utilize their capacity and extract information effectively. As the amount of historical data available, the type of data pattern, increasing or decreasing trend or seasonal factor, and the variation amount or randomness available in the data. The performance was measured using (MAPE) as the accuracy measurement of demand forecasting.