Popular Topics
Popular Topics
Thursday, December 30, 2021
Upcoming Webinar: Optimize Inventory Safety Stock - A Fundamental Principle and Tool
In the webinar, Dr.Jay Zhou will introduce a much-need guiding principle that pinpoints the optimal safety stock level to maximize the profitability. It is a powerful and quantitative principle yet a straightforward one that can be easily understood by everybody. The benefits of the approach are many-faceted: fully measurable financial outcomes, improved planning productivity, etc.
Dr. Zhou will show how it actually works by using PeakProfit, a software tool from Friesian Analytics that implements the principle, and finding the optimal safety stocks for stock items convincingly and elegantly in a live demo.
The webinar is designed for all inventory professionals and managers regardless of if they have 2 months or 20 years of working experience. Please register for the webinar scheduled on Thursday, January 13th 2022 - 11:00 AM (EST) here
Friday, December 24, 2021
Upcoming Webinar - Optimize Inventory Safety Stock - A Fundamental Principle and Tool
In the webinar, Dr.Jay Zhou will introduce a much-need guiding principle that pinpoints the optimal safety stock level to maximize the profitability. It is a powerful and quantitative principle yet a straightforward one that can be easily understood by everybody. The benefits of the approach are many-faceted: fully measurable financial outcomes, improved planning productivity, etc.
Dr. Zhou will show how it actually works by using PeakProfit, a software tool from Friesian Analytics that implements the principle, and finding the optimal safety stocks for stock items convincingly and elegantly in a live demo.
The webinar is designed for all inventory professionals and managers regardless of if they have 2 months or 20 years of working experience. Please register for the webinar scheduled on Thursday, January 13th 2022 - 11:00 AM (EST) here
Sunday, December 19, 2021
Many planners take a trial-and-error approach based on experience or guesswork to set inventory safety stock levels. In the webinar, Dr.Jay Zhou will introduce a fundamental principle that pinpoints the optimal safety stock level to maximize the profitability. It is a powerful and quantitative principle yet a straightforward one that can be easily understood by everybody. The benefits of the approach are many-faceted: fully measurable financial outcomes, improved planning productivity, etc. Following the introduction of the principle, Dr. Zhou will show how it actually works by using PeakProfit, a software tool from Friesian Analytics that implements the principle.
The webinar is designed for all inventory professionals and managers regardless of if they have 2 months or 20 years of working experience. Please register for the webinar scheduled on Thursday, January 13th 2022 - 11:00 AM (EST) here .
Sunday, November 28, 2021
We are hiring data engineers.
Responsibilities
Build Snowflake data pipeline/ETL jobs to ingest data from text files, relational and non-SQL databases.
Perform ongoing maintenance and administration of the Snowflake warehouse.
Design and implement Snowflake schemas including tables, views, and materialized views.
Understand the data from a business perspective and write SQL scripts based on business logic.
Manage data sharing and data access for business users.
Optimize data storage and warehouse query performance.
Qualifications and Experience
Experience with Snowflake warehouse, data pipeline, Apache Airflow, and ETL tools in an enterprise environment.
Strong experience working with large data sets from multiple sources. Performed tasks including data cleansing, data merge, and aggregation.
Strong SQL and Python programming skills. Knowledge in R programming is a plus.
Experience MySQL, MongoDB, Amazon AWS services (S3, SQS, Lamba, etc.).
Experience with business intelligence tool is a plus.
Experience with machine learning is a plus.
To apply for the position, please send your resume to us at jobs@sqlytics.com.
Friday, September 24, 2021
An Antique Neural Network for Image Classification
I coded everything from scratch including the algorithm and the user interface using C++. There were no prebuilt packages to use, no internet to search the information, and no such thing as asking questions on social media. The computer used had a 486 CPU, a 32-megabyte memory, and a hard drive with less than 500-megabyte storage.
How things have changed in 27 years! With a deep learning neural network, such as a convolutional neural network, many layers of neurons serving different purposes can be stacked together to form a complex structure and collectively perform recognitive tasks that were unthinkable in the past. And all these can be done with a few lines of Python scripts and the execution is often done in a cloud computing environment with virtually unlimited computation and storage resources. The progress is astonishing.
Wednesday, September 22, 2021
Online Course: Oracle SQL for Random Sampling
Since many companies store their critical business data in Oracle databases, it is advantageous to perform random sampling within the same environment using SQL without data movement. For example, it is time-consuming to pull a large data set out of a database and do random sampling using Python on a laptop computer. In addition, the data are prone to various security issues once they are not protected by the database.
A Competition-winning data scientist and long-time Oracle SQL practitioner Dr. Jay Zhou creates an online course and shares his expertise in performing random sampling using Oracle SQL. Students will learn practical skills that can be applied immediately in their work. There were hundreds of people from 85 countries who took the course.
- How to quickly view random samples of the data. There are multiple ways to do this task.
- How to select a precise number of samples randomly.
- How to split data randomly. This is a necessary task when we build a machine learning model and need to produce three data sets, i.e., training, testing, and validation sets.
- How to select random samples by groups. For example, we want to randomly select 100 students, 50 of them female and 50 male, from a school.
Are there any course requirements or prerequisites?
Very basic Oracle SQL knowledgeWho this course is for?
SQL developers, data analysts, data scientists, statisticiansPlease take the course here.

