
in minute 12:13 I say, Quantity is a character, Quantity is not a character, Quantity is numeric. Sometimes when there are missing data or letters wrongly put in the column of quantity, it becomes a character. but then we have to convert it to numeric.
Thanks, Anis for pointing it out.
Welcome to our first assignment.
Please open a new Rscript and call it "section 4 assignment"
in this assignment, we will work on the car's data set. it has the features of 400 cars from horsepower to speed and price.
part 1:
1- How many Rows are in the cars dataset?
2- How many Columns are in the car's data set?
3- How many unique numbers of cylinders we have in the cars dataset?
4- what is the average horsepower of cars? hint: summary function will be helpful.
5- what is the maximum horsepower?
6- what is the most expensive car?
7- change the name of the column "name" to "car name"
part 2:
8- make a subset of the data that has the car name and the price and name the new subsetted data frame car pricing.
9- create a function called pricing category that returns "Budget Car " if the cars are less than 20,000 USD," Suitable Car " is the car is more than 20,000 and less than 35 000 and finally an expensive car for cars more than 35000.
Check the function screenshot "price_category_function.png" in the resource folder please for guidance.
10- create a column named category on the subset using a for loop and pricing category function.
11- How many Budget cars, suitable cars, and expensive cars we have?
As always, please first try to answer on your own and then have a look at the solved script(attached).
All the best,
Haytham
Rescale analytics
Please Make a new Rscript and name it Section 5 assignment.
in this assignment, we will work on pineapple juice data that has the demand and the price every day for this juice.
1- Fit the demand of this Distribution to normal demand and see if the fit is normal.
3-Fit the demand using the fitdist function, is it still normal?
4- Make a linear regression using lm function y~x and outline the coefficients and the intercept.
As always, please first try to answer on your own and then have a look at the solved script.
All the best,
Haytham
Rescale analytics
Newyork air flights in the year 2013 are available at the R package newyork13. the data is segregated as a relational database with keys that you can connect the datasets with. the description of the columns in the data is in the case study description document. we can answer some very interesting questions using dplyr.
I have attached for you information about the data in the link, please read them before you attempt to answer the questions.
Open a script and name it to section 6 assignment and try to tackle the below questions:
#### what is the most popular destination city from NewYork?
### which month is the busiest of the year?
#### which airline is the most punctual?
##### what destination is the longest duration
#### what airline is the worst in terms of delays
### which airline has the highest capacity of seats?
### which airplane model is the highest in use and from which manufacturer?
I have attached a script that has the answers to these questions but before you check the answers, please try to answer for these questions on your own :)
All the Best,
Haytham
Rescale Analytics
Have a look at thee lubridate cheat sheet and try to get the components of the date from twenteleven.csv, you will notice that the invoice date is date time which is great if we want to get the busiest hour of the day.
1- Make a new script called Section 7 assignment.
Import twentyeleven.csv
2- use lubridate and base R , to get the day of the week, the month and the year.
3- Use hour() to get only the hour component in a new column.
4- make a histogram of the hours
5- Get the last purchase date per customer
6- get the recency per customer
7- model the inter-arrival time of customers in days and make a histogram of it.
for this, you will need a date column to get the days from it.
As always, please first try to answer on your own and then have a look at the solved script.
All the best,
Haytham
Rescale analytics
Hello Guys,
in this section, we will work on the visualization part of the data using ggplot.
you will have three data sets; cars, iris, and twentyeleven
the UK retailer data set are filtered to 2010, now we will use all of our learned skills to make beautiful visualizations of the data.
Please try to answer the questions first and then have a look at the solved script.
1- make a new script and call it the section 8 assignment.
2- import twentyeleven.csv and the requested packages.
3- Make a line plot of the sales of 2011 for the united kingdom.
for the next plot; select country countries<-c("Canada","Denmark","EIRE","United Kingdom")
4- make a line plot per each country using Facet Grid, make sure to put scales = "free_y"
5- Make a scatter plot for cars between price and horsepower.
6- Make a distribution plot of sepal length in iris.
7- Make a boxplot for the number of cylinders of cars, make sure to take only 4,6 and eight cylinders.
All the best,
Haytham
Rescale analytics
Hello Guys,
Please try to make ABC analysis for revenue in excel following the same methodology in the video.
Hello Guys,
Now its time to do the multi-criteria ABC analysis, we have to manipulate the data to obtain the total quantity sold and total revenue per SKU.
1- Make a new script called the section 9 assignment.
1- Import twenty eleven.
2- Make sure to remove rows that have description NAs.
2- Manipulate data to have the quantity and revenue per SKU.
3- Apply the product_mix function of inventory.
* How Many A_A products and C_C products you have found?
4- Manipulate data to have the quantity and revenue per SKU per country.
5- apply thee product mix store level function.
How many A_A products are in Eastern Ireland?
Please try to answer the questions first and then have a look at the solved script.
All the best,
Haytham
Rescale analytics.
Hello Guys ,
Please try to do the same Exercise I did in excel but with one model that includes the 12 month and the trend.
Check the coefficients of your model and forecast 16 weeks ahead.
All The Best,
Haytham
Rescale Analytics
Hello Guys,
in this assignment, you will manipulate the data to get the weekly sales of the UK retailer , you will need the month and trend to fit a linear regression model.
Using retail_clean.csv.
1- after you fit the model, measure the RMSE.
2- Forecast for 32 weeks ahead using your new model.
Please try to answer the questions first and then have a look at the solved script.
All the best,
Haytham
Rescale analytics.
in this video, I made a mistake as pointed below by Mohammed in the RMSE;
Hi Haytham,
I just checked parenthesis for RMSE
RMSE <- sqrt(mean((weekly_sales$sales - weekly_sales$prediction)^2))
the value : 10477.7
MAE <- mean(abs(weekly_sales$sales - weekly_sales$prediction))
MAE value : 6305.049 as your calculation.
Thanks
SUPPLY CHAIN DATA SCIENCE · R PROGRAMMING · INVENTORIZE · INVENTORY OPTIMIZATION · DEMAND FORECASTING · MACHINE LEARNING · REVENUE MANAGEMENT · SIMULATION · HIGHEST RATED
★ Highest-Rated Supply Chain Course on Udemy — 4 Consecutive Years
This course has earned and held the Highest Rated badge on Udemy for four consecutive years. Not the most enrolled — the highest rated by students who completed the program and returned to leave a review. Four years of sustained excellence is the most credible quality signal any online course can carry. The Python twin of this course carries the Bestseller badge. This R edition carries something more durable: the endorsement of its students, year after year.
★ Twin of the Udemy Bestseller — the original R edition that started it all
The Python version of this course carries the Udemy Bestseller badge. This R edition is the original — the one Haytham built first, that earned the Highest Rated Supply Chain badge for four years, and from which the Python bestseller was born. Same curriculum depth, same instructor, same real consulting cases — in R, the language of statistical computing preferred by analysts, researchers, and supply chain data scientists worldwide.
★ Inventorize — 60,000+ downloads. Taught only here, by its creator.
Haytham built the Inventorize package for R. Over 60,000 professionals use it across R and Python. This is the only course in the world where you learn Inventorize in full depth — directly from its developer, applied to real supply chain cases across inventory optimisation, safety stock, pricing, and product recommendations.
COURSE DESCRIPTION
There is no course like this anywhere on the internet. Most supply chain courses teach theory without code. Most data science courses teach generic skills without supply chain context. This program does something no other course on any platform does: it combines supply chain fundamentals, R programming from scratch, and eleven applied supply chain data science disciplines — forecasting, inventory, revenue management, segmentation, simulation, machine learning, and product recommendations — in one structured 40-hour program built by a practising supply chain data scientist and consultant.
The program is structured in three phases. Phase 1 — Supply Chain Fundamentals: cost and service dynamics, supply chain flows, financial flow, and the full spectrum of data produced by suppliers, production, stocks, and customers. Phase 2 — R Programming Fundamentals: R from absolute scratch through data structures, loops, functions, cleaning and manipulation with dplyr, statistical analysis including distributions and regression, and data visualisation. Phase 3 — Eleven Supply Chain Applications: every technique applied step by step to real supply chain data in R, from product segmentation to machine learning forecasting with Tidymodels.
At the heart of the program is Inventorize — the specialist supply chain analytics library Haytham developed, with over 60,000 downloads across R and Python. You will use it across inventory optimisation, safety stock, pricing, EOQ, and product recommendations. This is the only course in the world where Inventorize is taught in full depth by its creator. The program has held the Highest Rated Supply Chain badge on Udemy for four consecutive years — the most durable quality signal a course can earn.
WHAT MAKES THIS COURSE DIFFERENT:
[ ONLY ]
The only complete program of its kind on the internet
No course anywhere combines supply chain fundamentals + R from scratch + all 11 application disciplines in one 40-hour program. This is not a course. It is a professional data science program built specifically for supply chain professionals.
[ INVZ ]
Inventorize — taught by its creator
Haytham built Inventorize. 90,000+ professionals use it. You learn it here at full depth, directly from its developer, across inventory, pricing, forecasting, and recommendations.
[ SCALE ]
From one SKU to 1,000,000 simultaneously
Forecasting, inventory policy, and pricing models run across your entire product assortment in R. What takes hours in Excel takes minutes here — automated, reproducible, and scalable.
TOOLS AND TECHNOLOGIES COVERED
R / RStudio | Inventorize | Tidyverse / dplyr / tidyr | ggplot2 | Tidymodels | randomForest / rpart / glm
WHAT YOU WILL LEARN
✓ Master R from A to Z: syntax, data structures, loops, functions, data manipulation, statistical analysis, and visualisation with real supply chain data
✓ Understand supply chain fundamentals: cost and service dynamics, financial flows, and the complete data landscape across suppliers, production, stocks, and customers
✓ Perform supply chain statistical analysis: measures of centrality and spread, correlations, outlier detection, linear regression, and probability distributions
✓ Clean, manipulate, and explore supply chain data with dplyr: invoice analysis, date parsing, pivoting, joining, and aggregation across large transactional datasets
✓ Segment products, suppliers, and customers: single-criteria ABC analysis, multi-criteria ABC, Kraljic matrix for suppliers, and RFM analysis for customers with 3D visualisation
✓ Forecast demand at scale: multiple regression, time series analysis (ARIMA, exponential smoothing, SARIMA, dynamic harmonic regression), hierarchical aggregation, and SKU classification by demand pattern
✓ Optimise inventory: EOQ with and without quantity discounts, safety stock (multiple methods), re-order point with lead-time variability, and all four inventory policies (min-Q, periodic review, min-max, base stock) using Inventorize
✓ Apply revenue management: price response functions, elasticity modelling, optimum pricing across all SKUs, competing product models, markdowns for multiple periods, and critical ratio for seasonal products
✓ Build supply chain simulations: queue theory, waiting lines, 400 Monte Carlo simulations simultaneously, capacity and sequential service optimisation
✓ Apply supervised and unsupervised machine learning: k-means clustering, decision trees, random forests, logistic regression, and machine learning forecasting with Tidymodels
✓ Build product recommendation systems using market basket analysis and association rules (Apriori) on real transactional supply chain data
✓ Move beyond Excel: automate and scale supply chain decisions across 1,000,000 products simultaneously using R and Inventorize
COURSE CONTENT — 27 SECTIONS · 399 LECTURES · 40 HOURS · 165 DOWNLOADABLE RESOURCES
PHASE 1 — SUPPLY CHAIN FUNDAMENTALS
SECTION 1: Introduction to supply chain analytics
Why data science for supply chain? Visualise how supply chains work, understand cost and service dynamics, service level trade-offs, customer and supplier characteristics, supply chain flows, the financial flow, and why supply chain complexity demands data science beyond spreadsheets. Supply Chain Framework
SECTION 2: Supply chain data
Supply chains produce data at every node. Understand the types of data from suppliers, production, stocks, and sales/customers. Learn the four types of analytics applied in supply chain and why data science is the only scalable path to extracting value from this data. R Discussion
PHASE 2 — R PROGRAMMING FUNDAMENTALS
SECTION 3: Installation and overview of R
Set up your complete R data science environment. Install R, RStudio, configure your project workspace, and install the packages used throughout the program. A full walkthrough tutorial ensures you are coding-ready before Section 4. R RStudio
SECTION 4:R programming fundamentals
Learn R from absolute scratch: data structures and types, arithmetic, vectors, lists, dataframes, import and exploration, selection, if-else logic, conditions, for loops, custom functions, and applying functions across dataframes. Includes two-part graded assignment on real supply chain data. R
SECTION 5: Supply chain statistical analysis
Apply R to supply chain measurement. Calculate measures of centrality, spread, and correlations. Detect outliers. Introduce linear regression. Work with probability distributions — the Normal, Chi-square testing — both in Excel and R. Model demand distributions. Includes two graded assignments. R Excel
SECTION 6: Supply chain data manipulation with dplyr
Clean and reshape real supply chain data at scale. Master dplyr: investigate invoice data, compute average invoice value per country, calculate average items per invoice, join datasets, parse and transform date-time fields, pivot wider and longer, and apply the full pipeline to a real New York airlines dataset. Four-part graded assignment.R dplyr
SECTION 7: Working with dates and time series in R
Parse, manipulate, and make inferences from dates in R using Lubridate. Model customer inter-arrival times. Build time-aware supply chain analyses. Includes graded assignment across six questions on real supply chain date data.
R Lubridate
SECTION 8
Data visualisation with ggplot2
Master supply chain data visualisation: line plots, scatter plots, bar charts, distribution plots, boxplots, and histograms. Build publication-quality charts on real supply chain data with ggplot2. Includes two-part graded assignment.
R ggplot2
PHASE 3 — SUPPLY CHAIN DATA SCIENCE APPLICATIONS
SECTION 9
Product and supplier segmentation
Segment your entire product and supplier portfolio analytically. Apply multi-criteria ABC analysis at product and store level. Build the Kraljic matrix for supplier positioning and strategic sourcing. Visualise segmentation outputs. Two graded assignments on real supply chain data. R Excel Inventorize
SECTION 10: Demand forecasting: regression-based methods
Build regression-based demand forecasting models from scratch. Prepare data for regression, apply multiple linear regression in Excel and R, generate forecasts, and evaluate accuracy. Includes two-part graded assignment covering the full regression forecasting workflow. R Excel
SECTION 11: Demand forecasting: time series methods
Master the full time series forecasting toolkit in R. Convert data to time series, analyse components, measure strength of trend and seasonality, apply exponential smoothing, ARIMA, dynamic harmonic regression, SARIMA with grid search, and battle-test models for accuracy. Full train/test evaluation workflow. Includes two-part graded assignment. R
SECTION 12: Hierarchical and aggregate forecasting
Scale forecasting across your entire product and channel hierarchy. Apply top-down, bottom-up, and middle-out aggregation approaches. Structure hierarchical data, generate aggregate forecasts, test accuracy at each level, and compare approaches systematically. Graded assignment with two-part solution. R
SECTION 13: Big data SKU classification for forecasting
Classify thousands of SKUs to assign the right forecasting method to each. Identify slow-moving and intermittent demand using average demand intervals and CV². Check for holiday effects. Visualise demand classifications across the full assortment. Three-part graded assignment.
R Inventorize
SECTION 14: Supply chain simulations: queues and capacity
Model operational uncertainty with simulation. Understand waiting line and queue theory, build simulations in Excel and R, run 400 simulations simultaneously, optimise call centre staffing and capacity with the right K, add sequential services, model multiple service channels, and optimise capacity constraints. Two graded assignments. R Excel
SECTION 15: nventory management: EOQ and total cost
Build the analytical inventory foundation. Understand why we hold inventory, inventory strategies and types, EOQ derivation, quantity discounts, sensitivity analysis, EOQ with lead time — both in Excel and R with Inventorize. Includes graded assignment and two-part summary. R Excel Inventorize
SECTION 16: Safety stock and reorder point optimisation
Calculate safety stock using multiple methods: demand-lead time sigma, Method 1 and Method 2. Prepare SKUs for calculation, set cycle service level in R, calculate reorder points with and without lead time variability using Inventorize. Wrap the full indeterministic inventory workflow. Graded assignment with full solution.
R Excel Inventorize
SECTION 17: Inventory policies: simulation and visualisation
Apply and compare all four inventory policies across your assortment. Min-Q, periodic review, min-max, and base stock — demonstrated, explained in Excel, and implemented in R. Simulate the s,Q policy, visualise policy variations and all policies simultaneously, compare metrics. Two graded assignments. R Excel Inventorize
SECTION 18: Revenue management: seasonal products and critical ratio
Optimise purchasing decisions for seasonal and perishable products. Model the point of maximum profit, apply critical ratio analysis in Excel and R with Inventorize, calculate expected profit, prepare data for optimum quantity calculation. Graded assignment included. R Excel Inventorize
SECTION 19: Revenue management: price response and elasticity
Model how customers respond to price. Build price response functions in R, apply elasticity modelling with Inventorize, prepare real retail SKU data, model optimum price for all SKUs simultaneously, validate results. Graded assignment with full solution.
R Inventorize
SECTION 20: Revenue management: logistic regression pricing
Model the probability of purchase as a function of price using logistic regression (logit) with Inventorize. Build, interpret, and apply logit models to pricing decisions. Graded assignment included. R Inventorize
SECTION 21: Revenue management: competing products and multivariate pricing
Model competing products simultaneously. Calculate correlations among products, fit multivariate regression, apply ANOVA, predict with the model, apply multinomial choice models, and optimise competing prices for 40,000 observations using Inventorize. Two graded assignments. R Inventorize
SECTION 22: Markdown optimisation and customer segmentation by RFM
Optimise markdowns across multiple periods and one-period scenarios with Excel Solver. Apply salvage value, integrate forecasting. Segment customers by Recency, Frequency, and Monetary value (RFM): prepare data, calculate KPIs, join, rank, group into tiles, and visualise in 3D scatter plots. Graded assignment included. R Excel Inventorize
SECTION 23: Machine learning: unsupervised and supervised
Apply machine learning to supply chain classification and prediction. Unsupervised: k-means clustering with elbow method, silhouette analysis, and interactive 3D scatter plots. Supervised: linear regression, decision trees and random forests, model comparison, logistic regression classification with confusion matrix and ROC curve. Graded assignment.
R ML Packages
SECTION 24
Product recommendations: market basket analysis
Build product recommendation systems for your customers. Introduce market basket analysis, identify top-10 products, read transactional data, apply the Apriori algorithm, extract and subset top association rules. Graded assignment included.R
SECTION 25
Machine learning forecasting with Tidymodels
The most advanced section of the program. Apply Tidymodels — the standard ML framework in R — to multi-level time series forecasting. Convert data to tsibble, generate time series features, handle missing data per level, split and log-transform data, build recipes, define models and workflows, resample with cross-validation, collect and compare metrics, stack models, predict and visualise the future across multiple hierarchical levels. R Tidymodels Tidyverse
THIS COURSE IS NOT FOR YOU IF...
✗ You want a Python course — this course uses R throughout. The Python twin (RA: Data Science and Supply Chain Analytics A-Z with Python) is available on Udemy
✗ You want a quick 2-hour overview — this is a 40-hour complete program; it rewards 4–5 hours per week of commitment over 12–16 weeks
✗ You need ERP, WMS, or TMS software training — this course builds analytical models and R programming skills, not software configuration
✗ You are looking for one specialisation only — this program covers eleven supply chain data science disciplines; single-topic courses are available separately in Haytham’s catalogue
WHAT STUDENTS AND CLIENTS SAY
“It’s incredible to see what is possible with Python in terms of supply chain planning and optimization. Haytham is doing a great job as a trainer — starting with explanation of basics and ending with presentation of advanced techniques supply chain managers can apply in real life.”
Larsen Block — Director, Supply Chain Management — Freudenberg Home & Cleaning Solutions
“Haytham mentored me in my role of Head of Supply Chain Efficiency. He is extremely knowledgeable about supply chain concepts, latest trends, and benchmarks. His analytics-driven approach was very helpful to recommend and implement significant changes to our supply chain at Aster group.”
Saify Naqvi — Head of Supply Chain Efficiency — Aster Group
“I participated in the Supply Chain Forecasting & Management training conducted by Haytham. It helped me enormously in my daily work in the purchasing department. Haytham has the pedagogy to explain very difficult calculations and formulas in a simple way. I highly recommend this training.”
Djamel Bouremiz — Purchasing Manager, Mineral Circles Bearings W.L.L.
“A fantastic course, you truly learn a lot and Haytham is very quick with his responses. You will be able to use the skills and techniques he goes through immediately. This course was worth every cent.”
Wesley — Verified Udemy student
WHO THIS COURSE IS FOR
Supply chain managers moving into data science
You have deep domain expertise and want to move from Excel to R — automating the analysis you do manually every day and scaling decisions across your entire product range.
Demand planners and inventory managers
You manage forecasting and stock levels and want to apply statistical and ML methods to improve accuracy, optimise safety stocks, and automate replenishment across thousands of SKUs with Inventorize.
Data scientists entering supply chain
You know R and data science but want a structured program that applies your skills to real supply chain problems — forecasting, inventory, pricing, segmentation, simulation, and recommendations.
Finance and budget forecasting professionals
You model budgets and revenue and want to apply time series, hierarchical aggregation, and machine learning with Tidymodels to forecasting problems that go far beyond spreadsheet capabilities.
Excel users ready to move to R
You are frustrated with spreadsheet limitations and want to automate, scale, and professionalise your supply chain analytics. This course is your complete, structured path from Excel to R.
Absolute beginners at coding
No coding experience? This program starts from the absolute basics of R and builds to machine learning and supply chain automation — step by step, with real supply chain data throughout.
REQUIREMENTS
● Microsoft Excel — basic familiarity is sufficient; many concepts are introduced in Excel before being scaled in R.
● No R or coding experience required — Sections 3 and 4 teach R installation and programming from absolute scratch.
● No data science or machine learning background required — all methods are introduced step by step using supply chain data.
● Motivation to move beyond Excel and make supply chain decisions at scale — the program rewards 4–5 hours of commitment per week.
● R and RStudio are both free — full installation guidance is provided in Section 3. Inventorize is free and open-source.
WHAT IS INCLUDED
● 40 hours of on-demand video across 27 sections and 399 lectures
● 165 downloadable resources: R project files, datasets, Excel workbooks, Inventorize notebooks, and templates for every section
● Graded assignments in most sections — all on real supply chain use cases, not synthetic or textbook data
● Inventorize library taught in full depth across Sections 9, 13, 15, 16, 17, 18, 19, 20, and 21 — exclusively by its creator
● Machine learning forecasting with Tidymodels (Section 25) — added August 2023 by student request
● Bonus: one-hour machine learning webinar with Haytham as panellist for Noble Prog, including Orange Data Mining demo
● Lifetime access to all content and any future curriculum updates
● 30-day money-back guarantee — no questions asked
● Certificate of completion upon finishing the program
YOUR INSTRUCTOR
Haytham Omar, Ph.D.
Supply Chain & Business Intelligence Consultant · Developer · Trainer — UAE & France · Founder, Rescale Analytics
Haytham is a practising supply chain and data science consultant whose clients include Sephora France (omni-channel optimisation, Ph.D. collaboration), Sharaf Group Adventure HQ (replenishment and revenue maximisation algorithms deployed since 2019), Aster Group, DNO, Qarar, PWC Training Academy, and the Higher College of Technology. He has trained over 70,000 professionals across 70+ workshops in the UAE in R, Python, and applied supply chain analytics.
He holds a Ph.D. in Supply Chain from the University of Bordeaux and a Master of Science in Global Supply Chain Management from Bordeaux École de Management. He is the creator of the Inventorize package for R — downloaded over 60,000 times — which this course teaches in full depth, from its creator.
This R edition of the program is the original — the course that earned the Highest Rated Supply Chain Course badge on Udemy for four consecutive years and gave birth to the Python bestseller. Haytham built it because no comprehensive program existed that tackled supply chains using data science. It still does not exist anywhere else.
Stop doing supply chain in spreadsheets. Start doing it with data science.
40 hours · 165 resources · 27 sections · R + Inventorize · #1 Rated 4 years · Lifetime access