This repository collects a set of Python examples I originally wrote while developing material for the GM-RKB (Gabor Melli Research Knowledge Base). The code is intentionally small and focused. Each script demonstrates one idea in regression, statistical testing, or neural networks.
Note: These are examples, not production libraries. They are meant to be read, modified, and reused as starting points for analysis.
Neural-network regression examples (scikit-learn MLPRegressor) on the Boston
housing dataset:
MLP_regression_10foldcv_boston.py– multi-layer perceptron regression with 10-fold cross-validation.SVM_regression_10foldcv_boston.py– support-vector regression on the same dataset, for comparison.MLP_1.png,MLP_2.png,MLP_3.png– example learning-curve / prediction plots generated by the scripts.
Classical statistical and regression examples, mostly built around small, well-known datasets:
- One- and two-sample t-tests (
1samp_ttest_1.py,2samplepaired_braindata.py). - Linear regression with cross-validation (
Linear_regression_10fold.py). - Regularized regression:
RidgeRegression_boston10foldcv.pyLasso_Boston_cv_predict.pyENRegression_boston10foldcv.pyARDRegression_boston10foldcv.pyBRRegression_boston10foldcv.py
- Tree-based and SVM regression:
regressiontrees_10foldcv.pySVM_regression_boston10foldcv.py
- Simple worked examples such as
simpleleastsquare.py,welchtestexample.py, etc.
Most scripts print basic diagnostics (scores, coefficients) and can easily be extended with additional plots or metrics.
A small, self-contained example of decision analysis:
- Models a batch-size decision under uncertain demand.
- Computes EMV (expected monetary value) for each option.
- Computes the expected value with perfect information (EV with PI) and the resulting EVPI.
- Generates a simple decision-tree diagram:
python statistical_test/decision_tree_emv_evpi_example.pywhich writes emv_evpi_decision_tree.png to the current directory.
Miscellaneous helper scripts, experiments, and scratch work that don’t fit neatly into the folders above. These are left here for completeness and may be useful as lightweight references for syntax or quick experiments.
These examples assume:
- Python 3.x
numpyscipyscikit-learnmatplotlib
You can install them with:
pip install numpy scipy scikit-learn matplotlib-
Treat each script as a worked example.
-
Run them from the command line, read the code, and adapt to your own datasets.
-
For Upwork / portfolio purposes, this repo shows:
- Familiarity with classical statistical tests.
- Hands-on practice with regression models (linear, regularized, tree-based, SVM, neural nets).
- A concrete EMV / EVPI decision-tree example.
These examples are provided for educational and portfolio purposes. You are welcome to read, adapt, and reuse them with appropriate attribution.