{"id":23682454,"url":"https://github.com/bl0nder/regressify","last_synced_at":"2026-05-15T13:02:15.088Z","repository":{"id":219987500,"uuid":"657956416","full_name":"bl0nder/regressify","owner":"bl0nder","description":"A multi-task neural network coded from scratch that performs simultaneous regression and classification.","archived":false,"fork":false,"pushed_at":"2023-06-27T07:51:06.000Z","size":145,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T19:12:01.794Z","etag":null,"topics":["classification","deep-learning","multitask-learning","neural-networks","numpy","regression"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bl0nder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-24T10:17:09.000Z","updated_at":"2024-01-30T16:24:50.000Z","dependencies_parsed_at":"2024-01-30T19:09:05.030Z","dependency_job_id":null,"html_url":"https://github.com/bl0nder/regressify","commit_stats":null,"previous_names":["bl0nder/regressify"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bl0nder%2Fregressify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bl0nder%2Fregressify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bl0nder%2Fregressify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bl0nder%2Fregressify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bl0nder","download_url":"https://codeload.github.com/bl0nder/regressify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239734390,"owners_count":19688255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification","deep-learning","multitask-learning","neural-networks","numpy","regression"],"created_at":"2024-12-29T19:12:28.481Z","updated_at":"2025-10-25T16:34:30.909Z","avatar_url":"https://github.com/bl0nder.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦾 Regressify\nRegressify is a multi-task neural network coded from scratch that performs simultaneous regression and classification. \n\n## 🛠️ Tools Used\n\u003cimg src='https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54'\u003e \u003cimg src='https://img.shields.io/badge/Numpy-777BB4?style=for-the-badge\u0026logo=numpy\u0026logoColor=white'\u003e \u003cimg src='https://img.shields.io/badge/Pandas-2C2D72?style=for-the-badge\u0026logo=pandas\u0026logoColor=white'\u003e \u003cimg src='https://img.shields.io/badge/Matplotlib-%23ffffff.svg?style=for-the-badge\u0026logo=Matplotlib\u0026logoColor=black'\u003e \u003cimg src='https://img.shields.io/badge/Colab-F9AB00?style=for-the-badge\u0026logo=googlecolab\u0026color=525252'\u003e \n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003e 📑 Data \u003c/h2\u003e\u003c/summary\u003e\nThe neural network has been trained on a dummy dataset of 2 features F1 and F2, and 2 target variables T1 and T2, corresponding to a class label and a regression value respectively. Here is a sample subset of the same:\n\n| F1 | F2 | T1 (class label) | T2 (regression value) |\n|---|---|---|---|\n| 1.4 | 0.2 | 1 | 0.28 |\n| 1.6 | 0.2 | 1 | 0.32 | \n| 4 | 1.2 | 2 | 4.8 | \n| 3.3 | 1 | 2 | 3.3 |\n| ... | ... | ... | ... |\n\n- There are **150 samples** in the dataset\n- Each sample belongs to one of **2 classes** where the class ID is either 1 or 2\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch2\u003e🏗️ Neural Network Architecture\u003c/h2\u003e\u003c/summary\u003e\n  \n### Input Layer (Layer 0)\nConsists of two neurons, each corresponding to one of the two feature variables, F1 and F2. \n### Hidden Layers\n- Controlled by the `num_layers` hyperparameter. Note: `num_layers` includes the last (output) layer. Thus, the number of hidden layers is `num_layers - 1`\n- Each hidden layer can have either a `sigmoid` or a `tanh` activation function applied to it. Hyperparameter: `layer_activation_fns`\n- `num_neurons` controls the number of neurons in each layer\n### Output Layer\n- Has two neurons, one for a classification prediction, and the other for a regression value\n- The matrix output by the penultimate layer undergoes:\n  + a `sigmoid` function to obtain the respective probabilities of each sample belonging to one of the two classes\n  + a `linear` function to obtain regression values corresponding to each sample\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch2\u003e♾️ Math\u003c/h2\u003e\u003c/summary\u003e\n  \n### Forward Propagation\nUsed to product an output in the forward direction by sequentially processing the input data through each layer of the neural network. \n\nThis processing involves mutliplying each layer's input with its corresponding weight matrix and then passing the product to an activation function\n\nFor each layer L, \n\n$$Z^{[L]} = W^{[L]}A^{[L-1]} + b^{[L]}$$\n\n$$A^{[L]} = g^{[L]}(Z^{[L]})$$\n\nwhere \n\n$W^{[L]} =$ Weight matrix of layer L\n\n$b^{[L]} =$ Bias vector of layer L\n\n$A^{[L]} =$ Output matrix of layer L $=$ Input to layer L+1\n\n$g^{[L]} =$ Activation function of layer L\n\n### Backward Propagation\nInvolves computation of losses in the backward direction which in turn allows for changes in layer weights to make the network produce more accurate outputs.\n\nFor each layer L,\n\n$$\\frac{\\partial C}{\\partial Z^{[L]}} = W^{[L+1]^T} \\frac{\\partial C}{\\partial Z^{[L+1]}} \\odot g'^{[L]}(Z^{[L]})$$\n\n$$\\frac{\\partial C}{\\partial W^{[L]}} = \\frac{\\partial C}{\\partial Z^{[L]}}A^{[L-1]^T}$$\n\n$$\\frac{\\partial C}{\\partial b^{[L]}} = \\frac{\\partial C}{\\partial Z^{[L]}}$$\n\n$$W^{[L]} = W^{[L]} - \\alpha \\frac{\\partial C}{\\partial W^{[L]}}$$\n\n$$b^{[L]} = b^{[L]} - \\alpha \\frac{\\partial C}{\\partial b^{[L]}}$$\n\nwhere \n\n$C =$ Cost/loss computed by neural network \n\n$\\odot =$ Element-wise multiplication\n\n$\\alpha =$ Learning rate\n\nNote for the last layer:\n\n$$\\frac{\\partial C}{\\partial Z^{[Last]}} = \\frac{\\partial C}{\\partial A^{[Last]}} \\odot g'^{[Last]}(Z^{[Last]})$$ \n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e \u003ch2\u003e📝 Performance Analysis \u003c/h2\u003e\u003c/summary\u003e\n\n### Training\nClassification accuracy: `0.975`\n\nRegression $R^2$ score: `0.9712041992163881`\n\n### Validation\nClassification accuracy: `1.0`\n\nRegression $R^2$ score: `0.723742056420074`\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbl0nder%2Fregressify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbl0nder%2Fregressify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbl0nder%2Fregressify/lists"}