Collection of different Kaggle challenges. python to use : $env:KAGGLE_CONFIG_DIR='C:\Users\avig.kaggle'; C:\Users\avig\anaconda3\python.exe submit_kaggle.py
When adding new challenges or solutions, you MUST follow these strict naming conventions:
-
Prefix Naming: Never use generic names like
data,solutions, orutils. Always prefix them with the project/challenge name.- Bad:
data/,solution.py - Good:
Titanic_data/,Titanic_solution.py,Spaceship_Titanic_data/
- Bad:
-
Structure:
Kaggel_Solutions/<Challenge_Name>/<Version_Folder>/- Inside the version folder:
<Challenge_Name>_data/(Directory for datasets)<Challenge_Name>_solution.py(Main script)<Challenge_Name>_download_data.py(Download script)
-
Execution:
- Scripts must rely on relative paths or the prefixed folder names, not hardcoded "data".
-
Global Configuration Isolation:
- Do NOT place project-wide configurations (e.g.,
kaggle.json, submission tokens, or generic submission scripts) inside specific solution folders. - These must remain in the project root or use the User's global environment (e.g.,
~/.kaggle/).
- Do NOT place project-wide configurations (e.g.,
Maintain this consistency to prevents conflicts and ambiguity in a multi-project environment.
In case of power failure or a fresh environment start, follow these steps to resume work or run solutions. use conda
To run the advanced solutions (Stacking, Boosting), you need the following packages installed.
Recommended Installation Command:
pip install pandas numpy scikit-learn kaggle xgboost lightgbm catboostKey Libraries:
- Core:
pandas,numpy(Data Manipluation) - Models:
scikit-learn(RandomForest, Linear),xgboost,lightgbm,catboost(Gradient Boosting SOTA) - API:
kaggle(Data download/submission)
To automate downloading data and submitting predictions, we use a local kaggle.json.
Titanic:
kaggle competitions submit -c titanic -f submission.csv -m "Titanic Submission"House Prices:
kaggle competitions submit -c house-prices-advanced-regression-techniques -f submission.csv -m "House Prices Submission"Spaceship Titanic:
kaggle competitions submit -c spaceship-titanic -f submission.csv -m "Spaceship Titanic Submission"- Security:
- No Hardcoded Keys: The
kaggle.jsonfile is ignored by git to prevent accidental exposure of credentials. - Setup:
- Rename
kaggle.json.exampletokaggle.json. - Add your Kaggle username and key to the file.
- Alternatively, place your
kaggle.jsonin~/.kaggle/(default system location).
- Rename
- File Content (
kaggle.json.example):
{ "username": "<KEY>", "key": "<KEY>" }- The
.gitignorein this project is configured to excludekaggle.json.
- No Hardcoded Keys: The
Since kaggle.exe path issues are common on Windows, a dedicated Python script is included to handle submission using the local credentials.
Option A: Universal Submission Script (Recommended)
- Open
manual_submit.pyand ensure theSUBMISSION_FILEpath points to your desired CSV. - Run:
python manual_submit.py
Option B: CLI Direct Command
If you prefer the command line, use python -m kaggle to avoid path issues:
# Set Config Path (PowerShell)
$env:KAGGLE_CONFIG_DIR = "c:\Users\avig\Documents\GitHub\Kaggel_chalenge_1"
# Submit
python -m kaggle competitions submit -c <competition-name> -f <path-to-csv> -m "Your Message"Kaggel_Solutions/: Root for all challenges.<Challenge>/: (e.g.,Titanic,Spaceship_Titanic)<Version>/: (e.g.,v1_baseline,03_Stacking_SOTA)*_solution.py: The logic.*_download_data.py: Data fetcher.
- Each version folder (e.g.,
v1_baseline,v2_advanced) is self-contained. - They may share the
*_datafolder definition, but they contain their own logic and download scripts if necessary. - Do not overwrite older versions. Always create a new version folder (e.g.,
v3_experimental) for new attempts.