Saturday, September 18, 2021
Taking Operational Efficiency to the Next Level: Leverage the 95-5 Rule of Automation
Whether it is inventory planning, or financial fraudulent transaction detection, or finding costly insurance claims, it generally holds true that 95% of the work can be resolved by automated algorithms. The remaining 5% needs to be done by domain experts using their expertise, intuition, and creativity. I call it the 95-5 rule of automation.
The 95-5 rule is not simply a division of the labor between machines and human experts flatly in that proportion. There is a structural and temporal implication in it. Algorithms are first applied to a raw problem, which involves a large number of cases and big data and is hard or inefficient to solve manually. This step produces as an output a simpler problem where the work is greatly reduced, by 95% generally. Human experts then work on this reduced problem and make their judgment calls to reach the final decision.
Take as an example our solution to a worker compensation insurance claim problem. A company receives about 200 worker injury claims daily. Our algorithm highlights 10 (5% of the total) of them as potentially costly using a machine learning model based on factors including age, cause of injury, and injury body parts. Using these 10 cases as a starting point, analysts review them carefully and take proper action. The solution has resulted in a 40% reduction in claim loss.
To recap, in the real world the 95-5 rule of automation works this way: applying algorithms to a raw problem to reduce the work by 95% and subsequently having human experts take on the reduced problem.
Here are the benefits as reported by our clients that have adopted solutions based on the 95-5 rule of automation.
- Improved outcomes. For example, a bank sees its fraud loss reduced by 70%. Another bank finds the bad debt rate dropping by 50%.
- Increased efficiency. In a K12 education company, content tagging is 100 times more efficient than a manual process.
- More jobs. A group in a bank hires more analysts because the operation there drives a good return on investment.
- Improved employees' morale. This is because they work on the reduced problem where the same amount of effort generates more fruitful outcomes. ( I did not realize this point until I saw a report produced by an independent department from a client company.)
When the rule is applied to inventory planning, our advanced optimization algorithm generates a set of recommended safety stocks for all items which serves as the foundation for planners to make further improvements.
One lesson that we have learned is that, unless it is an exceptionally simple circumstance, domain experts should not work with the raw problem directly. Unfortunately, the violation of this principle is happening every day resulting in ineffective, inefficient, and unscalable operations and a stressful workforce. The whole situation is avoidable.
The 95-5 rule of automation has worked for us remarkably. I hope you make the most of it in your organization and take operational efficiency to the next level.
Saturday, August 14, 2021
Webinar Video: Holistic Safety Stock Optimization - Putting the Horse Before the Cart
The recorded video of the webinar "Holistic Safety Stock Optimization - Putting the Horse Before the Cart" delivered by Dr. Jay Zhou on August 12.
A significant amount of money can be saved without impacting the overall demand satisfaction by optimizing the inventory holistically. With the right approach, we can comfortably construct an inventory with less money while providing higher overall demand satisfaction.
Wednesday, August 04, 2021
Webinar Invitation: Holistic Inventory Optimization
If you are responsible for a large inventory, I would like to invite you to attend my webinar "Holistic Safety Stock Optimization - Putting the Horse Before the Cart" on Thursday at 2:30 pm, August 12, 2021. Please register here..
I have written an article ) describing the challenge facing companies with large inventory. Tens or hundreds of millions of dollars or more, in addition to their stock prices or market valuation, are at stake depending on the company’s inventory sizes. C-level executives and senior managers want answers to the following critical questions which are both sides of the same coin.
- How to spend a fixed budget on safety stocks so that the average demand satisfaction for the whole inventory is the highest?
- How to achieve the desired average demand satisfaction for the whole inventory with the lowest budget of total safety stocks?
Monday, July 26, 2021
Holistic Inventory Optimization
The following was first published by me as a LinkedIn article.
Tens of millions or hundreds of millions of dollars or more, in addition to stock prices or market valuation, are at stake depending on the company’s inventory sizes. C-level executives want answers to the following critical questions which are both sides of the same coin.
- How to spend a fixed budget on safety stocks so that the average demand satisfaction for the whole inventory is the highest?
- How to achieve the desired average demand satisfaction for the whole inventory with the lowest budget of total safety stocks?
Figure 1. Common Approach - Setting the Same DS to Each Item
A common approach is to simply set the DS for all parts to a single number. Some managers adopt ABC analysis to divide stock items into several groups based on their values and assign the DS to each group. When we set DS to 91% for all items as shown in Figure 1, the average DS is 91% and the total value of safety stock is $129,985.However, we can do much better. By setting the DS for each item more intelligently, we can keep the average DS of 91% and reduce the total safety stock by about 16% (Figure 2). Or by assigning a different set of DSs, we can maintain the same total safety stock budget and increase the average DS from 91% to 93% (Figure 3).
Figure 2. How to Keep the Average DS of 91% and Reduce the Total Safety Stock by About 16%?
Figure 3. How to Keep the Same Total Safety Stock Budget and Increase the Average DS From 91% to 93%?
Interested readers may do an exercise. Here is a downloadable spreadsheet file that embeds the formula to calculate DS. One simply fills in whatever DS she/he desires for each item. The average DS and total safety stock will be calculated for you.If you can produce the results as shown in Figures 2 and 3 or better, congratulations! If not, I would invite you to attend my webinar "Holistic Safety Stock Optimization - Putting the Horse Before the Cart" on Thursday, August 12, 2021
Even if you are able to solve the 10-item problem by trial-and-error, in the real world many businesses have far more stock items than 10, I would still encourage you to attend the event.
Thursday, July 22, 2021
Upcoming Webinar: Holistic Safety Stock Optimization - Putting the Horse Before the Cart
I will give a 45-minute webinar on Thursday, August 12, 2021, at 2:30 PM Eastern Time. If you are responsible for a large quantity of inventory, I would encourage you to attend the event. Please register here. The following is a summary of the webinar. The CFO of a company wants to know, given a fixed budget, how to determine the safety stocks of all inventory items to achieve the highest overall demand satisfaction. In the webinar, Dr. Jay Zhou will show that the above goal can only be achieved by optimizing safety stocks holistically. He will demonstrate a powerful solution developed by Friesian Analytics (https://friesiancorp.com). The horse (budget) should pull the cart (inventory), not the other way around as it is done by many companies.
Friday, July 02, 2021
Free Online Calculating Inventory Safety Stock Calculator
I made a youtube video at https://lnkd.in/d3hECWU to introduce a free online tool for calculating inventory safety stock. A spreadsheet file that implements the calculator is downloadable. Here is the link to the calculator. Enjoy!
Friday, May 28, 2021
Oracle Function Returns Two Values
There is a table in a schema that contains three columns, p, low and hi. In the table, p is the primary key. I want to develop a function to return low and hi based on an input variable p. First I create a type.
create or replace type t_low_hi as object ( low number, hi number);
Then I create a function that finds low and hi based on p, constructs a type object and returns it.
create or replace function f_prob (p_p number) return t_low_hi is p_Low number; p_Hi number; Str_sql varchar2(2000); begin Str_sql := 'Select low, hi from t_lookup where p=:1'; Execute immediate str_sql into p_low, p_hi using p_p; return t_low_hi(p_low, p_hi); end; /
I call the function and retrieve low and hi for p with a value of 0.99.
select x.v.low , x.v.hi from (select f_prob(0.99) v from dual) x;
Tuesday, January 12, 2021
Updated Online Chinese Document Analytics Tool
We have updated our free online tool for analyzing Chinese documents: https://aistrike.us/text-analysis.html A user fills in a textbox with the content and click Submit button. The tool identifies words, displays a word cloud picture and calculates a sentiment index for each sentence. Enjoy!
Identifying words in a sentence is necessary. Chinese words in a sentence are next to each other without spaces separating them, e.g. Chinesewordsinasentencearenexttoeachotherwithoutspacesseparatingthem. And yes, the division of words could be ambiguous. For example, "结婚和尚未结婚的" could mean "married and unmarried" ("结婚 | 和 | 尚未结婚的") or "married, monk, unmarried" ("结婚 | 和尚 | 未结婚的") .
Tuesday, December 29, 2020
Inventory Optimization - Calculate Safety Stock
Safety stock provides a "cushion" in inventory to address the uncertainty in a customer's demand. It is important to maintain the "right" amount of safety stock. If it is too low, we may not be able to fulfill a customers' orders in a timely fashion. On the other hand, safety stock that is too high incurs significant financial and/or logistics burden to the business.
The calculation of safety stock is based on a number of factors include historical customer demands, product lead time and fill rate (a.k.a., demand satisfaction). The team at safetystockcalc.com builds a website and describe a popular approach to calculate safety stock using an example. On the website, you may also find two free tools that are useful, an online calculator and a downloadable spreadsheet with all the formulas. Enjoy!
Online Safety Stock Calculator Screenshot
Spreadsheet Safety Stock Calculator Screenshot
Monday, November 30, 2020
An Online Tool for Analyzing Chinese Text
We have developed a free online tool for analyzing Chinese document. The URL of the tool is located at here. A user fills in the textbox with the content and click Submit button. The tool identifies words, calculates frequencies for those words and display a word cloud picture.
. Enjoy!Monday, April 20, 2020
Real COVID-19 Death Rate
In my last post, we did research on COVID-19 death rate based on the ratio between the number of deaths and the number of confirmed cases. However, this method is inherently flawed. Some infected people did not show up at a hospital or a testing station to get tested. As a result, the death rate is exaggerated. Blood antibody tests on randomly sampled residents in Santa Clara, California in early April shows that the number of people infected is 55 to 85 times more than confirmed cases (https://www.cnn.com/2020/04/17/health/santa-clara-coronavirus-infections-study/index.html). Thus, the real death rate for people who infected with coronavirus is between 0.1% and 0.17% which are similar to that of flu. We use the following charts to illustrate two ways of calculating death rates. COVID-19 Death Rate (Flawed) = Number of Deaths/ Number of Confirmed Cases
COVID-19 Death Rate (Real) = Number of Deaths/Number of Infected As we can see, the chance of COVID-19 bullet hitting the bullseye, i.e., causing death, is much slimmer that appears based on confirmed cases alone.Thursday, April 02, 2020
Study on COVID-19 Annualized Death Rate
Probably this is the first time you see a chart like this. When people hear COVID-19 death rate for older people is high, they panic. We did research and published a paper on COVID-19 death rate( Study on COVID-19 Annualized Death Rate). Please notice the death rates for COVID-19 are "annualized". But we have to look at things in context. When COVID-19 death rate is annualized, it can be compared with other statistical data that are on annual basis. This is the key contribution of our research.
Monday, March 02, 2020
Querying Database Using Command Line Client and Powershell
mysql_config_editor set --login-path=local --host=localhost --user=root --port=3306 --passwordWhen we run the above command at a shell, it will prompt us to input password. It will create a file .mylogin.cnf that is not humanly readable under home directory (I am using Mac. For Windows, the file is under %APPDATA%\MySQL). The reason of doing this is to avoid an annoying security warning message if we supply the password in mysql command. If you don't mind the warning message, you can skip the step. Then I write a Powershell function to query MySQL database. I save the scripts as mysql_f.ps1 on my Mac.
function runsql { param($s) mysql --login-path=local -D dataexp -B -e "$s" | convertfrom-csv -delimiter `t }I issue the following command from the shell
prompt>. "./mysql_f.ps1"Now the function is defined. I test the function.
prompt>runsql "select 1 as val" val --- 1It worked. The following query displays the table in the current database.
prompt>runsql "select TABLE_SCHEMA, table_name, create_time from information_schema.tables where table_schema=database()" TABLE_SCHEMA TABLE_NAME CREATE_TIME ------------ ---------- ----------- dataexp flyway_schema_history 2019-11-21 11:56:31 dataexp mdl_sampled 2020-01-14 10:40:06 dataexp mdl_set 2020-01-14 09:46:59 dataexp sample_user_id 2020-01-14 09:58:34 dataexp t_all_pk1 2019-12-05 11:53:43 dataexp t_all_pk1_int 2019-12-05 22:14:54 dataexp t_all_tab_cols 2019-11-21 15:39:00From the Powershell output, we select only table_name an create_time by piping the output to "select" command of Powershell.
prompt>runsql "select TABLE_SCHEMA, table_name, create_time from information_schema.tables where table_schema=database()" | select table_name, create_time TABLE_NAME CREATE_TIME ---------- ----------- flyway_schema_history 2019-11-21 11:56:31 mdl_sampled 2020-01-14 10:40:06 mdl_set 2020-01-14 09:46:59 sample_user_id 2020-01-14 09:58:34 t_all_pk1 2019-12-05 11:53:43 t_all_pk1_int 2019-12-05 22:14:54 t_all_tab_cols 2019-11-21 15:39:00The above operation is possible because in runsql function, we use convertfrom-csv to convert text output of mysql to Powershell object. Convertfrom-csv is really a magic function! Once we have an Powershell object, we can do all sorts of things.
Sunday, October 27, 2019
Optimizing Inventory Level: Reduce the Inventory Value and Increase Customer Satisfaction Simultaneously
For a large part manufacture company in the transportation industry, maintaining the optimal inventory level in their warehouses is crucial to its bottom line. When too many parts are produced and stored, it costs the company excessive financial investment and previous warehouse spaces. On the other hand, if not enough parts in the warehouses, customers will become dissatisfied when orders may not get fulfilled in time. Thus, there are two conflicting goals to balance when planning the inventory: reducing inventory value and increasing customer satisfaction. The optimal strategy is to find the sweet spot of inventory level for each individual part that is most economical and maintaining high level of customer satisfaction at the same time. In a recent project that Dr. Jay Zhou has preformed, he is able to reduce the inventory level for his client company by $16 million and still maintain the same level of customer satisfaction. This work is highly received by the client. In this project, Dr.Zhou takes advantage of machine learning models and reduces huge number of parts to a much smaller number of homogeneous groups. The "Demand Satisfaction" are calculated for these groups.