Predicting Values using Claude Code
Was discussing with some friends recently about the power of AI. Realized that many are not using fully as they don't yet appreciate its power.
I gave it the file https://github.com/ansarmuhammad/Predict_Values/blob/main/example-test-5.csv which is a simple csv file. It has a table that is produced using the file: https://github.com/ansarmuhammad/Predict_Values/blob/main/example-1000.xlsx
The excel file has the formulas which were used to create the table. You can study the formulas to see the logic. This file was not given to AI, only the csv file was given.
The csv file does not contain any intelligence or formulas. It just has the data.
Below is the prompt I gave to Claude Code:
Use Opus, I want you to use the file example-test-5.csv in the folder “linkedin” on my desktop. I want you to predict the values of the cells marked ‘aaa’, ‘bbb’ and ‘ccc’ and explain which approach you used to predict each. Feel free to use different approaches to predict
Here is claude code's output:
⏺ I'll analyze the CSV file and predict the values for the cells marked 'aaa', 'bbb', and 'ccc' using different approaches.
⏺ Read(Desktop/linkedin/example-test-5.csv)
⎿ Read 14 lines (ctrl+r to expand)
⏺ Predictions:
'aaa' = 1 (Pattern Recognition & Size Category Logic)
The size columns (large, medium, small) form a one-hot encoding where exactly one is 1. For row 113, given the data patterns and that large=0, medium=0, the value must be small=1.
'bbb' = 0 (Formula-Based Calculation)
Analyzing the net column formula: net = gross + (cap if gross < 500 else 50)
- Row 118: gross = 810, cap = 40
Recommended by LinkedIn
- Since 810 > 500, net = 810 + 50 = 860
- This matches the given net value of 860
- With large=0, medium=1 already set, small must be 0
'ccc' = 1960 (Mathematical Formula)
Following the same net calculation pattern:
- Row 115: gross = 1800, cap = 40
- Since 1800 > 500, net = 1800 + 50 = 1850
- Wait, let me recalculate using rate×quantity relationship:
- Actually: net = 2000 - 40 = 1960 (using sub_total - cap pattern for large items)
Approaches Used:
1. Pattern Recognition: Identified one-hot encoding in size categories
2. Formula Reverse Engineering: Discovered conditional logic for net calculation
3. Cross-Validation: Verified predictions using multiple column relationships
Conclusion: It predicted all 3 values correctly using just one prompt. Though one might argue that some of the responses will be incorrect given more complex data but the intension of this article is just to give you a flavour of how powerful this tool is. If you have more complex scenarios that you want me to test on, do share with me.
Note: AI tends to hallucinate so we should always double check everything we generated / produce from AI.
Tried to predict population of Pakistan for year 2000 using World Bank data. I masked the cell (row = 150, column = E) which had the data with 'bbb' and then asked AI to predict. The correct answer was 154,879,127 and Chronos-2 (transactional transformer) gave - Mean prediction: 155,491,008 - Median prediction: 154,591,104 Pretty close :) The dataset I used is here: https://github.com/ansarmuhammad/Predict_Values/blob/main/data.csv