|
Table of Contents
|
Kundalee-CLI Programming Methodology
- keep the current implementation in VB6
- but organize it with the discipline of C++/Python-style modular design
- emit clean CSV outputs
- and make later migration to C++ or a Python library much easier
If VB6 CLI is written with:
- clear data structures
- pure computational routines
- minimal hidden global state
- explicit inputs and outputs
- stable CSV schema
- clean separation between parsing, engine, and output
then the logic becomes portable.
In that case:
- C++ translation becomes mainly a logic-preserving refactor, provided units, sign conventions, numeric edge cases, and hidden VB6 behaviors have already been cleaned up.
- Python wrapping or reimplementation becomes much easier.
- Julia or other numerical tools can consume the CSV immediately.
- ML and statistics pipelines can begin before the engine is fully migrated.
C++ translation note
In astronomy/astrology code, the hardest part is usually not syntax. It is:
- date/time conventions
- longitude sign conventions
- floating-point behavior
- indexing differences
- old VB6 implicit conversions
Portability rule
All core engine routines must depend only on typed input records and return typed output records or update a typed context. They must not read CSV directly, write files directly, or depend on module-level globals.
So the VB6 CLI becomes both:
- a working production feeder now
- a specification for future ports
The strongest benefit
The biggest benefit is not merely that CSV can be read by many languages.
That part is obvious.
The real benefit is:
If the program is architected correctly now, the future C++ version will be a translation of logic, not a reinvention of logic.
That saves time and reduces bugs.
What must be true for this to work
This idea succeeds only if the VB6 code is written in a migration-friendly way.
That means:
1. Keep engine logic separate from file I/O
Bad
- astronomy formulas mixed with CSV parsing
- output writing mixed with core calculations
Good
- parser module
- astronomy module
- astrology/phalita module
- output module
Then C++ or Python can replace one layer at a time.
2. Avoid VB6-specific hidden behavior
For example:
- Variant overuse
- implicit type conversion
- form-dependent logic
- module globals everywhere
- reliance on old VB string tricks inside core math
These make porting painful.
3. Use explicit UDT-style structures
My current movement toward UDT (User Defined Types) things like:
- TJobInput
- TBirthData
- TAstroCore
- TPhalContext
is exactly the right direction.
Those translate naturally into:
- C++ struct
- Python dataclass
- Julia struct / mutable struct
4. Treat CSV as an interface, not the core model
CSV is useful as:
- exchange format
- debugging format
- ML feeder format
But my real internal design should be:
typed records / structs / UDTs
Then CSV is just one serialization layer.
That is the correct modern approach.
My migration path is realistic
A good long-term path is:
Phase 1
VB6 CLI works and produces stable CSV.
Phase 2
Translate astronomy engine to C++ DLL.
Phase 3
Translate astrology/feature engine to C++ gradually.
Phase 4
Expose the C++ engine to Python.
Either by:
- pybind11
- ctypes
- cffi
- or a thin wrapper
Phase 5
Later, if desired:
VB6 structured design
→ C++ core implementation
→ Python wrapper / library
or:
VB6 structured design
→ manual Python reimplementation of high-level orchestration
My design helps Python later — but usually through clean reimplementation or wrapping, not literal code conversion.
C++, Python, Julia
Julia can immediately use the CSV outputs for:
- regression
- optimization
- statistics
- matrix work
- feature experiments
So CSV gives you language independence now.
But later, if the dataset becomes large, you may move to:
- Parquet
- binary arrays
- Arrow
- database-backed tables
Still, CSV is a good starting interchange format.
Provided I keep the VB6 CLI disciplined, typed (UDTs etc), modular, and free from unnecessary VB6-specific baggage.
Then it gives three benefits at once:
- usable output now
- clean translation path to C++
- future Python/Julia interoperability
That is a sound engineering strategy.
Datasets
I have converted input datasets of ADB into three basic csv datasets to be fed into CLI app as input:
- natives.csv
- mundane.csv
- research.csv
and stored their remaining data about keywords, events, biography, relationships into four separate csv files (not fed to CLI app), but all these csv files have same unique ID for a particular person or mundane event.
Hence, I may later use self-trained LLM or other tools to process and analyse them for future research.
Special Principles
1. Schema versioning
My CSV output should carry a schema version, even if only in:
- filename
- header comment
- run_summary.csv
Without this, later ML runs may silently mix incompatible column sets.
2. Unit/sign convention policy
For astronomy this is essential. State explicitly:
- longitude sign rule
- latitude sign rule
- Desantar convention
- angle range rule (0–360, -180 to 180, etc.)
- time standard used internally
This will save you many migration bugs later.
3. Golden test rows
Keep a very small set of permanent test records:
- one native
- one mundane row
- one edge-case row
For each, store expected outputs.
That will let me compare:
- VB6 vs C++
- VB6 vs Python
- old engine vs new engine
This is extremely important.
4. Error policy
State explicitly:
- when a row is skipped
- what goes to errors.csv
- whether processing continues
- whether blank fields become zero or error
5. Keep text side tables separate
Long text fields should stay in separate keyed CSVs unless a later NLP pipeline intentionally joins them.
कुण्डलीCLI : Machine Learning हेतु Feature-Generation Factory
(Command Line Interface)
Machine Learning के क्षेत्र में एक मूलभूत सत्य है कि केवल अच्छा algorithm या भारी GPU किसी परियोजना को सफल नहीं बनाता। किसी भी ML model की वास्तविक शक्ति इस बात पर निर्भर करती है कि उसे कौन-से features दिये गये हैं, वे कितने सार्थक हैं, कितने शुद्ध हैं, और लक्ष्य-वस्तु के कितने समीप हैं। इसी कारण मैं अपने वर्तमान प्रयास में KundaleeCLI को कोई सामान्य astrology app नहीं मानता; वह वस्तुतः एक feature-generation factory है, जिसका मुख्य कार्य विविध विषयों के लिए ऐसे structured datasets उत्पन्न करना है जिन्हें statistical analysis, regression, तथा ML training में प्रयुक्त किया जा सके।
इस कार्यप्रणाली का क्रम सीधा है, किन्तु अत्यन्त गम्भीर है—
Feature generation by CLI
→ statistical diagnosis
→ feature redesign in CLI
→ retraining ML model
→ diagnosis of ML model results
→ redesign CLI for better features
और फिर यही चक्र पुनः-पुनः चलता है।
statistical diagnosis mentioned above includes :-
- linear regression
- logistic regression
- ridge / lasso / elastic net
- correlation analysis
- PCA
- feature importance pipelines
- tree models like random forest / XGBoost / LightGBM
- clustering, if features are numeric and standardized
- standard statistical summaries and hypothesis testing
इसका अर्थ यह है कि ML model और CLI — दोनों एक-दूसरे को परिष्कृत करते हैं। यदि statistical diagnosis से ज्ञात हो कि कोई field निर्बल है, अर्थहीन है, अत्यधिक दोहराव वाली है, या लक्ष्य-वस्तु से उसका सम्बन्ध अल्प है, तो CLI को बदला जाएगा। यदि ML model के परिणाम असन्तोषजनक हों, तो केवल model architecture को दोष नहीं दिया जाएगा; यह भी देखा जाएगा कि feature architecture में कहाँ त्रुटि है। इस प्रकार feature-engineering और model-engineering दोनों परस्पर एक-दूसरे के शिक्षक बन जाते हैं।
इसी दृष्टि से KundaleeCLI का प्रधान प्रयोजन भविष्यफल दिखाना नहीं, बल्कि computable astrological features का निर्माण करना है। यह विविध प्रकार की परियोजनाओं का आधार बन सकता है, जैसे—
- natives dataset : vocation, marriage, disease-patterns, life-events, temperament, health tendencies इत्यादि।
- mundane dataset : earthquakes, rainfall, social events, collective patterns आदि।
- financial dataset : विशेषतः goldprice जैसे time-series विषय, जहाँ सूक्ष्म समय-निर्धारण और feature quality अत्यन्त महत्त्वपूर्ण हो जाते हैं।
अतः KundaleeCLI का वास्तविक स्वरूप एक research engine का है। यह astrology को केवल display के रूप में नहीं, बल्कि machine-readable feature space के रूप में रूपान्तरित करता है।
इसका एक अन्य महत्त्व भी है। KundaleeCLI केवल ML training का feeder नहीं है; यह अन्य programming ecosystems के लिए भी आधार-स्रोत बन सकता है—
- C++ के लिए, जहाँ machine-level robustness, speed, और deterministic execution की आवश्यकता हो।
- Python के लिए, जहाँ ML, data pipelines, experimentation, तथा automation अपेक्षित हों।
- Julia के लिए, जहाँ pure mathematics, numerical analysis, optimization, और symbolic-statistical exploration का कार्य करना हो।
अर्थात् CLI स्वयं अन्तिम गन्तव्य नहीं है; वह विविध उच्चतर परियोजनाओं के लिए dataset foundry है। आवश्यकता के अनुसार इसका output बदला जा सकता है, field structure पुनर्गठित किया जा सकता है, और नये विषयों के अनुकूल इसे पुनः mould किया जा सकता है।
यह भी ध्यान देने योग्य है कि बहुत छोटे परिवर्तन करके यही CLI किसी web-based astrological application का भी आधार बन सकता है। वहाँ उसका प्रयोजन प्रत्यक्ष प्रदर्शन, on-demand calculation, API-style response, अथवा server-side feature computation हो सकता है। परन्तु वर्तमान चरण में मेरा मुख्य लक्ष्य web app नहीं, बल्कि ऐसा CSV feature-set उत्पन्न करना है जिस पर गम्भीर statistical और ML परियोजनाएँ खड़ी की जा सकें।
इस CLI की एक विशेष रचना-दृष्टि भी है। इसे यथासम्भव इस प्रकार बनाया जा रहा है कि आगे चलकर आवश्यकता पड़ने पर इसका रूपान्तरण—
- C++ DLL
- या CLI executable
- या किसी अन्य reusable engine
में सरल हो। किन्तु अभी यह रूपान्तरण आवश्यक नहीं है। वर्तमान में सर्वप्रथम आवश्यक है — एक विश्वसनीय feature-generation pipeline। जब तक feature-set परिपक्व न हो, तब तक भाषा-परिवर्तन का आकर्षण गौण है।
इस सम्पूर्ण प्रयत्न का सार यह है कि prediction की शक्ति केवल प्राचीन सूत्रों के पाठ में नहीं, बल्कि उनके computational encoding, feature extraction, statistical testing, और iterative refinement में निहित है। जो व्यक्ति केवल model बदलता है पर feature नहीं सुधारता, वह आधा कार्य करता है। जो केवल feature बनाता है पर model-diagnosis नहीं करता, वह भी अधूरा रहता है। पूर्ण कार्य वही है जिसमें दोनों का आवर्त संवाद चलता रहे।