Metadata-Version: 2.4
Name: The-Shaper
Version: 0.1.0
Summary: A dataset-based prediction algorithm using a single formula.
Author: Apan Dan
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy

# The Shaper

**By Apan Dan**  
October 2026

## 1. Introduction

Imagine you are walking down the road and suddenly trip over a rock. Do you immediately think about what you will do next time, or do you first take care of your injury? You take care of the injury. Later, when you see another rock, you remember to avoid it.

AI systems often approach learning differently, adjusting their parameters to improve future results. What if we tried a different approach?

## 2. The Main Idea

Neural networks adjust parameters instead of simply relying on stored examples. The Shaper takes a different approach: it uses a dataset and one singular formula, without requiring a separate training process.

## 3. The Formula

First, let's look at the structure of the dataset.

| Input | Output | Loss |
|---:|---:|---:|
| 1 | 3 | 2 |
| 5 | 6 | 0 |

*Example dataset for \(n+1\).*

The **input** is the value to be calculated. The **output** is the stored result, which does not have to be correct. The **loss** is the correct output minus the stored output.

How can we calculate the desired output of a given input using only this information?

A human would look for the closest input in the dataset, infer the logic, and apply it to the new input. A computer needs a mathematical formula to perform this process.

The Shaper uses:

\[
OUT_{closest}-L_{closest}-(INP_{closest}-INP)
\]

This formula has two parts: **Logic** and **Converter**.

### 3.1 Logic

\[
OUT_{closest}-L_{closest}
\]

\(OUT_{closest}\) is the output associated with the closest dataset input. \(L_{closest}\) is the loss associated with that same example.

Subtracting the loss from the stored output estimates the output that would have been produced if the loss were zero.

### 3.2 Converter

\[
INP_{closest}-INP
\]

\(INP_{closest}\) is the closest input in the dataset, while \(INP\) is the input being evaluated.

Subtracting the difference between these inputs from the Logic result adjusts the estimated output for the new input.

### 3.3 Overall

The Logic estimates the output at the closest known input. The Converter adjusts that estimate to account for the difference between the stored input and the new input.

Together, they produce the complete formula:

\[
\boxed{OUT_{closest}-L_{closest}-(INP_{closest}-INP)}
\]

The Shaper uses its dataset and this single formula to make predictions without requiring a separate training process.

## 4. Problems

Every approach has trade-offs. One limitation of The Shaper is multiplication.

The closer the multiplier is to 1, the better it performs, according to the proposed approach. If the dataset follows a pattern such as \(2n\), the algorithm may perform poorly.

This limitation arises because the formula does not multiply its variables together, making it difficult to represent relationships that depend on multiplication.

## 5. Testing

### 5.1 California Housing Dataset

The Shaper was evaluated using the California Housing dataset. Eight numerical features were tested individually using Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE). Lower values indicate smaller prediction errors.

**Table 1. Prediction errors for each feature**

| Feature | MAE | RMSE |
|---|---:|---:|
| Median Income | 0.8430 | 1.1539 |
| House Age | 1.2171 | 1.5822 |
| Average Rooms | 1.1435 | 1.5035 |
| Average Bedrooms | 1.2325 | 1.6033 |
| Average Occupancy | 1.2050 | 1.6620 |
| Population | 1.6001 | 6.1015 |
| Latitude | 1.0516 | 1.4539 |
| Longitude | 1.0029 | 1.3867 |

### 5.2 Stock Market Prediction

The Shaper was tested using historical closing prices for Tata Consultancy Services (TCS), obtained from the National Stock Exchange of India. The proposed formula was used to predict future closing prices.

The following table presents the first ten predictions and their corresponding actual closing prices. The reported MAE was approximately 46.76, and the RMSE was approximately 59.41.

**Table 2. Stock price predictions for TCS**

| Date | Predicted | Actual | Error |
|---|---:|---:|---:|
| 16 Oct 2025 | 2947.28 | 2839.64 | 107.64 |
| 17 Oct 2025 | 2890.74 | 2890.45 | 0.29 |
| 20 Oct 2025 | 2887.74 | 2882.30 | 5.44 |
| 21 Oct 2025 | 2909.91 | 2946.05 | -36.14 |
| 23 Oct 2025 | 2885.91 | 2936.47 | -50.56 |
| 24 Oct 2025 | 2996.21 | 2957.27 | 38.94 |
| 27 Oct 2025 | 2912.00 | 2931.38 | -19.38 |
| 28 Oct 2025 | 2990.58 | 2931.10 | 59.48 |
| 29 Oct 2025 | 2990.29 | 2909.72 | 80.57 |
| 30 Oct 2025 | 2862.32 | 2931.48 | -69.16 |

The prediction errors varied considerably. Some predictions were close to the actual prices, while others differed substantially. Further testing against a baseline is necessary to assess predictive performance.

### 5.3 Binary Logic Validation

The Shaper was tested on an 8-bit binary logic dataset containing 256 possible input combinations. Of these, 128 profiles were loaded into the memory pool, while the remaining 128 were used for validation.

Each input consisted of eight binary values, and the predicted output was reduced modulo 2 to produce a binary result.

**Table 3. Reported binary logic validation results**

| Metric | Result |
|---|---:|
| Total possible input combinations | 256 |
| Memory profiles | 128 |
| Validation profiles | 128 |
| Input bit width | 8 |
| Output modulus | 2 |
| Reported validation accuracy | 100% |
| Displayed example packets | 5 |

The reported validation accuracy was 100%, with all five displayed example packets matching their expected outputs. These results suggest that The Shaper may be useful for the tested binary logic tasks. Further independent testing would help verify the result.

## 6. Overview

The Shaper may struggle to recognize mathematical equations that rely on multiplication, since its formula does not directly model multiplicative relationships.

However, the experiments described above suggest potential applications in binary logic and certain real-world prediction tasks. The approach also avoids a separate parameter-training process, which may reduce computational requirements.

## 7. My Thoughts

The Shaper trades some capabilities for others.

### 7.1 What It Loses

The Shaper has difficulty representing multiple mathematical relationships, particularly those involving multiplication.

It may still perform multiplication if the required examples are present in the dataset. However, it may struggle to generalize to combinations that are not represented by those examples.

### 7.2 What It Gains

The Shaper does not require a separate training process. This may save time and computational resources.

It also does not require a separate set of learned parameters that must be repeatedly updated and stored. Its dataset serves as the basis for its predictions.

## 8. What I Think About It

I believe The Shaper could be useful in situations where quick predictions are more important than complex pattern recognition.

It may provide a lightweight approach to AI that can run on ordinary computers without requiring a GPU. If further research confirms its usefulness, The Shaper could become a practical alternative for certain specialized tasks.

---

**Thank you for reading!**

*By Apan Dan*
