{"id":15972078,"url":"https://github.com/rishit-dagli/breast-cancer-prediction-ml-python","last_synced_at":"2025-07-01T02:37:45.045Z","repository":{"id":105750533,"uuid":"200233719","full_name":"Rishit-dagli/Breast-cancer-prediction-ML-Python","owner":"Rishit-dagli","description":"Make predictions for breast cancer, malignant or benign using the Breast Cancer data set","archived":false,"fork":false,"pushed_at":"2020-02-18T08:24:26.000Z","size":8457,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T03:51:43.200Z","etag":null,"topics":["breast-cancer-classification","breast-cancer-prediction","breast-cancer-wisconsin","logistic-regression","machine-learning","python-3"],"latest_commit_sha":null,"homepage":null,"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/Rishit-dagli.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,"publiccode":null,"codemeta":null}},"created_at":"2019-08-02T12:48:57.000Z","updated_at":"2024-10-18T07:01:47.000Z","dependencies_parsed_at":"2023-06-13T14:30:46.097Z","dependency_job_id":null,"html_url":"https://github.com/Rishit-dagli/Breast-cancer-prediction-ML-Python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rishit-dagli/Breast-cancer-prediction-ML-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rishit-dagli%2FBreast-cancer-prediction-ML-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rishit-dagli%2FBreast-cancer-prediction-ML-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rishit-dagli%2FBreast-cancer-prediction-ML-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rishit-dagli%2FBreast-cancer-prediction-ML-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rishit-dagli","download_url":"https://codeload.github.com/Rishit-dagli/Breast-cancer-prediction-ML-Python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rishit-dagli%2FBreast-cancer-prediction-ML-Python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262884710,"owners_count":23379429,"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":["breast-cancer-classification","breast-cancer-prediction","breast-cancer-wisconsin","logistic-regression","machine-learning","python-3"],"created_at":"2024-10-07T20:41:48.945Z","updated_at":"2025-07-01T02:37:45.005Z","avatar_url":"https://github.com/Rishit-dagli.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Breast-cancer-prediction-ML-Python\n\n![GitHub followers](https://img.shields.io/github/followers/Rishit-dagli?label=Follow\u0026style=social)\n[![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fgithub.com%2FRishit-dagli%2Fpopup_box)](https://twitter.com/intent/tweet?text=Wow:\u0026url=https://github.com/Rishit-dagli/Breast-cancer-prediction-ML-Python)\n![Twitter Follow](https://img.shields.io/twitter/follow/rishit_dagli?label=Follow\u0026style=social)\n\nMake predictions for breast cancer, malignant or benign using the Breast Cancer data set\u003cbr\u003e\nDataset - Breast Cancer Wisconsin (Original) Data Set\u003cbr\u003e\nThis code demonstrates logistic regression on the dataset and also uses gradient descent to lower the BCE(binary cross entropy).\n## \u003cstrong\u003eDataset description\u003c/strong\u003e\n\n![](/pictures/breast%20cancer%20description.PNG)\n\u003col\u003e\n\u003cli\u003eSample code number: id number\u003c/li\u003e\n\u003cli\u003eClump Thickness: 1 - 10\u003c/li\u003e\n\u003cli\u003eUniformity of Cell Size: 1 - 10\u003c/li\u003e\n\u003cli\u003eUniformity of Cell Shape: 1 - 10\u003c/li\u003e\n\u003cli\u003eMarginal Adhesion: 1 - 10\u003c/li\u003e\n\u003cli\u003eSingle Epithelial Cell Size: 1 - 10\u003c/li\u003e\n\u003cli\u003eBare Nuclei: 1 - 10\u003c/li\u003e\n\u003cli\u003eBland Chromatin: 1 - 10\u003c/li\u003e\n\u003cli\u003eNormal Nucleoli: 1 - 10\u003c/li\u003e\n\u003cli\u003eMitoses: 1 - 10\u003c/li\u003e\n\u003cli\u003eClass: (2 for benign, 4 for malignant)\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2\u003eLibraries required\u003c/h2\u003e\n\u003col\u003e\n  \u003cli\u003enumpy\n      \u003cbr\u003e\n        \u003ccode\u003epip install numpy\u003c/code\u003e\n    \u003c/li\u003e\n  \u003cli\u003epandas\n    \u003cbr\u003e\n    \u003ccode\u003e\n      pip install pandas\n    \u003c/code\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    random\n    \u003cbr\u003e\n    \u003ccode\u003e\n      pip install random\n    \u003c/code\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    seaborn\n    \u003cbr\u003e\n    \u003ccode\u003e\n      pip install seaborn\n    \u003c/code\u003e\n  \u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2\u003e Logistic regression algorithm \u003c/h2\u003e\n\n![](/pictures/logistic_regression.gif)\n\n\u003cul\u003e\n\u003cli\u003e\n  Use the sigmoid activation function - \u003cimg src=\"https://latex.codecogs.com/gif.latex?$\\sigma(z)=\u0026space;1/1\u0026plus;e^{-z}$\"            title=\"$\\sigma(z)= 1/1+e^{-z}$\" /\u003e\n  \u003c/li\u003e\n \u003cli\u003e \n  Remember the gradient descent formula for liner regression where Mean squared error was used but we cannot use Mean squared error here so replace with some error \u003cimg src=\"https://latex.codecogs.com/gif.latex?$E$\" title=\"$E$\" /\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    Gradient Descent - \u003cimg src=\"https://latex.codecogs.com/gif.latex?\\theta\u0026space;_{j}=\\theta\u0026space;_{j}-\u0026space;\\alpha\\cdot\u0026space;\\partial\u0026space;MSE\\partial\u0026space;/\u0026space;\\theta\u0026space;_{j}\u0026space;$\" title=\"\\theta _{j}=\\theta _{j}- \\alpha\\cdot \\partial MSE\\partial / \\theta _{j} $\" /\u003e\n    Logistic regression - \u003cimg src=\"https://latex.codecogs.com/gif.latex?\\theta\u0026space;_{j}=\\theta\u0026space;_{j}-\u0026space;\\alpha\\cdot\u0026space;\\partial\u0026space;E\\partial\u0026space;/\u0026space;\\theta\u0026space;_{j}\u0026space;$\" title=\"\\theta _{j}=\\theta _{j}- \\alpha\\cdot \\partial E\\partial / \\theta _{j} $\" /\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    Conditions for E:\n    \u003col\u003e\n      \u003cli\u003e Convex or as convex as possible\u003c/li\u003e\n      \u003cli\u003e Should be function of \u003cimg src=\"https://latex.codecogs.com/gif.latex?$\\theta$\" title=\"$\\theta$\" /\u003e\u003c/li\u003e\n      \u003cli\u003e Should be differentiable\u003c/li\u003e\n      \u003c/ol\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    So use, Entropy = \u003cimg src=\"https://latex.codecogs.com/gif.latex?$-p\u0026space;\\log\u0026space;p$\" title=\"$-p \\log p$\" /\u003e\n  \u003c/li\u003e\n  \u003cli\u003eAs we cant use both \u003cimg src=\"https://latex.codecogs.com/gif.latex?\\hat{y}\" title=\"\\hat{y}\" /\u003e and y so use cross entropy\n  \u003cimg src=\"https://latex.codecogs.com/gif.latex?-y\u0026space;\\log\u0026space;\\hat{y}\" title=\"-y \\log \\hat{y}\" /\u003e as\n    \u003cimg src=\"https://latex.codecogs.com/gif.latex?\\hat{y}\\epsilon\u0026space;[0,1]\" title=\"\\hat{y}\\epsilon [0,1]\" /\u003e\n  \u003c/li\u003e\n  \u003cli\u003e\n    So add 2 cross entropies CE 1 = \u003cimg src=\"https://latex.codecogs.com/gif.latex?-y\u0026space;\\log\u0026space;\\hat{y}\" title=\"-y \\log \\hat{y}\" /\u003e and CE 2 = \u003cimg src=\"https://latex.codecogs.com/gif.latex?(1-y)\u0026space;\\log\u0026space;(1-\u0026space;\\hat{y})\" title=\"(1-y) \\log (1- \\hat{y})\" /\u003e.\n    We get Binary Cross entropy (BCE) = \u003cimg src=\"https://latex.codecogs.com/gif.latex?-y\\log\u0026space;\\hat{y}-(1-y)\u0026space;\\log\u0026space;(1-\u0026space;\\hat{y})\" title=\"-y\\log \\hat{y}-(1-y) \\log (1- \\hat{y})\" /\u003e\n    \u003cli\u003e\n      So now our formula becomes,\n      \u003cimg src=\"https://latex.codecogs.com/gif.latex?\\theta\u0026space;_{j}=\\theta\u0026space;_{j}-\u0026space;\\alpha\\cdot\u0026space;\\partial\u0026space;BCE/\u0026space;\\partial\u0026space;\\theta\u0026space;_{j}\u0026space;$\" title=\"\\theta _{j}=\\theta _{j}- \\alpha\\cdot \\partial BCE/ \\partial \\theta _{j} $\" /\u003e\n      \u003cli\u003e\n        Using simple chain rule we obtain,\n        \u003cimg src=\"https://latex.codecogs.com/gif.latex?\\theta\u0026space;_{j}=\\theta\u0026space;_{j}-\u0026space;\\frac{\\alpha}{m}\\cdot\u0026space;(\\hat\u0026space;y\u0026space;-\u0026space;y)^{T}\\cdot\u0026space;X\" title=\"\\theta _{j}=\\theta _{j}- \\frac{\\alpha}{m}\\cdot (\\hat y - y)^{T}\\cdot X\" /\u003e\n        \u003c/li\u003e\n      \u003c/li\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n  Now apply Gradient Descent with this formula\n  \u003c/li\u003e\n\u003c/ul\u003e\n\n## Code\n\u003col\u003e\n\u003cli\u003eData preprocessing\u003cbr\u003eLoad data, remove empty values. As we are using logistic regression replace 2 and 4 with 0 and 1.\n\u003cli\u003e \u003ccode\u003esns.pairplot(df)\u003c/code\u003e\u003cbr\u003eCreate pair wisegraphs for the features.\n\u003cli\u003eDo Principal component analysis for simplified learning. \n\u003cli\u003e\u003ccode\u003efull_data=np.matrix(full_data)\u003cbr\u003ex0=np.ones((full_data.shape[0],1))\ndata=np.concatenate((x0,full_data),axis=1)\u003cbr\u003e\nprint(data.shape)\u003cbr\u003e\ntheta=np.zeros((1,data.shape[1]-1))\u003cbr\u003e\nprint(theta.shape)\u003cbr\u003e\nprint(theta)\n\u003c/code\u003e\u003cbr\u003e\nConvert data to matrix, concatenate a unit matrix with the complete data matrix. Also make a zero matrix, for the initial theta.\n\u003cli\u003e\n\u003ccode\u003etest_size=0.2\u003cbr\u003e\nX_train=data[:-int(test_size*len(full_data)),:-1]\u003cbr\u003e\nY_train=data[:-int(test_size*len(full_data)),-1]\u003cbr\u003e\nX_test=data[-int(test_size*len(full_data)):,:-1]\u003cbr\u003e\nY_test=data[-int(test_size*len(full_data)):,-1]\n\u003c/code\u003e\u003cbr\u003e\nCreate the train-test split\n\u003cli\u003e\n\u003ccode\u003e\ndef sigmoid(Z):\u003cbr\u003e\n    \u0026nbsp return 1/(1+np.exp(-Z))\u003cbr\u003e\u003cbr\u003e\ndef BCE(X,y,theta):\u003cbr\u003e\n    \u0026nbsp pred=sigmoid(np.dot(X,theta.T))\u003cbr\u003e\n    \u0026nbsp mcost=-np.array(y)*np.array(np.log(pred))np.array((1y))*np.array(np.log(1pred))\u003cbr\u003e\n    \u0026nbsp return mcost.mean()\n\u003c/code\u003e\u003cbr\u003e\nDefine the code for sigmoid function as mentioned and the BCE.\n\u003cli\u003e\n\u003ccode\u003e\ndef grad_descent(X,y,theta,alpha):\u003cbr\u003e\n   \u0026nbsp h=sigmoid(X.dot(theta.T))\u003cbr\u003e\n    \u0026nbsp loss=h-y\u003cbr\u003e\n    \u0026nbsp dj=(loss.T).dot(X)\u003cbr\u003e\n    \u0026nbsp theta -= (alpha/(len(X))*dj)\u003cbr\u003e\n    \u0026nbsp return theta \u003cbr\u003e      \ncost=BCE(X_train,Y_train,theta)\u003cbr\u003e\nprint(\"cost before: \",cost)    \u003cbr\u003e\ntheta=grad_descent(X_train,Y_train,theta,alpha)   \u003cbr\u003e\ncost=BCE(X_train,Y_train,theta)\u003cbr\u003e\nprint(\"cost after: \",cost)\n\u003c/code\u003e\u003cbr\u003e\nDefine gradient descent algorithm and also define the number of epochs. Also test the gradient descent by 1 iteration.\n\u003cli\u003e\n\u003ccode\u003e\ndef logistic_reg(epoch,X,y,theta,alpha):\u003cbr\u003e\n   \u0026nbsp for ep in range(epoch):\u003cbr\u003e\n#update theta \u003cbr\u003e\n        \u0026nbsp theta=grad_descent(X,y,theta,alpha)\u003cbr\u003e\n#calculate new loss\u003cbr\u003e\n        \u0026nbsp if ((ep+1)%1000 == 0):\u003cbr\u003e\n           \u0026nbsp \u0026nbsp  loss=BCE(X,y,theta)\u003cbr\u003e\n             \u0026nbsp \u0026nbsp print(\"Cost function \",loss)\u003cbr\u003e\n     \u0026nbsp return theta\u003cbr\u003e\u003cbr\u003e\ntheta=logistic_reg(epoch,X_train,Y_train,theta,alpha)\n\u003c/code\u003e\u003cbr\u003e\nDefine the logistic regression with gradient descent code.\n\u003cli\u003e\n\u003ccode\u003e\nprint(BCE(X_train,Y_train,theta))\u003cbr\u003e\u003cbr\u003e\nprint(BCE(X_test,Y_test,theta))\n\u003c/code\u003e\u003cbr\u003e\nFinally test the code,\n\u003c/ol\u003e\n\u003cbr\u003e\nNow we are done with the code \u0026#128512;\n\n## The Algorithm as a web service\n\n### Python 3+\n\n    import urllib.request\n    import json\n\n    data = {\n            \"Inputs\": {\n                    \"input1\":\n                    [\n                        {\n                                '1': \"4\",   \n                                '2': \"7\",   \n                                '3': \"3\",   \n                                '5': \"5\",   \n                                '1000025': \"1002945\",   \n                                '1 (2)': \"4\",   \n                                '1 (3)': \"5\",   \n                                '1 (4)': \"10\",   \n                                '1 (5)': \"2\",   \n                                '1 (6)': \"1\",   \n                                '2 (2)': \"2\",   \n                        }\n                    ],\n            },\n        \"GlobalParameters\":  {\n        }\n    }\n\n    body = str.encode(json.dumps(data))\n\n    url = 'https://ussouthcentral.services.azureml.net/workspaces/f764effe004044e1b1c56ce46a5a8050/services/689b12141b8b4d9886aa420832a2f406/execute?api-version=2.0\u0026format=swagger'\n    api_key = 'abc123' # Replace this with the API key for the web service\n    headers = {'Content-Type':'application/json', 'Authorization':('Bearer '+ api_key)}\n\n    req = urllib.request.Request(url, body, headers)\n\n    try:\n        response = urllib.request.urlopen(req)\n\n        result = response.read()\n        print(result)\n    except urllib.error.HTTPError as error:\n        print(\"The request failed with status code: \" + str(error.code))\n\n        # Print the headers - they include the requert ID and the timestamp, which are useful for debugging the failure\n        print(error.info())\n        print(json.loads(error.read().decode(\"utf8\", 'ignore')))\n\n### Python\n\n    import urllib2\n    import json\n\n    data = {\n            \"Inputs\": {\n                    \"input1\":\n                    [\n                        {\n                                '1': \"4\",   \n                                '2': \"7\",   \n                                '3': \"3\",   \n                                '5': \"5\",   \n                                '1000025': \"1002945\",   \n                                '1 (2)': \"4\",   \n                                '1 (3)': \"5\",   \n                                '1 (4)': \"10\",   \n                                '1 (5)': \"2\",   \n                                '1 (6)': \"1\",   \n                                '2 (2)': \"2\",   \n                        }\n                    ],\n            },\n        \"GlobalParameters\":  {\n        }\n    }\n\n    body = str.encode(json.dumps(data))\n\n    url = 'https://ussouthcentral.services.azureml.net/workspaces/f764effe004044e1b1c56ce46a5a8050/services/689b12141b8b4d9886aa420832a2f406/execute?api-version=2.0\u0026format=swagger'\n    api_key = 'abc123' # Replace this with the API key for the web service\n    headers = {'Content-Type':'application/json', 'Authorization':('Bearer '+ api_key)}\n\n    req = urllib2.Request(url, body, headers)\n\n    try:\n        response = urllib2.urlopen(req)\n\n        result = response.read()\n        print(result)\n    except urllib2.HTTPError, error:\n        print(\"The request failed with status code: \" + str(error.code))\n\n        # Print the headers - they include the requert ID and the timestamp, which are useful for debugging the failure\n        print(error.info())\n        print(json.loads(error.read())) \n\n### R\n\n    library(\"RCurl\")\n    library(\"rjson\")\n\n    # Accept SSL certificates issued by public Certificate Authorities\n    options(RCurlOptions = list(cainfo = system.file(\"CurlSSL\", \"cacert.pem\", package = \"RCurl\")))\n\n    h = basicTextGatherer()\n    hdr = basicHeaderGatherer()\n\n    req =  list(\n        Inputs = list(\n                \"input1\"= list(\n                    list(\n                            '1' = \"4\",\n                            '2' = \"7\",\n                            '3' = \"3\",\n                            '5' = \"5\",\n                            '1000025' = \"1002945\",\n                            '1 (2)' = \"4\",\n                            '1 (3)' = \"5\",\n                            '1 (4)' = \"10\",\n                            '1 (5)' = \"2\",\n                            '1 (6)' = \"1\",\n                            '2 (2)' = \"2\"\n                        )\n                )\n            ),\n            GlobalParameters = setNames(fromJSON('{}'), character(0))\n    )\n\n    body = enc2utf8(toJSON(req))\n    api_key = \"abc123\" # Replace this with the API key for the web service\n    authz_hdr = paste('Bearer', api_key, sep=' ')\n\n    h$reset()\n    curlPerform(url = \"https://ussouthcentral.services.azureml.net/workspaces/f764effe004044e1b1c56ce46a5a8050/services/689b12141b8b4d9886aa420832a2f406/execute?api-version=2.0\u0026format=swagger\",\n    httpheader=c('Content-Type' = \"application/json\", 'Authorization' = authz_hdr),\n    postfields=body,\n    writefunction = h$update,\n    headerfunction = hdr$update,\n    verbose = TRUE\n    )\n\n    headers = hdr$value()\n    httpStatus = headers[\"status\"]\n    if (httpStatus \u003e= 400)\n    {\n    print(paste(\"The request failed with status code:\", httpStatus, sep=\" \"))\n\n    # Print the headers - they include the requert ID and the timestamp, which are useful for debugging the failure\n    print(headers)\n    }\n\n    print(\"Result:\")\n    result = h$value()\n    print(fromJSON(result))\n\n### C#\n\n    // This code requires the Nuget package Microsoft.AspNet.WebApi.Client to be installed.\n    // Instructions for doing this in Visual Studio:\n    // Tools -\u003e Nuget Package Manager -\u003e Package Manager Console\n    // Install-Package Microsoft.AspNet.WebApi.Client\n\n    using System;\n    using System.Collections.Generic;\n    using System.IO;\n    using System.Net.Http;\n    using System.Net.Http.Formatting;\n    using System.Net.Http.Headers;\n    using System.Text;\n    using System.Threading.Tasks;\n\n    namespace CallRequestResponseService\n    {\n        class Program\n        {\n            static void Main(string[] args)\n            {\n                InvokeRequestResponseService().Wait();\n            }\n\n            static async Task InvokeRequestResponseService()\n            {\n                using (var client = new HttpClient())\n                {\n                    var scoreRequest = new\n                    {\n                        Inputs = new Dictionary\u003cstring, List\u003cDictionary\u003cstring, string\u003e\u003e\u003e () {\n                            {\n                                \"input1\",\n                                new List\u003cDictionary\u003cstring, string\u003e\u003e(){new Dictionary\u003cstring, string\u003e(){\n                                                {\n                                                    \"1\", \"4\"\n                                                },\n                                                {\n                                                    \"2\", \"7\"\n                                                },\n                                                {\n                                                    \"3\", \"3\"\n                                                },\n                                                {\n                                                    \"5\", \"5\"\n                                                },\n                                                {\n                                                    \"1000025\", \"1002945\"\n                                                },\n                                                {\n                                                    \"1 (2)\", \"4\"\n                                                },\n                                                {\n                                                    \"1 (3)\", \"5\"\n                                                },\n                                                {\n                                                    \"1 (4)\", \"10\"\n                                                },\n                                                {\n                                                    \"1 (5)\", \"2\"\n                                                },\n                                                {\n                                                    \"1 (6)\", \"1\"\n                                                },\n                                                {\n                                                    \"2 (2)\", \"2\"\n                                                },\n                                    }\n                                }\n                            },\n                        },\n                        GlobalParameters = new Dictionary\u003cstring, string\u003e() {\n                        }\n                    };\n\n                    const string apiKey = \"abc123\"; // Replace this with the API key for the web service\n                    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( \"Bearer\", apiKey);\n                    client.BaseAddress = new Uri(\"https://ussouthcentral.services.azureml.net/workspaces/f764effe004044e1b1c56ce46a5a8050/services/689b12141b8b4d9886aa420832a2f406/execute?api-version=2.0\u0026format=swagger\");\n\n                    // WARNING: The 'await' statement below can result in a deadlock\n                    // if you are calling this code from the UI thread of an ASP.Net application.\n                    // One way to address this would be to call ConfigureAwait(false)\n                    // so that the execution does not attempt to resume on the original context.\n                    // For instance, replace code such as:\n                    //      result = await DoSomeTask()\n                    // with the following:\n                    //      result = await DoSomeTask().ConfigureAwait(false)\n\n                    HttpResponseMessage response = await client.PostAsJsonAsync(\"\", scoreRequest);\n\n                    if (response.IsSuccessStatusCode)\n                    {\n                        string result = await response.Content.ReadAsStringAsync();\n                        Console.WriteLine(\"Result: {0}\", result);\n                    }\n                    else\n                    {\n                        Console.WriteLine(string.Format(\"The request failed with status code: {0}\", response.StatusCode));\n\n                        // Print the headers - they include the requert ID and the timestamp,\n                        // which are useful for debugging the failure\n                        Console.WriteLine(response.Headers.ToString());\n\n                        string responseContent = await response.Content.ReadAsStringAsync();\n                        Console.WriteLine(responseContent);\n                    }\n                }\n            }\n        }\n    }\n\n## More about the project\n1. My medium article on same - [here](https://medium.com/@rishit.dagli/create-logistic-regression-algorithm-from-scratch-and-apply-it-on-data-set-3f16ca5dbdb9)\n2. My research paper on this - [here](https://iarjset.com/papers/machine-learning-as-a-decision-aid-for-breast-cancer-diagnosis/)\n3. Another must read paper about the same topic -[here](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC55130/)\n\n## Other algorithms for same project by me\n1. Multiclass Neural Networks\n2. Random Forest classifier\u003cbr\u003e\n[Project](https://gallery.azure.ai/Experiment/Breast-cancer-dataset)\n## About me\n\u003cstrong\u003eRishit Dagli\u003c/strong\u003e\u003cbr\u003e\n[Website](rishitdagli.ml)\u003cbr\u003e\n[LinkedIn](https://www.linkedin.com/in/rishit-dagli-440113165/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishit-dagli%2Fbreast-cancer-prediction-ml-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frishit-dagli%2Fbreast-cancer-prediction-ml-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishit-dagli%2Fbreast-cancer-prediction-ml-python/lists"}