6 min read · AI for business · AI technology and models

A business owner has three years of sales in an Excel file and asks, “Can I just hand this to ChatGPT to predict next month's sales?” The answer is to first separate what you actually want. If you want to know how much was sold last month, that is a calculation. If you want to know how much will be sold next month, that is a forecast. The two jobs need different tools.
Step 1: Identify what the job is
- Asking about data you already have: how much did branch A sell last month? Use a query or a formula. The result must be the same every time.
- Summarizing and explaining: write a report from the numbers you got. This suits an LLM (a language model that can write text).
- Predicting a value that has not happened yet: next month's sales, or which customer may stop buying. This suits a tabular model.
- Classifying into groups: is this purchase order at risk of late delivery? This also suits a tabular model.
The article on LLMs versus traditional machine learning already covers the main idea. This article focuses only on tabular data and Excel files.
Step 2: Let the LLM help ask the question, but let the system do the calculation
An LLM can turn a plain-language question into a query command, but the numbers should come from actually running that command. According to OpenAI's documentation, the model does not run the function itself. Our program runs it and sends the result back for the model to put into words. That makes the numbers traceable. An LLM that reads a long table and adds numbers in its head can get them wrong without saying so.
Step 3: Predict with a model that suits tables
For tabular data, gradient boosting models (many decision trees that take turns correcting the errors of the earlier ones) are a popular choice. An arXiv paper titled Why do tree-based models still outperform deep learning on tabular data? reports that tree-based models remain state of the art on medium-sized tabular data. That is a result on the datasets that paper tested, not a claim that they win on every task.
In the scikit-learn library, the documentation states that HistGradientBoosting handles missing values and categorical columns natively, and is much faster than the classic version once the data has tens of thousands of rows or more. That fits business data, which often has gaps and columns such as branch or product type.
Step 4: Set a baseline and watch for data leakage
A baseline is a simple method the model must beat, for example the same month last year. If a complex model is not better, it is not worth using.
Data leakage means letting the model see information that will not exist at real prediction time. The scikit-learn documentation explains that it makes evaluation results look better than they really are. For example, a “payment date” column used to predict whether an invoice will be paid late is leaking, because that value does not exist when the invoice is issued. The documentation also advises splitting the data first and only then preprocessing it.
Time-ordered data, such as monthly sales, should not be split into a test set at random, because data close together in time looks alike. The scikit-learn documentation advises testing on a period that comes after the training period, for example with TimeSeriesSplit.
Hypothetical example: calculating actual sales. This month there are sales orders of 120,000 + 85,000 + 45,000 baht, a total of 250,000 baht. This figure comes from a query and needs no prediction. For next month, the baseline is the same month last year, 240,000 baht. The tabular model predicts 262,000 baht. At month end, actual sales are 255,000 baht. The baseline's error is 15,000 baht and the model's is 7,000 baht. The model does better this month, but look at several months in a row before concluding. Then let an LLM help write the explanation from these numbers.
Checklist before you start
- Write the result you want as one sentence: what do you want to calculate, summarize or predict?
- Name the target column, and the columns that will not have a value at real use time.
- Set a simple baseline to compare against.
- Split the data before preparing it, and for time-based data, test on the later period.
- Measure with a metric that matches the business, such as mean error in baht.
- Actual totals must come from a query, not from a language model.
- Have someone who knows the business read the LLM's explanation before it is used.
When it fits, and limits
Splitting the work this way keeps you from using a language model for every calculation and makes results easier to check. The limits: a tabular model can also be biased if past data is biased, or can leak if data preparation is careless, and very little data may not be enough for a reliable prediction. In that case, simple rules or summary calculations may suit better.
Start by defining the result with BT San
Prepare a non-confidential sample file, a list of columns, and one sentence saying what result you want from the file. Then talk to BT San to separate which jobs use a query, which use a tabular model, and which let an LLM help explain.




