├── HE4Cloud ├── AWS │ ├── Makefile │ ├── README.md │ ├── k8s │ │ └── ingress.yaml │ ├── server │ │ ├── helm │ │ │ ├── Chart.yaml │ │ │ ├── README.md │ │ │ ├── templates │ │ │ │ ├── configmap.yaml │ │ │ │ ├── deployment.yaml │ │ │ │ ├── hpa.yaml │ │ │ │ ├── secret.yaml │ │ │ │ └── service.yaml │ │ │ └── values.yaml │ │ └── server.helm.env │ └── ui │ │ ├── helm │ │ ├── .helmignore │ │ ├── Chart.yaml │ │ ├── templates │ │ │ ├── NOTES.txt │ │ │ ├── _helpers.tpl │ │ │ ├── configmap.yaml │ │ │ ├── deployment.yaml │ │ │ ├── hpa.yaml │ │ │ ├── ingress.yaml │ │ │ ├── secret.yaml │ │ │ ├── service.yaml │ │ │ ├── serviceaccount.yaml │ │ │ └── tests │ │ │ │ └── test-connection.yaml │ │ └── values.yaml │ │ └── ui.helm.env ├── Datasets │ └── Demo │ │ ├── Readme.md │ │ ├── demo_data_set.csv │ │ └── demo_data_set.json └── Notebooks │ ├── DT_Adults_Income_Application │ ├── DT_Adults_Income_App.ipynb │ ├── datasets │ │ ├── .ipynb_checkpoints │ │ │ ├── adult-checkpoint.data │ │ │ └── adult-checkpoint.names │ │ ├── README.md │ │ ├── adult.data │ │ ├── adult.names │ │ ├── adult.test │ │ ├── x_test.h5 │ │ ├── x_train.h5 │ │ ├── x_val.h5 │ │ ├── y_test.h5 │ │ ├── y_train.h5 │ │ └── y_val.h5 │ ├── generate_samples.ipynb │ ├── model │ │ ├── DT_hyper_params.hyperparams │ │ ├── dt_adults_income_model.json │ │ └── prep.pickle │ ├── preprocessor.py │ └── samples │ │ ├── sample0.raw │ │ ├── sample1.raw │ │ ├── sample10.raw │ │ ├── sample11.raw │ │ ├── sample12.raw │ │ ├── sample13.raw │ │ ├── sample14.raw │ │ ├── sample2.raw │ │ ├── sample3.raw │ │ ├── sample4.raw │ │ ├── sample5.raw │ │ ├── sample6.raw │ │ ├── sample7.raw │ │ ├── sample8.raw │ │ ├── sample9.raw │ │ ├── x_sample0.h5 │ │ ├── x_sample1.h5 │ │ ├── x_sample10.h5 │ │ ├── x_sample11.h5 │ │ ├── x_sample12.h5 │ │ ├── x_sample13.h5 │ │ ├── x_sample14.h5 │ │ ├── x_sample2.h5 │ │ ├── x_sample3.h5 │ │ ├── x_sample4.h5 │ │ ├── x_sample5.h5 │ │ ├── x_sample6.h5 │ │ ├── x_sample7.h5 │ │ ├── x_sample8.h5 │ │ ├── x_sample9.h5 │ │ ├── y_sample0.h5 │ │ ├── y_sample1.h5 │ │ ├── y_sample10.h5 │ │ ├── y_sample11.h5 │ │ ├── y_sample12.h5 │ │ ├── y_sample13.h5 │ │ ├── y_sample14.h5 │ │ ├── y_sample2.h5 │ │ ├── y_sample3.h5 │ │ ├── y_sample4.h5 │ │ ├── y_sample5.h5 │ │ ├── y_sample6.h5 │ │ ├── y_sample7.h5 │ │ ├── y_sample8.h5 │ │ └── y_sample9.h5 │ ├── FHE_Cloud_Service │ ├── FHE_Cloud_Service_Rest_Client.ipynb │ ├── lr_fraud │ │ ├── model.json │ │ ├── model.type │ │ ├── requirements │ │ └── x_test.h5 │ └── requirements.txt │ ├── LR_Loan_Approval_Application │ ├── LR_Loan_Approval_App.ipynb │ ├── datasets │ │ ├── loan_approval.generated │ │ ├── x_test.h5 │ │ ├── x_train.h5 │ │ ├── x_val.h5 │ │ ├── y_test.h5 │ │ ├── y_train.h5 │ │ └── y_val.h5 │ ├── generate_samples.ipynb │ ├── model │ │ ├── loan_approval_model.requirements │ │ ├── loan_approval_model.type │ │ ├── lr_loan_approval_model.json │ │ └── prep.pickle │ ├── preprocessor.py │ └── samples │ │ ├── sample0.raw │ │ ├── sample1.raw │ │ ├── sample10.raw │ │ ├── sample11.raw │ │ ├── sample12.raw │ │ ├── sample13.raw │ │ ├── sample14.raw │ │ ├── sample2.raw │ │ ├── sample3.raw │ │ ├── sample4.raw │ │ ├── sample5.raw │ │ ├── sample6.raw │ │ ├── sample7.raw │ │ ├── sample8.raw │ │ ├── sample9.raw │ │ ├── x_sample0.h5 │ │ ├── x_sample1.h5 │ │ ├── x_sample10.h5 │ │ ├── x_sample11.h5 │ │ ├── x_sample12.h5 │ │ ├── x_sample13.h5 │ │ ├── x_sample14.h5 │ │ ├── x_sample2.h5 │ │ ├── x_sample3.h5 │ │ ├── x_sample4.h5 │ │ ├── x_sample5.h5 │ │ ├── x_sample6.h5 │ │ ├── x_sample7.h5 │ │ ├── x_sample8.h5 │ │ ├── x_sample9.h5 │ │ ├── y_sample0.h5 │ │ ├── y_sample1.h5 │ │ ├── y_sample10.h5 │ │ ├── y_sample11.h5 │ │ ├── y_sample12.h5 │ │ ├── y_sample13.h5 │ │ ├── y_sample14.h5 │ │ ├── y_sample2.h5 │ │ ├── y_sample3.h5 │ │ ├── y_sample4.h5 │ │ ├── y_sample5.h5 │ │ ├── y_sample6.h5 │ │ ├── y_sample7.h5 │ │ ├── y_sample8.h5 │ │ └── y_sample9.h5 │ ├── NN_Heart_Disease_Application │ ├── NN_Heart_Disease_Application.ipynb │ ├── datasets │ │ ├── heart_disease.csv │ │ ├── x_test.h5 │ │ ├── x_train.h5 │ │ ├── x_val.h5 │ │ ├── y_test.h5 │ │ ├── y_train.h5 │ │ └── y_val.h5 │ ├── generate_samples.ipynb │ ├── model │ │ ├── heart_disease_model.type │ │ ├── nn_heart_disease_model.json │ │ ├── nn_heart_disease_model_weights.h5 │ │ └── prep.pickle │ ├── preprocessor.py │ └── samples │ │ ├── sample0.raw │ │ ├── sample1.raw │ │ ├── sample10.raw │ │ ├── sample11.raw │ │ ├── sample12.raw │ │ ├── sample13.raw │ │ ├── sample14.raw │ │ ├── sample2.raw │ │ ├── sample3.raw │ │ ├── sample4.raw │ │ ├── sample5.raw │ │ ├── sample6.raw │ │ ├── sample7.raw │ │ ├── sample8.raw │ │ ├── sample9.raw │ │ ├── x_sample0.h5 │ │ ├── x_sample1.h5 │ │ ├── x_sample10.h5 │ │ ├── x_sample11.h5 │ │ ├── x_sample12.h5 │ │ ├── x_sample13.h5 │ │ ├── x_sample14.h5 │ │ ├── x_sample2.h5 │ │ ├── x_sample3.h5 │ │ ├── x_sample4.h5 │ │ ├── x_sample5.h5 │ │ ├── x_sample6.h5 │ │ ├── x_sample7.h5 │ │ ├── x_sample8.h5 │ │ ├── x_sample9.h5 │ │ ├── y_sample0.h5 │ │ ├── y_sample1.h5 │ │ ├── y_sample10.h5 │ │ ├── y_sample11.h5 │ │ ├── y_sample12.h5 │ │ ├── y_sample13.h5 │ │ ├── y_sample14.h5 │ │ ├── y_sample2.h5 │ │ ├── y_sample3.h5 │ │ ├── y_sample4.h5 │ │ ├── y_sample5.h5 │ │ ├── y_sample6.h5 │ │ ├── y_sample7.h5 │ │ ├── y_sample8.h5 │ │ └── y_sample9.h5 │ ├── NN_Loan_Approval_Application │ ├── NN_Loan_Approval_Application.ipynb │ ├── datasets │ │ ├── loan_approval.generated │ │ ├── x_test.h5 │ │ ├── x_train.h5 │ │ ├── x_val.h5 │ │ ├── y_test.h5 │ │ ├── y_train.h5 │ │ └── y_val.h5 │ ├── generate_samples.ipynb │ ├── model │ │ ├── loan_approval_model.requirements │ │ ├── loan_approval_model.type │ │ ├── nn_loan_approval_model.json │ │ ├── nn_loan_approval_model_weights.h5 │ │ └── prep.pickle │ ├── preprocessor.py │ └── samples │ │ ├── sample0.raw │ │ ├── sample1.raw │ │ ├── sample10.raw │ │ ├── sample11.raw │ │ ├── sample12.raw │ │ ├── sample13.raw │ │ ├── sample14.raw │ │ ├── sample2.raw │ │ ├── sample3.raw │ │ ├── sample4.raw │ │ ├── sample5.raw │ │ ├── sample6.raw │ │ ├── sample7.raw │ │ ├── sample8.raw │ │ ├── sample9.raw │ │ ├── x_sample0.h5 │ │ ├── x_sample1.h5 │ │ ├── x_sample10.h5 │ │ ├── x_sample11.h5 │ │ ├── x_sample12.h5 │ │ ├── x_sample13.h5 │ │ ├── x_sample14.h5 │ │ ├── x_sample2.h5 │ │ ├── x_sample3.h5 │ │ ├── x_sample4.h5 │ │ ├── x_sample5.h5 │ │ ├── x_sample6.h5 │ │ ├── x_sample7.h5 │ │ ├── x_sample8.h5 │ │ ├── x_sample9.h5 │ │ ├── y_sample0.h5 │ │ ├── y_sample1.h5 │ │ ├── y_sample10.h5 │ │ ├── y_sample11.h5 │ │ ├── y_sample12.h5 │ │ ├── y_sample13.h5 │ │ ├── y_sample14.h5 │ │ ├── y_sample2.h5 │ │ ├── y_sample3.h5 │ │ ├── y_sample4.h5 │ │ ├── y_sample5.h5 │ │ ├── y_sample6.h5 │ │ ├── y_sample7.h5 │ │ ├── y_sample8.h5 │ │ └── y_sample9.h5 │ └── XGB_Fraud_Detection_Application │ ├── XGB_Fraud_Detection_App.ipynb │ ├── datasets │ ├── fraud_detection.csv │ ├── x_test.h5 │ ├── x_train.h5 │ ├── x_val.h5 │ ├── y_test.h5 │ ├── y_train.h5 │ └── y_val.h5 │ ├── generate_samples.ipynb │ ├── model │ ├── XGB_hyper_params.hyperparams │ ├── fraud_detection_xgb_model.json │ └── prep.pickle │ ├── preprocessor.py │ └── samples │ ├── sample0.raw │ ├── sample1.raw │ ├── sample10.raw │ ├── sample11.raw │ ├── sample12.raw │ ├── sample13.raw │ ├── sample14.raw │ ├── sample2.raw │ ├── sample3.raw │ ├── sample4.raw │ ├── sample5.raw │ ├── sample6.raw │ ├── sample7.raw │ ├── sample8.raw │ ├── sample9.raw │ ├── x_sample0.h5 │ ├── x_sample1.h5 │ ├── x_sample10.h5 │ ├── x_sample11.h5 │ ├── x_sample12.h5 │ ├── x_sample13.h5 │ ├── x_sample14.h5 │ ├── x_sample2.h5 │ ├── x_sample3.h5 │ ├── x_sample4.h5 │ ├── x_sample5.h5 │ ├── x_sample6.h5 │ ├── x_sample7.h5 │ ├── x_sample8.h5 │ ├── x_sample9.h5 │ ├── y_sample0.h5 │ ├── y_sample1.h5 │ ├── y_sample10.h5 │ ├── y_sample11.h5 │ ├── y_sample12.h5 │ ├── y_sample13.h5 │ ├── y_sample14.h5 │ ├── y_sample2.h5 │ ├── y_sample3.h5 │ ├── y_sample4.h5 │ ├── y_sample5.h5 │ ├── y_sample6.h5 │ ├── y_sample7.h5 │ ├── y_sample8.h5 │ └── y_sample9.h5 ├── LICENSE.md └── README.md /HE4Cloud/AWS/Makefile: -------------------------------------------------------------------------------- 1 | ifneq ($(HELM_CONFIG),) 2 | include $(HELM_CONFIG) 3 | endif 4 | 5 | BLACK := \033[0;30m 6 | DARK_GRAY := \033[1;30m 7 | RED := \033[0;31m 8 | LIGHT_RED := \033[1;31m 9 | GREEN := \033[0;32m 10 | LIGHT_GREEN := \033[1;32m 11 | ORANGE := \033[0;33m 12 | YELLOW := \033[1;33m 13 | BLUE := \033[0;34m 14 | LIGHT_BLUE := \033[1;34m 15 | PURPLE := \033[0;35m 16 | LIGHT_PURPLE := \033[1;35m 17 | CYAN := \033[0;36m 18 | LIGHT_CYAN := \033[1;36m 19 | LIGHT_GRAY := \033[0;37m 20 | WHITE := \033[1;37m 21 | # No Color 22 | NC := \033[0m 23 | 24 | MAKEFILE_PATH := $(firstword $(MAKEFILE_LIST)) 25 | THIS_DIR := $(dir $(abspath $(MAKEFILE_PATH))) 26 | toLC = $(shell echo $1 | tr '[:upper:]' '[:lower:]') 27 | 28 | HELM_UI_INSTALL_NAME := he4cloud-ui 29 | HELM_SERVER_INSTALL_NAME := he4cloud-server-provisioning 30 | 31 | ## Install/Upgrade HE4Cloud UI helm chart 32 | ## Options: 33 | ## HELM_CONFIG= [Mandatory] Path to Helm config file 34 | .PHONY: helm-ui-install 35 | helm-ui-install: 36 | @if [ -z ${HELM_CONFIG} ] || [ ! -f ${HELM_CONFIG} ]; then \ 37 | echo "HELM_CONFIG not found or defined"; \ 38 | exit 1; \ 39 | fi; 40 | 41 | @helm upgrade \ 42 | --set "deployment.env=AWS" \ 43 | --set "image.repository=${REMOTE_IMAGE_REPO}/${REMOTE_IMAGE_NAME}" \ 44 | --set "image.tag=${REMOTE_IMAGE_TAG}" \ 45 | --set "imagePullSecrets[0].name=${K8S_IMAGE_PULL_SECRETS}" \ 46 | --set "env.clusterUrl=${CLUSTER_URL}" \ 47 | --set "env.serverBaseUrl=${SERVER_PUBLIC_ENDPOINT}" \ 48 | --set "env.apiVersion=v0.1" \ 49 | --set "env.commonClientId=${AWS_COGNITO_CLIENT_ID}" \ 50 | --set "env.commonClientSecret=${AWS_COGNITO_CLIENT_SECRET}" \ 51 | --set "env.commonBaseAuthorizationUrl=${AWS_COGNITO_AUTH_API_URL}" \ 52 | --set "env.commonIssuer=${AWS_COGNITO_AUTH_ISSUER}" \ 53 | --set "env.kmsEnv=AWS" \ 54 | --set "env.aws.roleArn=${AWS_COGNITO_USER_ROLE_ARN}" \ 55 | --set "env.aws.accountId=${AWS_ACCOUNT_ID}" \ 56 | --set "env.aws.identityPoolId=${AWS_COGNITO_IDENTITY_POOL_ID}" \ 57 | --set "env.aws.loginId=${AWS_COGNITO_IDENTITY_PROVIDER_NAME}" \ 58 | --install \ 59 | --atomic \ 60 | --cleanup-on-fail \ 61 | ${PARAMS} \ 62 | ${HELM_UI_INSTALL_NAME} \ 63 | ${THIS_DIR}./ui/helm 64 | 65 | ## Uninstall HE4Cloud UI helm chart 66 | .PHONY: helm-ui-uninstall 67 | helm-ui-uninstall: 68 | @helm uninstall ${HELM_UI_INSTALL_NAME} 69 | 70 | ## Install HE4Cloud server helm chart 71 | ## Options: 72 | ## HELM_CONFIG= [Mandatory] Path to Helm config file 73 | .PHONY: helm-server-install 74 | helm-server-install: 75 | @if [ -z ${HELM_CONFIG} ] || [ ! -f ${HELM_CONFIG} ]; then \ 76 | echo "HELM_CONFIG not found or defined"; \ 77 | exit 1; \ 78 | fi; 79 | 80 | @helm upgrade \ 81 | --set "deployment.env=AWS" \ 82 | --set "image.repository=${REMOTE_IMAGE_REPO}/${REMOTE_IMAGE_NAME}" \ 83 | --set "image.tag=${REMOTE_IMAGE_TAG}" \ 84 | --set "imagePullSecrets[0].name=${K8S_IMAGE_PULL_SECRETS}" \ 85 | --set "env.cluster_ip=${CLUSTER_PUBLIC_ENDPOINT}" \ 86 | --set "env.api_version=v0.1" \ 87 | --set "env.shared_model_bucket=shared-bucket" \ 88 | --set "env.aws.cognito_client_id=${AWS_COGNITO_CLIENT_ID}" \ 89 | --set "env.aws.cognito_identity_provider_name=${AWS_COGNITO_IDENTITY_PROVIDER_NAME}" \ 90 | --set "env.aws.cognito_signing_keys_url=${AWS_COGNITO_SIGNING_KEYS_URL}" \ 91 | --set "env.aws.mongodb_connection_string=${MONGODB_CONNECTION_STRING}" \ 92 | --set "env.aws.mongodb_database=${MONGODB_DATABASE}" \ 93 | --set "env.aws.access_key_id=${AWS_ACCESS_KEY_ID}" \ 94 | --set "env.aws.secret_access_key=${AWS_SECRET_ACCESS_KEY}" \ 95 | --install \ 96 | --atomic \ 97 | --cleanup-on-fail \ 98 | ${PARAMS} \ 99 | ${HELM_SERVER_INSTALL_NAME} \ 100 | ${THIS_DIR}./server/helm 101 | 102 | ## Uninstall HE4Cloud server helm chart 103 | .PHONY: helm-server-uninstall 104 | helm-server-uninstall: 105 | @helm uninstall ${HELM_SERVER_INSTALL_NAME} 106 | 107 | ## Install Ingress 108 | ## Options: 109 | ## HOST= [Mandatory] The Domain Host name 110 | .PHONY: deploy-ingress 111 | deploy-ingress: 112 | @if [ -z ${HOST} ]; then \ 113 | echo "HOST not defined"; \ 114 | exit 1; \ 115 | fi; 116 | 117 | @yq eval ".spec.tls[0].hosts = [\"${HOST}\"]" --inplace ${THIS_DIR}./k8s/ingress.yaml 118 | @kubectl apply -f ${THIS_DIR}./k8s/ingress.yaml 119 | 120 | .PHONY: help 121 | help: 122 | @printf "Usage:\n"; 123 | @printf "make [target]\n"; 124 | @printf "\ntargets:\n"; 125 | @awk '{ \ 126 | if ($$0 ~ /^.PHONY: [a-zA-Z\-_0-9]+$$/) { \ 127 | helpCommand = substr($$0, index($$0, ":") + 2); \ 128 | if (helpMessage) { \ 129 | printf "${LIGHT_CYAN}%-15s${NC} %s\n", helpCommand, helpMessage; \ 130 | helpMessage = ""; \ 131 | } \ 132 | } else if ($$0 ~ /^[a-zA-Z\-_0-9.]+:/) { \ 133 | helpCommand = substr($$0, 0, index($$0, ":")); \ 134 | if (helpMessage) { \ 135 | printf "${CYAN}%-35s${NC} %s\n", helpCommand, helpMessage; \ 136 | helpMessage = ""; \ 137 | } \ 138 | } else if ($$0 ~ /^##/) { \ 139 | if (helpMessage) { \ 140 | helpMessage = sprintf("%s\n%-20s%s", helpMessage, "" ,substr($$0, 3)); \ 141 | } else { \ 142 | helpMessage = substr($$0, 3); \ 143 | } \ 144 | } else { \ 145 | if (helpMessage) { \ 146 | print "\n%-35s\n", helpMessage \ 147 | } \ 148 | helpMessage = ""; \ 149 | } \ 150 | }' \ 151 | $(MAKEFILE_LIST) 152 | 153 | .DEFAULT_GOAL := help -------------------------------------------------------------------------------- /HE4Cloud/AWS/README.md: -------------------------------------------------------------------------------- 1 | # HE for Cloud - AWS Installation 2 | 3 | ## Pre-requisisties 4 | - An AWS Account with administrator privileges 5 | - A DNS domain. 6 | 7 | ## AWS Services Setup 8 | 1. ### **AWS Cognito** 9 | 1. Create a `user pool` with the following settings: 10 | 1. In step 5 of creating the user pool - **Integrate you app** 11 | - Under the **Hosted authentication pages** section, check **Use the Cognito Hosted UI**. 12 | - Under the **Initial app client section**: 13 | - select **Confidential client**. 14 | - In the **Allowed callbacks URLs**, add https://``/IBMid/callback 15 | 1. Create an `identity pool` with the following settings: 16 | 1. **Authentication flow settings** having **Allow Basic (Classic) Flow** checked. 17 | 1. **Authentication providers**, in the cognito tab enter the **User Pool ID** and its associated **App client id**, created in the previous steps. 18 | 19 | 1. ### **IAM** 20 | 1. Create an IAM Policy with the following actions defined: 21 | - `kms:TagResource` 22 | - `kms:PutKeyPolicy` 23 | - `kms:CreateAlias` 24 | - `kms:ListKeys` 25 | - `kms:ListAliases` 26 | - `kms:CreateKey` 27 | 1. Create an IAM role with the following settings: 28 | - *Trusted entity type*: `Web Identity` 29 | - *Identity Provider*: `Amazon Cognito` 30 | - *Identity Pool ID*: The ID of the Identity Pool created in `1.2` 31 | - Add the policy defined in `2.1` to the Role’s Permissions list 32 | 1. Create an IAM policy with the following actions defined: 33 | - `s3:CreateBucket` 34 | - `s3:ListBucket` 35 | - `s3:DeleteBucket` 36 | - `s3:PutObject` 37 | - `s3:GetObject` 38 | - `s3:DeleteObject` 39 | 1. Create an `IAM User` with the following settings: 40 | - `"AWS Access Type"` of `"Access key - Programmatic Access"` 41 | - Attach the IAM Policy created in step 3. 42 | - Save the `Access Key` and `Secret Key` generated at the end of the process. 43 | 44 | 1. ### **Elastic Kubernetes Service (EKS)** 45 | 1. Create a cluster. 46 | 1. Install AWS Load Balancer Controller (Follow instructions in [AWS documentation](https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html)). 47 | 1. Create a Kubernetes docker-registry secret to a Docker repository which will contain the He4Cloud images. 48 | 49 | ## MongoDB 50 | Create a [free](https://www.mongodb.com/cloud/atlas/register) MongoDb cluster. 51 | 52 | ## Installation of HE4Cloud Components 53 | - ### **Pre-requisisties**: 54 | The following tools need to be installed: 55 | - `kubectl` 56 | - `helm` 57 | - `yq` 58 | - `make` 59 | 60 | **`Notes:`** 61 | - kubectl needs to be configured to access the kubernetes cluster created above. 62 | - Push the He4Cloud images found in IBM Box to the Docker repository used during `IAM Services` step `3.3`. Contact chamliam@ie.ibm.com to get access to IBM Box. 63 | 64 | 1. ### **Ingress** 65 | 1. Run make command: 66 | ```makefile 67 | make deploy-ingress HOST= 68 | ``` 69 | 2. Add HTTPS Listener to the created Load Balancer (Follow instructions in AWS documentation). 70 | 1. ### **HE4Cloud Server** 71 | 1. Modify file [server.helm.env](./server/server.helm.env). 72 | Follow instructions in the file. 73 | 1. Run make command: 74 | ```makefile 75 | make helm-server-install HELM_CONFIG= 76 | ``` 77 | 1. ### **HE4Cloud UI** 78 | 1. Modify file [ui.helm.env](./ui/ui.helm.env). 79 | Follow instructions in the file. 80 | 1. Run make command: 81 | ```makefile 82 | make helm-ui-install HELM_CONFIG= 83 | ``` 84 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/k8s/ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | annotations: 5 | alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]' 6 | alb.ingress.kubernetes.io/scheme: internet-facing 7 | alb.ingress.kubernetes.io/target-type: ip 8 | kubernetes.io/ingress.class: alb 9 | name: he4cloud-ingress-stage 10 | namespace: default 11 | spec: 12 | rules: 13 | - http: 14 | paths: 15 | - backend: 16 | service: 17 | name: he4cloud-server-provisioning 18 | port: 19 | number: 5001 20 | path: /api 21 | pathType: Prefix 22 | - backend: 23 | service: 24 | name: he4cloud-ui 25 | port: 26 | number: 3000 27 | path: / 28 | pathType: Prefix 29 | tls: 30 | - hosts: 31 | - stage.he4cloud.com 32 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/server/helm/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: he4cloud-cloud-function 3 | description: A he4cloud backend helm chart 4 | type: application 5 | version: 0.1.0 6 | appVersion: "1.16.0" 7 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/server/helm/README.md: -------------------------------------------------------------------------------- 1 | # HE for Cloud HELM chart deployment instructions 2 | 3 | 1. Create a Kubernetes secret with your Artifactory credentials: 4 | 5 | ``` 6 | kubectl create secret docker-registry -n artregcred \ 7 | --docker-server=res-he4cloud-team-docker-local.artifactory.swg-devops.com \ 8 | --docker-username= \ 9 | --docker-password= \ 10 | --docker-email= 11 | ``` 12 | where 13 | `` is the namespace you plan to deploy he4cloud to; 14 | `` is your Artifactory email; 15 | `` is retrieved from your Artifactory profile. 16 | 17 | 2. Modify `values.yaml` to your secret manager values (these will be provided from the installation of IBM Secret Manager/Vault) 18 | 19 | ``` 20 | secret_manager_url: 21 | secret_manager_token: 22 | secret_path: 23 | he4c_env: 24 | ``` 25 | where `he4c_env` is one of: 26 | - `IBM` when deploying to the IBM cloud; 27 | - `K8S` for on-prem deployment; 28 | - `CASH` for deployment to the CASH OpenShift environment 29 | 30 | 3. Deploy the server - run from the `helm` directory: 31 | 32 | ``` 33 | helm install . -n 34 | ``` 35 | where `` is the name the release will be created as (eg `he4cloud`) and `` is the name of the namespace to deploy to. **Note:** the namespace must already exist 36 | 37 | 4. To uninstall: 38 | 39 | ``` 40 | helm uninstall -n 41 | ``` 42 | 43 | Note: If you use other images or tags, just modify `values.yaml` as required. 44 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/server/helm/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: he4cloud-server-provisioning-config 5 | data: 6 | # Server Specific Environment Variables 7 | CLUSTER_IP: {{ .Values.env.cluster_ip | quote }} 8 | THREAD_POOL_SIZE: {{ .Values.env.thread_pool_size | quote }} 9 | API_VERSION: {{ .Values.env.api_version | quote }} 10 | LIMITATIONS: {{ .Values.env.limitations | toJson | quote }} 11 | EXPIRATION_FILE_PREFIX: {{ .Values.env.expiration_file_prefix | quote }} 12 | SHARED_MODELS_BUCKET: {{ .Values.env.shared_model_bucket | quote }} 13 | UPLOAD_LINK_TIMEOUT: {{ .Values.env.upload_link_timeout | quote }} 14 | LOCK_FILE: {{ .Values.env.lockFile | quote }} 15 | # Common Library Environment Variables 16 | HE4C_ENV: {{ .Values.deployment.env }} 17 | LOGS_PATH: {{ .Values.env.logPath | quote }} 18 | LOGGER_STDOUT_LEVEL: {{ get .Values.logger.level.stdout .Values.deployment.stage | quote }} 19 | LOGGER_FILE_LEVEL: {{ get .Values.logger.level.file .Values.deployment.stage | quote }} 20 | {{- if eq .Values.deployment.env "IBM" }} 21 | IBM_CLOUD_COS_ENDPOINT: {{ .Values.env.ibm.cos_endpoint | quote }} 22 | IBM_CLOUD_COS_INSTANCE_ID: {{ .Values.env.ibm.cos_instance_id | quote }} 23 | IBM_CLOUD_COS_IAM_AUTH_ENDPOINT: {{ .Values.env.ibm.cos_iam_auth_endpoint | quote }} 24 | IBM_CLOUD_COS_ACCESS_KEY_ID: {{ .Values.env.ibm.cos_access_key_id | quote }} 25 | IBM_CLOUD_APPID_AUTH_URL: {{ .Values.env.ibm.appid_auth_url | quote }} 26 | IBM_CLOUD_APPID_CLIENT_ID: {{ .Values.env.ibm.appid_client_id | quote }} 27 | CLOUDANT_URL: {{ .Values.env.ibm.cloudant_url | quote }} 28 | {{- end }} 29 | {{- if eq .Values.deployment.env "AWS" }} 30 | AWS_COGNITO_CLIENT_ID: {{ .Values.env.aws.cognito_client_id | quote }} 31 | AWS_COGNITO_IDENTITY_PROVIDER_NAME: {{ .Values.env.aws.cognito_identity_provider_name | quote }} 32 | AWS_COGNITO_SIGNING_KEYS_URL: {{ .Values.env.aws.cognito_signing_keys_url | quote }} 33 | MONGODB_DATABASE: {{ .Values.env.aws.mongodb_database | quote }} 34 | AWS_ACCESS_KEY_ID: {{ .Values.env.aws.access_key_id | quote }} 35 | {{- end }} 36 | {{- if eq .Values.deployment.env "K8S"}} 37 | KEYCLOAK_URL: {{ .Values.env.k8s.keycloak_url | quote }} 38 | KEYCLOAK_CLIENT_ID: {{ .Values.env.k8s.keycloak_client_id | quote }} 39 | MONGODB_DATABASE: {{ .Values.env.k8s.mongodb_database | quote }} 40 | MINIO_URL: {{ .Values.env.k8s.minio_url | quote }} 41 | MINIO_USER: {{ .Values.env.k8s.minio_user | quote }} 42 | {{- end }} 43 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/server/helm/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: he4cloud-server-provisioning 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: he4cloud-server-provisioning 9 | replicas: {{ .Values.replicaCount }} 10 | template: 11 | metadata: 12 | labels: 13 | app: he4cloud-server-provisioning 14 | spec: 15 | {{- with .Values.imagePullSecrets }} 16 | imagePullSecrets: 17 | {{- toYaml . | nindent 8 }} 18 | {{- end }} 19 | terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} 20 | containers: 21 | - name: he4cloud-server-provisioning 22 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 23 | imagePullPolicy: {{ .Values.image.pullPolicy }} 24 | ports: 25 | - containerPort: {{ .Values.service.port }} 26 | protocol: TCP 27 | #livenessProbe: 28 | # httpGet: 29 | # scheme: HTTP 30 | # path: /healthz 31 | # port: {{ .Values.monitoringPort }} 32 | # initialDelaySeconds: 20 33 | # timeoutSeconds: 9 34 | # periodSeconds: 10 35 | #readinessProbe: 36 | # httpGet: 37 | # scheme: HTTP 38 | # path: /ready 39 | # port: {{ .Values.monitoringPort }} 40 | # initialDelaySeconds: 20 41 | # timeoutSeconds: 9 42 | # periodSeconds: 10 43 | #lifecycle: 44 | # preStop: 45 | # httpGet: 46 | # path: terminate 47 | # port: {{ .Values.monitoringPort }} 48 | envFrom: 49 | - configMapRef: 50 | name: he4cloud-server-provisioning-config 51 | - secretRef: 52 | name: he4cloud-server-provisioning-secret 53 | resources: 54 | {{- toYaml .Values.resources | nindent 12 }} 55 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/server/helm/templates/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.autoscaling.enabled }} 2 | apiVersion: autoscaling/v1 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: he4cloud-server-provisioning-hpa 6 | spec: 7 | scaleTargetRef: 8 | apiVersion: apps/v1 9 | kind: Deployment 10 | name: he4cloud-server-provisioning 11 | minReplicas: {{ .Values.autoscaling.minReplicas }} 12 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 13 | targetCPUUtilizationPercentage: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} 14 | {{- end }} -------------------------------------------------------------------------------- /HE4Cloud/AWS/server/helm/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: he4cloud-server-provisioning-secret 5 | type: Opaque 6 | data: 7 | {{- if eq .Values.deployment.env "IBM" }} 8 | IBM_CLOUD_COS_IAM_API_KEY: {{ .Values.env.ibm.cos_iam_api_key | b64enc }} 9 | IBM_CLOUD_COS_SECRET_ACCESS_KEY: {{ .Values.env.ibm.cos_secret_access_key | b64enc }} 10 | IBM_CLOUD_APPID_CLIENT_SECRET: {{ .Values.env.ibm.appid_client_secret | b64enc }} 11 | CLOUDANT_APIKEY: {{ .Values.env.ibm.cloudant_apikey | b64enc }} 12 | {{- end }} 13 | {{- if eq .Values.deployment.env "AWS" }} 14 | MONGODB_CONNECTION_STRING: {{ .Values.env.aws.mongodb_connection_string | b64enc }} 15 | AWS_SECRET_ACCESS_KEY: {{ .Values.env.aws.secret_access_key | b64enc }} 16 | {{- end }} 17 | {{- if eq .Values.deployment.env "K8S" }} 18 | KEYCLOAK_CLIENT_SECRET: {{ .Values.env.k8s.keycloak_client_secret | b64enc }} 19 | MONGODB_CONNECTION_STRING: {{ .Values.env.k8s.mongodb_connection_string | b64enc }} 20 | MINIO_USER_PASSWORD: {{ .Values.env.k8s.minio_user_password | b64enc }} 21 | {{- end}} 22 | 23 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/server/helm/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: he4cloud-server-provisioning 5 | spec: 6 | type: {{ .Values.service.type }} 7 | ports: 8 | - port: {{ .Values.service.port }} 9 | selector: 10 | app: he4cloud-server-provisioning 11 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/server/helm/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 1 2 | 3 | image: 4 | repository: icr.io/he4cloud/he4cloud-server-provisioning 5 | pullPolicy: Always 6 | # Overrides the image tag whose default is the chart appVersion. 7 | tag: "latest" 8 | 9 | deployment: 10 | # select one of the possible values: IBM, K8S, CASH, AWS. 11 | # IBM when deploying to IBM Cloud. 12 | # K8S for on-prem deployment. 13 | # CASH for deployment to the Cash environment 14 | # AWS for deployment to the AWS environment 15 | env: "" 16 | stage: "dev" 17 | 18 | env: 19 | logPath: /home/user/logs 20 | lockFile: /home/user/logs/.lock 21 | cluster_ip: "" 22 | thread_pool_size: "10" 23 | api_version: "" 24 | shared_model_bucket: "" 25 | limitations: 26 | context_size: 1000000000 27 | prediction_time: 900000000000 28 | num_predictions : 300 29 | expiration: 30 30 | max_payload: 5000000000 31 | num_trains: 500 32 | num_active_models: 500 33 | num_deployed_models: 500 34 | expiration_file_prefix: "UF_" 35 | upload_link_timeout: "60" 36 | ibm: 37 | # For IBM Cloud only: 38 | cos_endpoint: "" 39 | cos_instance_id: "" 40 | cos_iam_api_key: "" # Secret 41 | cos_iam_auth_endpoint: "" 42 | cos_access_key_id: "" 43 | cos_secret_access_key: "" # Secret 44 | appid_auth_url: "" 45 | appid_client_id: "" 46 | appid_client_secret: "" # Secret 47 | cloudant_url: "" 48 | cloudant_apikey: "" # Secret 49 | aws: 50 | # For AWS only: 51 | cognito_client_id: "" 52 | cognito_identity_provider_name: "" 53 | cognito_signing_keys_url: "" 54 | mongodb_connection_string: "" # Secret 55 | mongodb_database: "" 56 | access_key_id: "" 57 | secret_access_key: "" # Secret 58 | k8s: 59 | # For K8S only: 60 | mongodb_connection_string: "" # Secret 61 | mongodb_database: "" 62 | keycloak_client_id: "" 63 | keycloak_client_secret: "" # Secret 64 | keycloak_url: "" 65 | minio_url: "" 66 | minio_user: "" 67 | minio_user_password: "" # Secret 68 | 69 | imagePullSecrets: 70 | artregcred 71 | 72 | autoscaling: 73 | enabled: false 74 | minReplicas: 1 75 | maxReplicas: 100 76 | targetCPUUtilizationPercentage: 80 77 | # targetMemoryUtilizationPercentage: 80 78 | 79 | resources: {} 80 | # limits: 81 | # cpu: 1000m 82 | # requests: 83 | # cpu: 500m 84 | 85 | terminationGracePeriodSeconds: 60 86 | 87 | logger: 88 | level: 89 | file: 90 | dev: "DEBUG" 91 | prod: "DEBUG" 92 | stdout: 93 | dev: "DEBUG" 94 | prod: "INFO" 95 | 96 | service: 97 | type: ClusterIP 98 | port: 5001 99 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/server/server.helm.env: -------------------------------------------------------------------------------- 1 | #? K8s configuration 2 | #* Replace with the Docker repository name containing the image 3 | export REMOTE_IMAGE_REPO= 4 | #* Replace with the name of the image 5 | export REMOTE_IMAGE_NAME= 6 | #* Replace with the tag of the image 7 | export REMOTE_IMAGE_TAG= 8 | #* Replace with the K8s secret to connect to the Docker repository containing the image 9 | export K8S_IMAGE_PULL_SECRETS= 10 | 11 | #? NoSQL Database 12 | #* Replace with connection string of the MongoDB 13 | export MONGODB_CONNECTION_STRING= 14 | #* The MongoDB database name, can be changed. 15 | export MONGODB_DATABASE=rest_server_db 16 | 17 | #? General AWS 18 | #* Replace with the Access Key of the IAM user created during setup 19 | export AWS_ACCESS_KEY_ID= 20 | #* Replace with the Secret Access Key of the IAM user created during setup 21 | export AWS_SECRET_ACCESS_KEY= 22 | 23 | #? Authentication Service 24 | #* Replace with client id of the app client generated during setup 25 | export AWS_COGNITO_CLIENT_ID= 26 | #* Replace with region where the user pool was created during setup, e.g. us-east-1 27 | #* Replace with user pool id generated during setup 28 | export AWS_COGNITO_IDENTITY_PROVIDER_NAME=cognito-idp..amazonaws.com/ 29 | export AWS_COGNITO_SIGNING_KEYS_URL=https://cognito-idp..amazonaws.com//.well-known/jwks.json 30 | 31 | #? Server configuration 32 | #* Replace with the url of the ingress host 33 | export CLUSTER_PUBLIC_ENDPOINT= -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: he4cloud-ui 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | appVersion: 1.16.0 24 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | 1. Get the application URL by running these commands: 2 | {{- if .Values.ingress.enabled }} 3 | {{- range $host := .Values.ingress.hosts }} 4 | {{- range .paths }} 5 | http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} 6 | {{- end }} 7 | {{- end }} 8 | {{- else if contains "NodePort" .Values.service.type }} 9 | export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "he4cloud-ui.fullname" . }}) 10 | export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") 11 | echo http://$NODE_IP:$NODE_PORT 12 | {{- else if contains "LoadBalancer" .Values.service.type }} 13 | NOTE: It may take a few minutes for the LoadBalancer IP to be available. 14 | You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "he4cloud-ui.fullname" . }}' 15 | export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "he4cloud-ui.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") 16 | echo http://$SERVICE_IP:{{ .Values.service.port }} 17 | {{- else if contains "ClusterIP" .Values.service.type }} 18 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "he4cloud-ui.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") 19 | echo "Visit http://127.0.0.1:8080 to use your application" 20 | kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Expand the name of the chart. 3 | */}} 4 | {{- define "he4cloud-ui.name" -}} 5 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 6 | {{- end }} 7 | 8 | {{/* 9 | Create a default fully qualified app name. 10 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 11 | If release name contains chart name it will be used as a full name. 12 | */}} 13 | {{- define "he4cloud-ui.fullname" -}} 14 | {{- if .Values.fullnameOverride }} 15 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 16 | {{- else }} 17 | {{- $name := default .Chart.Name .Values.nameOverride }} 18 | {{- if contains $name .Release.Name }} 19 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 20 | {{- else }} 21 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 22 | {{- end }} 23 | {{- end }} 24 | {{- end }} 25 | 26 | {{/* 27 | Create chart name and version as used by the chart label. 28 | */}} 29 | {{- define "he4cloud-ui.chart" -}} 30 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 31 | {{- end }} 32 | 33 | {{/* 34 | Common labels 35 | */}} 36 | {{- define "he4cloud-ui.labels" -}} 37 | helm.sh/chart: {{ include "he4cloud-ui.chart" . }} 38 | {{ include "he4cloud-ui.selectorLabels" . }} 39 | {{- if .Chart.AppVersion }} 40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 41 | {{- end }} 42 | app.kubernetes.io/managed-by: {{ .Release.Service }} 43 | {{- end }} 44 | 45 | {{/* 46 | Selector labels 47 | */}} 48 | {{- define "he4cloud-ui.selectorLabels" -}} 49 | app.kubernetes.io/name: {{ include "he4cloud-ui.name" . }} 50 | app.kubernetes.io/instance: {{ .Release.Name }} 51 | {{- end }} 52 | 53 | {{/* 54 | Create the name of the service account to use 55 | */}} 56 | {{- define "he4cloud-ui.serviceAccountName" -}} 57 | {{- if .Values.serviceAccount.create }} 58 | {{- default (include "he4cloud-ui.fullname" .) .Values.serviceAccount.name }} 59 | {{- else }} 60 | {{- default "default" .Values.serviceAccount.name }} 61 | {{- end }} 62 | {{- end }} 63 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: he4cloud-ui-config 5 | data: 6 | HE4C_ENV: {{ .Values.deployment.env | quote }} 7 | CLUSTER_URL: {{ .Values.env.clusterUrl | quote }} 8 | SERVER_BASE_URL: {{ .Values.env.serverBaseUrl | quote }} 9 | COMMON_CLIENT_ID: {{ .Values.env.commonClientId | quote }} 10 | COMMON_ISSUER: {{ .Values.env.commonIssuer | quote }} 11 | API_VERSION: {{ .Values.env.apiVersion | quote }} 12 | KMS_ENV: {{ .Values.env.kmsEnv | quote }} 13 | {{- if eq .Values.env.kmsEnv "AWS" }} 14 | AWS_ROLE_ARN: {{ .Values.env.aws.roleArn | quote }} 15 | AWS_ACCOUNT_ID: {{ .Values.env.aws.accountId | quote }} 16 | AWS_IDENTITY_POOL_ID: {{ .Values.env.aws.identityPoolId | quote }} 17 | AWS_LOGIN_ID: {{ .Values.env.aws.loginId | quote }} 18 | {{- end }} 19 | {{- if eq .Values.env.kmsEnv "K8S" }} 20 | VAULT_URL: {{ .Values.env.k8s.vaultUrl | quote }} 21 | VAULT_AUTH_JWT_ROLE: {{ .Values.env.k8s.vaultAuthJwtRole | quote }} 22 | {{- end }} -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ include "he4cloud-ui.fullname" . }} 5 | labels: 6 | {{- include "he4cloud-ui.labels" . | nindent 4 }} 7 | spec: 8 | {{- if not .Values.autoscaling.enabled }} 9 | replicas: {{ .Values.replicaCount }} 10 | {{- end }} 11 | selector: 12 | matchLabels: 13 | {{- include "he4cloud-ui.selectorLabels" . | nindent 6 }} 14 | template: 15 | metadata: 16 | {{- with .Values.podAnnotations }} 17 | annotations: 18 | {{- toYaml . | nindent 8 }} 19 | {{- end }} 20 | labels: 21 | {{- include "he4cloud-ui.selectorLabels" . | nindent 8 }} 22 | spec: 23 | {{- with .Values.imagePullSecrets }} 24 | imagePullSecrets: 25 | {{- toYaml . | nindent 8 }} 26 | {{- end }} 27 | serviceAccountName: {{ include "he4cloud-ui.serviceAccountName" . }} 28 | securityContext: 29 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 30 | containers: 31 | - name: {{ .Chart.Name }} 32 | securityContext: 33 | {{- toYaml .Values.securityContext | nindent 12 }} 34 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" 35 | imagePullPolicy: {{ .Values.image.pullPolicy }} 36 | ports: 37 | {{- toYaml .Values.spec.ports | nindent 12 }} 38 | # livenessProbe: 39 | # httpGet: 40 | # path: / 41 | # port: http 42 | # readinessProbe: 43 | # httpGet: 44 | # path: / 45 | # port: http 46 | resources: 47 | limits: 48 | memory: 8000Mi 49 | volumeMounts: 50 | - mountPath: /dev/shm 51 | name: cache-volume 52 | envFrom: 53 | - configMapRef: 54 | name: he4cloud-ui-config 55 | - secretRef: 56 | name: he4cloud-ui-secret 57 | volumes: 58 | - emptyDir: 59 | medium: Memory 60 | sizeLimit: 4000Mi 61 | name: cache-volume 62 | {{- with .Values.nodeSelector }} 63 | nodeSelector: 64 | {{- toYaml . | nindent 8 }} 65 | {{- end }} 66 | {{- with .Values.affinity }} 67 | affinity: 68 | {{- toYaml . | nindent 8 }} 69 | {{- end }} 70 | {{- with .Values.tolerations }} 71 | tolerations: 72 | {{- toYaml . | nindent 8 }} 73 | {{- end }} 74 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/templates/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.autoscaling.enabled }} 2 | apiVersion: autoscaling/v2beta1 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ include "he4cloud-ui.fullname" . }} 6 | labels: 7 | {{- include "he4cloud-ui.labels" . | nindent 4 }} 8 | spec: 9 | scaleTargetRef: 10 | apiVersion: apps/v1 11 | kind: Deployment 12 | name: {{ include "he4cloud-ui.fullname" . }} 13 | minReplicas: {{ .Values.autoscaling.minReplicas }} 14 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 15 | metrics: 16 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} 17 | - type: Resource 18 | resource: 19 | name: cpu 20 | targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} 21 | {{- end }} 22 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} 23 | - type: Resource 24 | resource: 25 | name: memory 26 | targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} 27 | {{- end }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.ingress.enabled -}} 2 | {{- $fullName := include "he4cloud-ui.fullname" . -}} 3 | {{- $svcPort := .Values.service.port -}} 4 | {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} 5 | apiVersion: networking.k8s.io/v1beta1 6 | {{- else -}} 7 | apiVersion: extensions/v1beta1 8 | {{- end }} 9 | kind: Ingress 10 | metadata: 11 | name: {{ $fullName }} 12 | labels: 13 | {{- include "he4cloud-ui.labels" . | nindent 4 }} 14 | {{- with .Values.ingress.annotations }} 15 | annotations: 16 | {{- toYaml . | nindent 4 }} 17 | {{- end }} 18 | spec: 19 | {{- if .Values.ingress.tls }} 20 | tls: 21 | {{- range .Values.ingress.tls }} 22 | - hosts: 23 | {{- range .hosts }} 24 | - {{ . | quote }} 25 | {{- end }} 26 | secretName: {{ .secretName }} 27 | {{- end }} 28 | {{- end }} 29 | rules: 30 | {{- range .Values.ingress.hosts }} 31 | - host: {{ .host | quote }} 32 | http: 33 | paths: 34 | {{- range .paths }} 35 | - path: {{ . }} 36 | backend: 37 | serviceName: {{ $fullName }} 38 | servicePort: {{ $svcPort }} 39 | {{- end }} 40 | {{- end }} 41 | {{- end }} 42 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: he4cloud-ui-secret 5 | type: Opaque 6 | data: 7 | COMMON_CLIENT_SECRET: {{ .Values.env.commonClientSecret | b64enc }} -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "he4cloud-ui.fullname" . }} 5 | labels: 6 | {{- include "he4cloud-ui.labels" . | nindent 4 }} 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | {{- toYaml .Values.service.ports | nindent 4 }} 11 | selector: 12 | {{- include "he4cloud-ui.selectorLabels" . | nindent 4 }} 13 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "he4cloud-ui.serviceAccountName" . }} 6 | labels: 7 | {{- include "he4cloud-ui.labels" . | nindent 4 }} 8 | {{- with .Values.serviceAccount.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/templates/tests/test-connection.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: "{{ include "he4cloud-ui.fullname" . }}-test-connection" 5 | labels: 6 | {{- include "he4cloud-ui.labels" . | nindent 4 }} 7 | annotations: 8 | "helm.sh/hook": test-success 9 | spec: 10 | containers: 11 | - name: wget 12 | image: busybox 13 | command: ['wget'] 14 | args: ['{{ include "he4cloud-ui.fullname" . }}:{{ .Values.service.port }}'] 15 | restartPolicy: Never 16 | -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/helm/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for he4cloud-ui. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 1 6 | 7 | image: 8 | repository: icr.io/he4cloud/he4cloud-ui 9 | pullPolicy: Always 10 | # Overrides the image tag whose default is the chart appVersion. 11 | tag: "latest" 12 | 13 | imagePullSecrets: 14 | - name: artregcred 15 | nameOverride: "" 16 | fullnameOverride: "" 17 | 18 | serviceAccount: 19 | # Specifies whether a service account should be created 20 | create: true 21 | # Annotations to add to the service account 22 | annotations: {} 23 | # The name of the service account to use. 24 | # If not set and create is true, a name is generated using the fullname template 25 | name: "" 26 | 27 | podAnnotations: {} 28 | 29 | podSecurityContext: {} 30 | # fsGroup: 2000 31 | 32 | securityContext: {} 33 | # capabilities: 34 | # drop: 35 | # - ALL 36 | # readOnlyRootFilesystem: true 37 | # runAsNonRoot: true 38 | # runAsUser: 1000 39 | 40 | service: 41 | type: ClusterIP 42 | ports: 43 | - port: 3000 44 | targetPort: 3000 45 | 46 | ingress: 47 | enabled: false 48 | annotations: {} 49 | # kubernetes.io/ingress.class: nginx 50 | # kubernetes.io/tls-acme: "true" 51 | hosts: 52 | - host: chart-example.local 53 | paths: [] 54 | tls: [] 55 | # - secretName: chart-example-tls 56 | # hosts: 57 | # - chart-example.local 58 | 59 | resources: {} 60 | # We usually recommend not to specify default resources and to leave this as a conscious 61 | # choice for the user. This also increases chances charts run on environments with little 62 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 63 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 64 | # limits: 65 | # cpu: 100m 66 | # memory: 128Mi 67 | # requests: 68 | # cpu: 100m 69 | # memory: 128Mi 70 | 71 | autoscaling: 72 | enabled: false 73 | minReplicas: 1 74 | maxReplicas: 100 75 | targetCPUUtilizationPercentage: 80 76 | # targetMemoryUtilizationPercentage: 80 77 | 78 | nodeSelector: {} 79 | 80 | tolerations: [] 81 | 82 | affinity: {} 83 | 84 | deployment: 85 | # select one of the possible values: IBM, K8S, CASH, AWS. 86 | # IBM when deploying to IBM Cloud. 87 | # K8S for on-prem deployment. 88 | # CASH for deployment to the Cash environment 89 | # AWS for deployment to the AWS environment 90 | env: "" 91 | 92 | env: 93 | he4cEnv: "" 94 | clusterUrl: "" 95 | serverBaseUrl: "" 96 | commonClientId: "" 97 | commonClientSecret: "" 98 | commonBaseAuthorizationUrl: "" 99 | commonIssuer: "" 100 | apiVersion: "" 101 | kmsEnv: "" 102 | aws: 103 | # For AWS only: 104 | roleArn: "" 105 | accountId: "" 106 | identityPoolId: "" 107 | loginId: "" 108 | k8s: 109 | # For K8S only: 110 | vaultUrl: "" 111 | vaultAuthJwtRole: "" 112 | 113 | spec: 114 | ports: 115 | - name: http 116 | containerPort: 3000 117 | protocol: TCP -------------------------------------------------------------------------------- /HE4Cloud/AWS/ui/ui.helm.env: -------------------------------------------------------------------------------- 1 | #? K8s configuration 2 | #* Replace with the Docker repository name containing the image 3 | export REMOTE_IMAGE_REPO= 4 | #* Replace with the name of the image 5 | export REMOTE_IMAGE_NAME= 6 | #* Replace with the tag of the image 7 | export REMOTE_IMAGE_TAG= 8 | #* Replace with the K8s secret to connect to the Docker repository containing the image 9 | export K8S_IMAGE_PULL_SECRETS= 10 | 11 | #? General configuration 12 | #* Replace with the url of the ingress host 13 | export SERVER_PUBLIC_ENDPOINT= 14 | #* Replace with the url of the ingress host 15 | export CLUSTER_URL= 16 | 17 | #? Authentication configuration 18 | #* Replace with client id of the app client generated during setup 19 | export AWS_COGNITO_CLIENT_ID= 20 | #* Replace with client secret of the app client generated during setup 21 | export AWS_COGNITO_CLIENT_SECRET= 22 | #* Replace with region where the user pool was created during setup, e.g. us-east-1 23 | #* Replace with user pool id generated during setup 24 | export AWS_COGNITO_AUTH_ISSUER=https://cognito-idp..amazonaws.com/ 25 | 26 | #? STS configuration 27 | #* Replace with AWS Account ID 28 | export AWS_ACCOUNT_ID= 29 | #* Replace with the identity pool id generated dueing setup 30 | export AWS_COGNITO_IDENTITY_POOL_ID= 31 | #* Replace with region where the user pool was created during setup, e.g. us-east-1 32 | #* Replace with user pool id generated during setup 33 | export AWS_COGNITO_IDENTITY_PROVIDER_NAME=cognito-idp..amazonaws.com/ 34 | #* Replace with IAM role arn generated during setup 35 | export AWS_COGNITO_USER_ROLE_ARN= -------------------------------------------------------------------------------- /HE4Cloud/Datasets/Demo/Readme.md: -------------------------------------------------------------------------------- 1 | ### HE4Cloud Demo Dataset 2 | 3 | A dataset is build from two files: CSV file, and Json file. 4 | 5 | The CSV file contains the data. Only numerical data is supported. The demo example contains the following columns: height, weight, and salary. 6 | The json file describes metadata of each column with number of bins requierd when calculating the histogram. 7 | 8 | For example: 9 | 10 | ```json 11 | 12 | { 13 | "columns": { 14 | "salary": { 15 | "bins": 5 16 | }, 17 | "height": { 18 | "bins": 4 19 | }, 20 | "weight": { 21 | "bins": 5 22 | } 23 | } 24 | } 25 | 26 | ``` 27 | 28 | The requested number of histogram bins for salary column is 5. 29 | 30 | **NOTE: at this time Chrome browser doesn't support uploading datasets.** 31 | -------------------------------------------------------------------------------- /HE4Cloud/Datasets/Demo/demo_data_set.csv: -------------------------------------------------------------------------------- 1 | salary,height,weight 2 | 9000,175,65 3 | 20000,170,75 4 | 15000,183,75 5 | 11200,183,80 6 | 35000,165,88 7 | 30000,190,70 8 | 40000,182,73 9 | 41000,181,73 10 | 18000,172,90 11 | 23350,177,100 -------------------------------------------------------------------------------- /HE4Cloud/Datasets/Demo/demo_data_set.json: -------------------------------------------------------------------------------- 1 | { 2 | "columns": { 3 | "salary": { 4 | "bins": 5 5 | }, 6 | "height": { 7 | "bins": 4 8 | }, 9 | "weight": { 10 | "bins": 5 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/.ipynb_checkpoints/adult-checkpoint.data: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5b00264637dbfec36bdeaab5676b0b309ff9eb788d63554ca0a249491c86603d 3 | size 3974305 4 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/.ipynb_checkpoints/adult-checkpoint.names: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c248284c0b5de30c9e1958d6cdd168a34a654758b620e68f46aefa83fc0a576a 3 | size 5229 4 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/README.md: -------------------------------------------------------------------------------- 1 | # The UCI-ADULT dataset 2 | 3 | ## References: 4 | 5 | 1. Kohavi, R., Becker, B.: Uci machine learning repository - adult dataset (1996), https://archive.ics.uci.edu/ml/datasets/adult18 6 | 7 | 2. Dua, D. and Graff, C. (2019). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science. -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/adult.names: -------------------------------------------------------------------------------- 1 | | This data was extracted from the census bureau database found at 2 | | http://www.census.gov/ftp/pub/DES/www/welcome.html 3 | | Donor: Ronny Kohavi and Barry Becker, 4 | | Data Mining and Visualization 5 | | Silicon Graphics. 6 | | e-mail: ronnyk@sgi.com for questions. 7 | | Split into train-test using MLC++ GenCVFiles (2/3, 1/3 random). 8 | | 48842 instances, mix of continuous and discrete (train=32561, test=16281) 9 | | 45222 if instances with unknown values are removed (train=30162, test=15060) 10 | | Duplicate or conflicting instances : 6 11 | | Class probabilities for adult.all file 12 | | Probability for the label '>50K' : 23.93% / 24.78% (without unknowns) 13 | | Probability for the label '<=50K' : 76.07% / 75.22% (without unknowns) 14 | | 15 | | Extraction was done by Barry Becker from the 1994 Census database. A set of 16 | | reasonably clean records was extracted using the following conditions: 17 | | ((AAGE>16) && (AGI>100) && (AFNLWGT>1)&& (HRSWK>0)) 18 | | 19 | | Prediction task is to determine whether a person makes over 50K 20 | | a year. 21 | | 22 | | First cited in: 23 | | @inproceedings{kohavi-nbtree, 24 | | author={Ron Kohavi}, 25 | | title={Scaling Up the Accuracy of Naive-Bayes Classifiers: a 26 | | Decision-Tree Hybrid}, 27 | | booktitle={Proceedings of the Second International Conference on 28 | | Knowledge Discovery and Data Mining}, 29 | | year = 1996, 30 | | pages={to appear}} 31 | | 32 | | Error Accuracy reported as follows, after removal of unknowns from 33 | | train/test sets): 34 | | C4.5 : 84.46+-0.30 35 | | Naive-Bayes: 83.88+-0.30 36 | | NBTree : 85.90+-0.28 37 | | 38 | | 39 | | Following algorithms were later run with the following error rates, 40 | | all after removal of unknowns and using the original train/test split. 41 | | All these numbers are straight runs using MLC++ with default values. 42 | | 43 | | Algorithm Error 44 | | -- ---------------- ----- 45 | | 1 C4.5 15.54 46 | | 2 C4.5-auto 14.46 47 | | 3 C4.5 rules 14.94 48 | | 4 Voted ID3 (0.6) 15.64 49 | | 5 Voted ID3 (0.8) 16.47 50 | | 6 T2 16.84 51 | | 7 1R 19.54 52 | | 8 NBTree 14.10 53 | | 9 CN2 16.00 54 | | 10 HOODG 14.82 55 | | 11 FSS Naive Bayes 14.05 56 | | 12 IDTM (Decision table) 14.46 57 | | 13 Naive-Bayes 16.12 58 | | 14 Nearest-neighbor (1) 21.42 59 | | 15 Nearest-neighbor (3) 20.35 60 | | 16 OC1 15.04 61 | | 17 Pebls Crashed. Unknown why (bounds WERE increased) 62 | | 63 | | Conversion of original data as follows: 64 | | 1. Discretized agrossincome into two ranges with threshold 50,000. 65 | | 2. Convert U.S. to US to avoid periods. 66 | | 3. Convert Unknown to "?" 67 | | 4. Run MLC++ GenCVFiles to generate data,test. 68 | | 69 | | Description of fnlwgt (final weight) 70 | | 71 | | The weights on the CPS files are controlled to independent estimates of the 72 | | civilian noninstitutional population of the US. These are prepared monthly 73 | | for us by Population Division here at the Census Bureau. We use 3 sets of 74 | | controls. 75 | | These are: 76 | | 1. A single cell estimate of the population 16+ for each state. 77 | | 2. Controls for Hispanic Origin by age and sex. 78 | | 3. Controls by Race, age and sex. 79 | | 80 | | We use all three sets of controls in our weighting program and "rake" through 81 | | them 6 times so that by the end we come back to all the controls we used. 82 | | 83 | | The term estimate refers to population totals derived from CPS by creating 84 | | "weighted tallies" of any specified socio-economic characteristics of the 85 | | population. 86 | | 87 | | People with similar demographic characteristics should have 88 | | similar weights. There is one important caveat to remember 89 | | about this statement. That is that since the CPS sample is 90 | | actually a collection of 51 state samples, each with its own 91 | | probability of selection, the statement only applies within 92 | | state. 93 | 94 | 95 | >50K, <=50K. 96 | 97 | age: continuous. 98 | workclass: Private, Self-emp-not-inc, Self-emp-inc, Federal-gov, Local-gov, State-gov, Without-pay, Never-worked. 99 | fnlwgt: continuous. 100 | education: Bachelors, Some-college, 11th, HS-grad, Prof-school, Assoc-acdm, Assoc-voc, 9th, 7th-8th, 12th, Masters, 1st-4th, 10th, Doctorate, 5th-6th, Preschool. 101 | education-num: continuous. 102 | marital-status: Married-civ-spouse, Divorced, Never-married, Separated, Widowed, Married-spouse-absent, Married-AF-spouse. 103 | occupation: Tech-support, Craft-repair, Other-service, Sales, Exec-managerial, Prof-specialty, Handlers-cleaners, Machine-op-inspct, Adm-clerical, Farming-fishing, Transport-moving, Priv-house-serv, Protective-serv, Armed-Forces. 104 | relationship: Wife, Own-child, Husband, Not-in-family, Other-relative, Unmarried. 105 | race: White, Asian-Pac-Islander, Amer-Indian-Eskimo, Other, Black. 106 | sex: Female, Male. 107 | capital-gain: continuous. 108 | capital-loss: continuous. 109 | hours-per-week: continuous. 110 | native-country: United-States, Cambodia, England, Puerto-Rico, Canada, Germany, Outlying-US(Guam-USVI-etc), India, Japan, Greece, South, China, Cuba, Iran, Honduras, Philippines, Italy, Poland, Jamaica, Vietnam, Mexico, Portugal, Ireland, France, Dominican-Republic, Laos, Ecuador, Taiwan, Haiti, Columbia, Hungary, Guatemala, Nicaragua, Scotland, Thailand, Yugoslavia, El-Salvador, Trinadad&Tobago, Peru, Hong, Holand-Netherlands. 111 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/x_test.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/x_test.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/x_train.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/x_train.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/x_val.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/x_val.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/y_test.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/y_test.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/y_train.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/y_train.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/y_val.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/datasets/y_val.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/generate_samples.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np\n", 11 | "from sklearn.model_selection import train_test_split\n", 12 | "import h5py\n", 13 | "import os\n", 14 | "from preprocessor import Preprocessor" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": null, 20 | "metadata": {}, 21 | "outputs": [], 22 | "source": [ 23 | "def save_data_set(x, y, data_type, path, s=''):\n", 24 | " if not os.path.exists(path):\n", 25 | " os.makedirs(path)\n", 26 | " fname=os.path.join(path, f'x_{data_type}{s}.h5')\n", 27 | " # print(\"Saving x_{} of shape {} in {}\".format(data_type, x.shape, fname))\n", 28 | " xf = h5py.File(fname, 'w')\n", 29 | " xf.create_dataset('x_{}'.format(data_type), data=x)\n", 30 | " xf.close()\n", 31 | "\n", 32 | " # print(\"Saving y_{} of shape {} in {}\".format(data_type, y.shape, fname))\n", 33 | " yf = h5py.File(os.path.join(path, f'y_{data_type}{s}.h5'), 'w')\n", 34 | " yf.create_dataset(f'y_{data_type}', data=y)\n", 35 | " yf.close()\n", 36 | "\n", 37 | "column_names = ['age', 'workclass', 'fnlwgt', 'education', 'education-num',\n", 38 | " 'marital-status', 'occupation', 'relationship', 'race', 'sex',\n", 39 | " 'capital-gain', 'capital-loss', 'hours-per-week', 'native-country', 'label']\n", 40 | "\n", 41 | "df = pd.read_csv(\"./datasets/adult.data\", names=column_names, header=None, index_col=False, engine='python')\n", 42 | "\n", 43 | "df.head()\n", 44 | "\n", 45 | "X = df.drop(['label'], axis=1)\n", 46 | "y = df['label'].str.strip().map({'<=50K': 0, '>50K': 1}).astype('int')\n", 47 | "X.head()\n", 48 | "\n", 49 | "# Returned values type: \n", 50 | "# x_train - pandas.core.frame.DataFrame \n", 51 | "# y_train - pandas.core.series.Series \n", 52 | "# x_test - pandas.core.frame.DataFrame\n", 53 | "# y_test - pandas.core.series.Series\n", 54 | "x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=5, stratify=y)\n", 55 | "\n", 56 | "prep = Preprocessor()\n", 57 | "# Returned value type: Numpy NDArray\n", 58 | "x_train = prep.fit_transform(x_train)\n", 59 | "# Returned value type: Numpy NDArray\n", 60 | "x_test = prep.transform(x_test)\n", 61 | "\n", 62 | "# Returned values type: \n", 63 | "# x_test - numpy.ndarray \n", 64 | "# y_test - pandas.core.series.Series \n", 65 | "# x_val - numpy.ndarray\n", 66 | "# y_val - pandas.core.series.Series\n", 67 | "x_test, x_val, y_test, y_val = train_test_split(x_test, y_test, test_size=4096, random_state=5, stratify=y_test)\n", 68 | "\n", 69 | "test_idx = y_test[0:15].index\n", 70 | "path = \"samples//\"\n", 71 | "if not os.path.exists(path):\n", 72 | " os.makedirs(path)\n", 73 | "\n", 74 | "for i in range(test_idx.size):\n", 75 | " out = f\"Sample_Index: {test_idx[i]}\\n\"\n", 76 | " for col in df.columns:\n", 77 | " out = out + col + \" : \" + str(df.loc[test_idx[i]][col]) + \"\\n\"\n", 78 | " fname = os.path.join(path, \"sample\" + str(i) + \".raw\")\n", 79 | " # print(\"Saving raw data to: \" + fname)\n", 80 | " with open(fname, 'w') as f:\n", 81 | " f.write(out)\n", 82 | " save_data_set(np.reshape(x_test[i], [1, x_test[i].shape[0]]), y_test.to_numpy()[i], data_type='sample'+str(i), path=path)\n" 83 | ] 84 | } 85 | ], 86 | "metadata": { 87 | "kernelspec": { 88 | "display_name": "Python 3.8.10 ('fhe-py38-env')", 89 | "language": "python", 90 | "name": "python3" 91 | }, 92 | "language_info": { 93 | "codemirror_mode": { 94 | "name": "ipython", 95 | "version": 3 96 | }, 97 | "file_extension": ".py", 98 | "mimetype": "text/x-python", 99 | "name": "python", 100 | "nbconvert_exporter": "python", 101 | "pygments_lexer": "ipython3", 102 | "version": "3.8.10" 103 | }, 104 | "orig_nbformat": 4, 105 | "vscode": { 106 | "interpreter": { 107 | "hash": "f497b8fb6983b2b7e8d6051f4315e544585546557ee2f98a631c292ad437c819" 108 | } 109 | } 110 | }, 111 | "nbformat": 4, 112 | "nbformat_minor": 2 113 | } 114 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/model/DT_hyper_params.hyperparams: -------------------------------------------------------------------------------- 1 | { 2 | "featureRanges": [ 3 | [ 4 | 0.0, 5 | 1.0 6 | ], 7 | [ 8 | 0.0, 9 | 1.0 10 | ], 11 | [ 12 | 0.0, 13 | 1.0 14 | ], 15 | [ 16 | 0.0, 17 | 0.9999999999999999 18 | ], 19 | [ 20 | 0.0, 21 | 1.0 22 | ], 23 | [ 24 | 0.0, 25 | 1.0 26 | ] 27 | ], 28 | "gRep": 3, 29 | "fRep": 1 30 | } -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/model/dt_adults_income_model.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": "decision-tree", 3 | "feature_importances_": [ 4 | 0.0016371290099368473, 5 | 0.23839327293322032, 6 | 0.5042012183169549, 7 | 0.0, 8 | 0.0, 9 | 0.25576837973988803 10 | ], 11 | "max_features_": 6, 12 | "n_classes_": 2, 13 | "n_features_": 6, 14 | "n_outputs_": 1, 15 | "tree_": { 16 | "max_depth": 3, 17 | "node_count": 15, 18 | "nodes": [ 19 | [ 20 | 1, 21 | 8, 22 | 2, 23 | 0.5, 24 | 0.3656562566735613, 25 | 26048, 26 | 26048.0 27 | ], 28 | [ 29 | 2, 30 | 5, 31 | 1, 32 | 0.7666666805744171, 33 | 0.4915099201710582, 34 | 12340, 35 | 12340.0 36 | ], 37 | [ 38 | 3, 39 | 4, 40 | 5, 41 | 0.0509555097669363, 42 | 0.43595090488676047, 43 | 8681, 44 | 8681.0 45 | ], 46 | [ 47 | -1, 48 | -1, 49 | -2, 50 | -2.0, 51 | 0.4097132245601487, 52 | 8260, 53 | 8260.0 54 | ], 55 | [ 56 | -1, 57 | -1, 58 | -2, 59 | -2.0, 60 | 0.041841334679899145, 61 | 421, 62 | 421.0 63 | ], 64 | [ 65 | 6, 66 | 7, 67 | 5, 68 | 0.0509555097669363, 69 | 0.41608328955748686, 70 | 3659, 71 | 3659.0 72 | ], 73 | [ 74 | -1, 75 | -1, 76 | -2, 77 | -2.0, 78 | 0.4518773707145216, 79 | 3117, 80 | 3117.0 81 | ], 82 | [ 83 | -1, 84 | -1, 85 | -2, 86 | -2.0, 87 | 0.018279979847768968, 88 | 542, 89 | 542.0 90 | ], 91 | [ 92 | 9, 93 | 12, 94 | 5, 95 | 0.07139571383595467, 96 | 0.12357567426798077, 97 | 13708, 98 | 13708.0 99 | ], 100 | [ 101 | 10, 102 | 11, 103 | 1, 104 | 0.8333333432674408, 105 | 0.09444495591668656, 106 | 13463, 107 | 13463.0 108 | ], 109 | [ 110 | -1, 111 | -1, 112 | -2, 113 | -2.0, 114 | 0.07110967762069109, 115 | 12731, 116 | 12731.0 117 | ], 118 | [ 119 | -1, 120 | -1, 121 | -2, 122 | -2.0, 123 | 0.39590238585804294, 124 | 732, 125 | 732.0 126 | ], 127 | [ 128 | 13, 129 | 14, 130 | 0, 131 | 0.04794520512223244, 132 | 0.05551020408163265, 133 | 245, 134 | 245.0 135 | ], 136 | [ 137 | -1, 138 | -1, 139 | -2, 140 | -2.0, 141 | 0.0, 142 | 3, 143 | 3.0 144 | ], 145 | [ 146 | -1, 147 | -1, 148 | -2, 149 | -2.0, 150 | 0.03251144047537735, 151 | 242, 152 | 242.0 153 | ] 154 | ], 155 | "values": [ 156 | [ 157 | [ 158 | 19775.0, 159 | 6273.0 160 | ] 161 | ], 162 | [ 163 | [ 164 | 6974.0, 165 | 5366.0 166 | ] 167 | ], 168 | [ 169 | [ 170 | 5894.0, 171 | 2787.0 172 | ] 173 | ], 174 | [ 175 | [ 176 | 5885.0, 177 | 2375.0 178 | ] 179 | ], 180 | [ 181 | [ 182 | 9.0, 183 | 412.0 184 | ] 185 | ], 186 | [ 187 | [ 188 | 1080.0, 189 | 2579.0 190 | ] 191 | ], 192 | [ 193 | [ 194 | 1075.0, 195 | 2042.0 196 | ] 197 | ], 198 | [ 199 | [ 200 | 5.0, 201 | 537.0 202 | ] 203 | ], 204 | [ 205 | [ 206 | 12801.0, 207 | 907.0 208 | ] 209 | ], 210 | [ 211 | [ 212 | 12794.0, 213 | 669.0 214 | ] 215 | ], 216 | [ 217 | [ 218 | 12261.0, 219 | 470.0 220 | ] 221 | ], 222 | [ 223 | [ 224 | 533.0, 225 | 199.0 226 | ] 227 | ], 228 | [ 229 | [ 230 | 7.0, 231 | 238.0 232 | ] 233 | ], 234 | [ 235 | [ 236 | 3.0, 237 | 0.0 238 | ] 239 | ], 240 | [ 241 | [ 242 | 4.0, 243 | 238.0 244 | ] 245 | ] 246 | ], 247 | "nodes_dtype": [ 248 | " None: 14 | if feature_scaler is None: 15 | self.feature_scaler = MinMaxScaler() 16 | else: 17 | self.feature_scaler = feature_scaler 18 | if columns is None: 19 | self.columns = [] 20 | else: 21 | self.columns = columns 22 | 23 | def fit_transform(self, df): 24 | return self._prep(df,is_train=True) 25 | 26 | def transform(self, df): 27 | return self._prep(df,is_train=False) 28 | 29 | def encode(self, dict): 30 | return self.transform(pd.DataFrame([dict])) 31 | 32 | def save(self, path): 33 | with open(os.path.join(path), "wb") as f: 34 | pickle.dump(self, f) 35 | 36 | def _prep(self, df, is_train): 37 | df = df.copy() 38 | 39 | df['marital-status'] = df['marital-status'].str.strip() 40 | df['marital-status'] = df['marital-status'].replace(['Married-civ-spouse','Married-spouse-absent','Married-AF-spouse'], 'Married') 41 | df['marital-status'] = df['marital-status'].replace(['Never-married','Divorced','Separated','Widowed'], 'Single') 42 | df['marital-status'] = df['marital-status'].map({'Married':0, 'Single':1}) 43 | df['marital-status'] = df['marital-status'].astype('int') 44 | df = df[['age', 'education-num', 'marital-status', 'hours-per-week', 'capital-loss', 'capital-gain']] 45 | 46 | if is_train: 47 | self.columns = df.columns 48 | final = self.feature_scaler.fit_transform(df) 49 | else: 50 | final = df.reindex(columns= self.columns, fill_value=0) 51 | final = self.feature_scaler.transform(final) 52 | return final -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample0.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 29028 2 | age : 48 3 | workclass : Private 4 | fnlwgt : 182313 5 | education : Some-college 6 | education-num : 10 7 | marital-status : Married-civ-spouse 8 | occupation : Handlers-cleaners 9 | relationship : Husband 10 | race : White 11 | sex : Male 12 | capital-gain : 0 13 | capital-loss : 0 14 | hours-per-week : 40 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample1.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 30643 2 | age : 34 3 | workclass : Private 4 | fnlwgt : 265807 5 | education : HS-grad 6 | education-num : 9 7 | marital-status : Married-civ-spouse 8 | occupation : Transport-moving 9 | relationship : Husband 10 | race : White 11 | sex : Male 12 | capital-gain : 0 13 | capital-loss : 2051 14 | hours-per-week : 55 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample10.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 25758 2 | age : 58 3 | workclass : Private 4 | fnlwgt : 225394 5 | education : HS-grad 6 | education-num : 9 7 | marital-status : Married-civ-spouse 8 | occupation : Craft-repair 9 | relationship : Husband 10 | race : White 11 | sex : Male 12 | capital-gain : 0 13 | capital-loss : 1902 14 | hours-per-week : 40 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample11.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 10343 2 | age : 39 3 | workclass : Self-emp-not-inc 4 | fnlwgt : 331481 5 | education : Bachelors 6 | education-num : 13 7 | marital-status : Divorced 8 | occupation : Craft-repair 9 | relationship : Not-in-family 10 | race : Black 11 | sex : Male 12 | capital-gain : 0 13 | capital-loss : 1669 14 | hours-per-week : 60 15 | native-country : ? 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample12.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 27580 2 | age : 26 3 | workclass : Private 4 | fnlwgt : 89326 5 | education : Bachelors 6 | education-num : 13 7 | marital-status : Never-married 8 | occupation : Sales 9 | relationship : Not-in-family 10 | race : White 11 | sex : Male 12 | capital-gain : 0 13 | capital-loss : 0 14 | hours-per-week : 40 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample13.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 969 2 | age : 36 3 | workclass : ? 4 | fnlwgt : 94954 5 | education : Assoc-voc 6 | education-num : 11 7 | marital-status : Widowed 8 | occupation : ? 9 | relationship : Not-in-family 10 | race : White 11 | sex : Female 12 | capital-gain : 0 13 | capital-loss : 0 14 | hours-per-week : 20 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample14.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 28303 2 | age : 18 3 | workclass : ? 4 | fnlwgt : 171964 5 | education : HS-grad 6 | education-num : 9 7 | marital-status : Never-married 8 | occupation : ? 9 | relationship : Own-child 10 | race : White 11 | sex : Female 12 | capital-gain : 0 13 | capital-loss : 1602 14 | hours-per-week : 20 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample2.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 9259 2 | age : 60 3 | workclass : Private 4 | fnlwgt : 88055 5 | education : 10th 6 | education-num : 6 7 | marital-status : Married-civ-spouse 8 | occupation : Transport-moving 9 | relationship : Husband 10 | race : White 11 | sex : Male 12 | capital-gain : 0 13 | capital-loss : 0 14 | hours-per-week : 40 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample3.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 15674 2 | age : 37 3 | workclass : ? 4 | fnlwgt : 102541 5 | education : Assoc-voc 6 | education-num : 11 7 | marital-status : Married-civ-spouse 8 | occupation : ? 9 | relationship : Wife 10 | race : Amer-Indian-Eskimo 11 | sex : Female 12 | capital-gain : 0 13 | capital-loss : 0 14 | hours-per-week : 40 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample4.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 19010 2 | age : 20 3 | workclass : Federal-gov 4 | fnlwgt : 178517 5 | education : Some-college 6 | education-num : 10 7 | marital-status : Never-married 8 | occupation : Tech-support 9 | relationship : Not-in-family 10 | race : White 11 | sex : Male 12 | capital-gain : 0 13 | capital-loss : 0 14 | hours-per-week : 40 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample5.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 28629 2 | age : 61 3 | workclass : ? 4 | fnlwgt : 71467 5 | education : HS-grad 6 | education-num : 9 7 | marital-status : Married-civ-spouse 8 | occupation : ? 9 | relationship : Husband 10 | race : White 11 | sex : Male 12 | capital-gain : 3103 13 | capital-loss : 0 14 | hours-per-week : 40 15 | native-country : United-States 16 | label : >50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample6.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 6294 2 | age : 30 3 | workclass : Private 4 | fnlwgt : 177596 5 | education : Some-college 6 | education-num : 10 7 | marital-status : Never-married 8 | occupation : Other-service 9 | relationship : Unmarried 10 | race : White 11 | sex : Female 12 | capital-gain : 0 13 | capital-loss : 0 14 | hours-per-week : 36 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample7.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 28064 2 | age : 47 3 | workclass : Local-gov 4 | fnlwgt : 102628 5 | education : Some-college 6 | education-num : 10 7 | marital-status : Married-civ-spouse 8 | occupation : Other-service 9 | relationship : Husband 10 | race : White 11 | sex : Male 12 | capital-gain : 0 13 | capital-loss : 0 14 | hours-per-week : 40 15 | native-country : United-States 16 | label : >50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample8.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 16941 2 | age : 37 3 | workclass : Private 4 | fnlwgt : 334291 5 | education : Bachelors 6 | education-num : 13 7 | marital-status : Never-married 8 | occupation : Exec-managerial 9 | relationship : Not-in-family 10 | race : White 11 | sex : Male 12 | capital-gain : 0 13 | capital-loss : 0 14 | hours-per-week : 50 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/sample9.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 14588 2 | age : 26 3 | workclass : State-gov 4 | fnlwgt : 180886 5 | education : Masters 6 | education-num : 14 7 | marital-status : Married-civ-spouse 8 | occupation : Prof-specialty 9 | relationship : Husband 10 | race : White 11 | sex : Male 12 | capital-gain : 0 13 | capital-loss : 0 14 | hours-per-week : 30 15 | native-country : United-States 16 | label : <=50K 17 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample0.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample1.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample10.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample10.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample11.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample11.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample12.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample12.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample13.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample13.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample14.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample14.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample2.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample3.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample4.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample4.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample5.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample6.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample6.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample7.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample7.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample8.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample8.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample9.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/x_sample9.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample0.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample1.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample10.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample10.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample11.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample11.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample12.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample12.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample13.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample13.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample14.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample14.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample2.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample3.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample4.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample4.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample5.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample6.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample6.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample7.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample7.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample8.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample8.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample9.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/DT_Adults_Income_Application/samples/y_sample9.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/FHE_Cloud_Service/lr_fraud/model.json: -------------------------------------------------------------------------------- 1 | {"meta": "lr", "classes_": [0, 1], "coef_": [[-0.09491860023176131, -0.26056476271812695, 0.1101857859577806, 0.42700979273039497, -0.2692580414275409, 0.14230678724871115, 0.3965467079761812, -0.2492802278240239, -0.3439418524014365, -0.6166410006596188, 0.061194345879349125, -0.18514215285927102, -0.2573840100186766, -0.6962251109836927, -0.0980131995728874, -0.4268603673631246, -0.003308764465566506, 0.2202940618869556, -0.12097834974338005, 1.1269057457766964, 0.5957006560788313, 0.16620441179414067, -0.2873795314371648, -0.054898143569872986, -0.1548254865442756, -0.020444182966429574, -0.17563525694589752, 0.049167838796481074, -0.005622331282512358]], "intercept_": [-7.864207362807085], "n_iter_": [100], "params": {"C": 0.1, "class_weight": null, "dual": false, "fit_intercept": true, "intercept_scaling": 1, "l1_ratio": null, "max_iter": 100, "multi_class": "auto", "n_jobs": null, "penalty": "l2", "random_state": null, "solver": "lbfgs", "tol": 0.0001, "verbose": 0, "warm_start": false}} -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/FHE_Cloud_Service/lr_fraud/model.type: -------------------------------------------------------------------------------- 1 | Logistic Regression -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/FHE_Cloud_Service/lr_fraud/requirements: -------------------------------------------------------------------------------- 1 | {"setContext":"seal"} -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/FHE_Cloud_Service/lr_fraud/x_test.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/FHE_Cloud_Service/lr_fraud/x_test.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/FHE_Cloud_Service/requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.28.1 2 | h5py==3.7.0 3 | requests_toolbelt==0.9.1 4 | importlib_metadata==4.12.0 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/x_test.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/x_test.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/x_train.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/x_train.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/x_val.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/x_val.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/y_test.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/y_test.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/y_train.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/y_train.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/y_val.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/datasets/y_val.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/generate_samples.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np\n", 11 | "from sklearn.model_selection import train_test_split\n", 12 | "import h5py\n", 13 | "import os\n", 14 | "from preprocessor import Preprocessor" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 2, 20 | "metadata": {}, 21 | "outputs": [], 22 | "source": [ 23 | "def save_data_set(x, y, data_type, path, s=''):\n", 24 | " if not os.path.exists(path):\n", 25 | " os.makedirs(path)\n", 26 | " fname=os.path.join(path, f'x_{data_type}{s}.h5')\n", 27 | " # print(\"Saving x_{} of shape {} in {}\".format(data_type, x.shape, fname))\n", 28 | " xf = h5py.File(fname, 'w')\n", 29 | " xf.create_dataset('x_{}'.format(data_type), data=x)\n", 30 | " xf.close()\n", 31 | "\n", 32 | " # print(\"Saving y_{} of shape {} in {}\".format(data_type, y.shape, fname))\n", 33 | " yf = h5py.File(os.path.join(path, f'y_{data_type}{s}.h5'), 'w')\n", 34 | " yf.create_dataset(f'y_{data_type}', data=y)\n", 35 | " yf.close()\n", 36 | "\n", 37 | "cols = {\n", 38 | " 'checking':str, \n", 39 | " 'duration':np.int64, \n", 40 | " 'credit-hist':str, \n", 41 | " 'purpose':str, \n", 42 | " 'credit-amount':np.int64,\n", 43 | " 'savings-account':str, \n", 44 | " 'employment-duration':str, \n", 45 | " 'installment-income-ratio':np.int64,\n", 46 | " 'marital-gender-status':str,\n", 47 | " 'debtors-guarantors':str, \n", 48 | " 'residence-since':str, \n", 49 | " 'property':str, \n", 50 | " 'age':np.int64,\n", 51 | " 'installment-plans':str, \n", 52 | " 'housing':str, \n", 53 | " 'num-existing-credits':np.int64, \n", 54 | " 'job':str,\n", 55 | " 'num-liable':np.int64, \n", 56 | " 'telephone':str, \n", 57 | " 'foreign-worker':str, \n", 58 | " 'is_good':np.int64\n", 59 | " }\n", 60 | "\n", 61 | "df = pd.read_csv('./datasets/loan_approval.generated', sep=\" \", index_col=False, names=cols.keys(), header=None, dtype=cols)\n", 62 | "\n", 63 | "X = df.drop(['is_good'], axis=1)\n", 64 | "y = df['is_good'].replace([1, 2], [1, 0])\n", 65 | "\n", 66 | "# Returned values type: \n", 67 | "# x_train - pandas.core.frame.DataFrame \n", 68 | "# y_train - pandas.core.series.Series \n", 69 | "# x_test - pandas.core.frame.DataFrame\n", 70 | "# y_test - pandas.core.series.Series\n", 71 | "x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=5, stratify=y)\n", 72 | "\n", 73 | "prep = Preprocessor()\n", 74 | "# Returned value type: Numpy NDArray\n", 75 | "x_train = prep.fit_transform(x_train)\n", 76 | "# Returned value type: Numpy NDArray\n", 77 | "x_test = prep.transform(x_test)\n", 78 | "\n", 79 | "# Returned values type: \n", 80 | "# x_test - numpy.ndarray \n", 81 | "# y_test - pandas.core.series.Series \n", 82 | "# x_val - numpy.ndarray\n", 83 | "# y_val - pandas.core.series.Series\n", 84 | "x_test, x_val, y_test, y_val = train_test_split(x_test, y_test, test_size=4096, random_state=5, stratify=y_test)\n", 85 | "\n", 86 | "test_idx = y_test[0:15].index\n", 87 | "path = \"samples//\"\n", 88 | "if not os.path.exists(path):\n", 89 | " os.makedirs(path)\n", 90 | "\n", 91 | "for i in range(test_idx.size):\n", 92 | " out = f\"Sample_Index: {test_idx[i]}\\n\"\n", 93 | " for col in df.columns:\n", 94 | " out = out + col + \" : \" + str(df.loc[test_idx[i]][col]) + \"\\n\"\n", 95 | " fname = os.path.join(path, \"sample\" + str(i) + \".raw\")\n", 96 | " # print(\"Saving raw data to: \" + fname)\n", 97 | " with open(fname, 'w') as f:\n", 98 | " f.write(out)\n", 99 | " save_data_set(np.reshape(x_test[i], [1, x_test[i].shape[0]]), y_test.to_numpy()[i], data_type='sample'+str(i), path=path)\n" 100 | ] 101 | } 102 | ], 103 | "metadata": { 104 | "interpreter": { 105 | "hash": "88da8e93a7ed8632a00f934738de6497ab10b6ac9a993714594378cc411356f5" 106 | }, 107 | "kernelspec": { 108 | "display_name": "Python 3.8.10 ('ramy-env3.8')", 109 | "language": "python", 110 | "name": "python3" 111 | }, 112 | "language_info": { 113 | "codemirror_mode": { 114 | "name": "ipython", 115 | "version": 3 116 | }, 117 | "file_extension": ".py", 118 | "mimetype": "text/x-python", 119 | "name": "python", 120 | "nbconvert_exporter": "python", 121 | "pygments_lexer": "ipython3", 122 | "version": "3.8.10" 123 | }, 124 | "orig_nbformat": 4 125 | }, 126 | "nbformat": 4, 127 | "nbformat_minor": 2 128 | } 129 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/model/loan_approval_model.requirements: -------------------------------------------------------------------------------- 1 | {"rotation_keys":{"num_steps":"8", "step1":"-128", "step2":"-16", "step3":"-4", "step4":"-1" , "step5":"1" , "step6":"4" , "step7":"16" , "step8":"128"}} -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/model/loan_approval_model.type: -------------------------------------------------------------------------------- 1 | Logistic Regression -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/model/lr_loan_approval_model.json: -------------------------------------------------------------------------------- 1 | {"meta": "lr", "classes_": [0, 1], "coef_": [[-1.4393377312802182, -1.6062463322664897, -0.7614505670745055, 0.2118980912271133, -0.29996926365636506, 0.578049048972364, 0.28504789075093284, -1.0470597095980052, -1.496461600011839, -0.6610992455541069, 1.1552134506176015, 0.9842593038030811, -0.5310863587878062, -0.6492218069702683, 0.08802136478210036, -0.35386664220752984, 1.428065352038241, -1.3735112219188284, 0.5142121308851479, 0.3083084448263259, 0.7597665258384174, 0.4317362254531968, 0.0571592636788078, -0.16361299542943478, -1.1558096079071642, 1.1593626439632891, -0.5556995005349905, -0.6467000042304202, -0.25522396533617103, 0.5427066063717171, -0.43426821922755116, 0.7753974912771616, 0.08191712498795728, -0.39230283507719305, -0.1559413050636601, 0.4879438286399806, -0.0397049046323109, -0.17008522839465007, -0.25181557766793894, 0.29777608988960774, 0.10603662502777286, -0.7376764588822656, -0.8161782868516346, 1.5357666545886874, 0.2586461913314168, 0.26977840729631475, -0.11800291233196375, -0.4285097774410298, -0.2146331698104976, -0.35026426001839095, 0.546809338683673, -0.6114234583322322, 0.5618839348501523, 0.03145143233683484, -0.26626806464425384, -0.04064073064034075, 0.046710147718735724, 0.24211055642061238, 0.784026004471682, -0.12724397824833986, -0.47041185711940026, -0.20445826024919853]], "intercept_": [3.910866974647657], "n_iter_": [100], "params": {"C": 0.1, "class_weight": null, "dual": false, "fit_intercept": true, "intercept_scaling": 1, "l1_ratio": null, "max_iter": 100, "multi_class": "auto", "n_jobs": null, "penalty": "l2", "random_state": null, "solver": "lbfgs", "tol": 0.0001, "verbose": 0, "warm_start": false}} -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/model/prep.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/model/prep.pickle -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/preprocessor.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pandas as pd 3 | from sklearn.preprocessing import MinMaxScaler 4 | import pickle 5 | 6 | class Preprocessor(): 7 | 8 | @staticmethod 9 | def load(path): 10 | with open(path, "rb") as f: 11 | return pickle.load(f) 12 | 13 | def __init__(self, feature_scaler=None, columns=None) -> None: 14 | if feature_scaler is None: 15 | self.feature_scaler = MinMaxScaler() 16 | else: 17 | self.feature_scaler = feature_scaler 18 | if columns is None: 19 | self.columns = [] 20 | else: 21 | self.columns = columns 22 | 23 | def fit_transform(self, df): 24 | return self._prep(df,is_train=True) 25 | 26 | def transform(self, df): 27 | return self._prep(df,is_train=False) 28 | 29 | def encode(self, dict): 30 | return self.transform(pd.DataFrame([dict])) 31 | 32 | def save(self, path): 33 | with open(os.path.join(path), "wb") as f: 34 | pickle.dump(self, f) 35 | 36 | def _prep(self, df, is_train): 37 | df = df.copy() 38 | df['telephone'] = df['telephone'].replace(['A191', 'A192'], [0, 1]) 39 | df['foreign-worker'] = df['foreign-worker'].replace(['A201', 'A202'], [1, 0]) 40 | 41 | cat_features_list = ['checking', 'credit-hist', 'purpose', 'savings-account', 'employment-duration', 42 | 'marital-gender-status', 'debtors-guarantors', 'property', 'installment-plans', 'housing', 43 | 'num-existing-credits','job' ] 44 | 45 | for f in cat_features_list: 46 | dummy = pd.get_dummies(df[f], prefix=f.strip()) 47 | df = pd.concat([df, dummy], axis='columns') 48 | 49 | final = df.drop(cat_features_list,axis=1) 50 | # print(f'data shape: {final.shape}') 51 | 52 | if is_train: 53 | self.columns = final.columns 54 | final = self.feature_scaler.fit_transform(final) 55 | else: 56 | final = final.reindex(columns= self.columns, fill_value=0) 57 | final = self.feature_scaler.transform(final) 58 | return final -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample0.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 46729 2 | checking : A12 3 | duration : 9 4 | credit-hist : A30 5 | purpose : A42 6 | credit-amount : 360 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 2 10 | marital-gender-status : A91 11 | debtors-guarantors : A101 12 | residence-since : 3 13 | property : A122 14 | age : 27 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample1.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 37420 2 | checking : A11 3 | duration : 5 4 | credit-hist : A32 5 | purpose : A45 6 | credit-amount : 827 7 | savings-account : A61 8 | employment-duration : A72 9 | installment-income-ratio : 1 10 | marital-gender-status : A92 11 | debtors-guarantors : A101 12 | residence-since : 3 13 | property : A121 14 | age : 36 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample10.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 42668 2 | checking : A13 3 | duration : 11 4 | credit-hist : A30 5 | purpose : A42 6 | credit-amount : 258 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 4 10 | marital-gender-status : A92 11 | debtors-guarantors : A102 12 | residence-since : 4 13 | property : A121 14 | age : 23 15 | installment-plans : A143 16 | housing : A151 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample11.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 86410 2 | checking : A11 3 | duration : 8 4 | credit-hist : A32 5 | purpose : A40 6 | credit-amount : 434 7 | savings-account : A61 8 | employment-duration : A75 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A121 14 | age : 35 15 | installment-plans : A143 16 | housing : A151 17 | num-existing-credits : 1 18 | job : A172 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample12.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 82140 2 | checking : A14 3 | duration : 23 4 | credit-hist : A32 5 | purpose : A42 6 | credit-amount : 1308 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 1 10 | marital-gender-status : A92 11 | debtors-guarantors : A101 12 | residence-since : 1 13 | property : A121 14 | age : 19 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample13.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 57755 2 | checking : A14 3 | duration : 8 4 | credit-hist : A32 5 | purpose : A42 6 | credit-amount : 745 7 | savings-account : A61 8 | employment-duration : A72 9 | installment-income-ratio : 4 10 | marital-gender-status : A92 11 | debtors-guarantors : A101 12 | residence-since : 1 13 | property : A123 14 | age : 45 15 | installment-plans : A143 16 | housing : A151 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample14.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 92769 2 | checking : A11 3 | duration : 51 4 | credit-hist : A32 5 | purpose : A42 6 | credit-amount : 1542 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A124 14 | age : 33 15 | installment-plans : A143 16 | housing : A153 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 2 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 2 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample2.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 23187 2 | checking : A11 3 | duration : 5 4 | credit-hist : A32 5 | purpose : A42 6 | credit-amount : 267 7 | savings-account : A62 8 | employment-duration : A74 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 3 13 | property : A123 14 | age : 21 15 | installment-plans : A143 16 | housing : A151 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample3.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 30969 2 | checking : A11 3 | duration : 69 4 | credit-hist : A32 5 | purpose : A41 6 | credit-amount : 421 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A123 14 | age : 53 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 2 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample4.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 91526 2 | checking : A14 3 | duration : 5 4 | credit-hist : A34 5 | purpose : A43 6 | credit-amount : 252 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 4 10 | marital-gender-status : A92 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A121 14 | age : 31 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample5.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 93571 2 | checking : A13 3 | duration : 14 4 | credit-hist : A34 5 | purpose : A410 6 | credit-amount : 2270 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 1 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A123 14 | age : 19 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A174 19 | num-liable : 1 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample6.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 24456 2 | checking : A11 3 | duration : 12 4 | credit-hist : A32 5 | purpose : A42 6 | credit-amount : 289 7 | savings-account : A61 8 | employment-duration : A71 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A124 14 | age : 23 15 | installment-plans : A143 16 | housing : A153 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 2 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample7.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 22269 2 | checking : A14 3 | duration : 15 4 | credit-hist : A34 5 | purpose : A43 6 | credit-amount : 1942 7 | savings-account : A62 8 | employment-duration : A74 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 1 13 | property : A123 14 | age : 21 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 2 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample8.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 31564 2 | checking : A14 3 | duration : 7 4 | credit-hist : A34 5 | purpose : A46 6 | credit-amount : 631 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 3 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 3 13 | property : A124 14 | age : 55 15 | installment-plans : A141 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A172 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/sample9.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 85849 2 | checking : A14 3 | duration : 21 4 | credit-hist : A34 5 | purpose : A43 6 | credit-amount : 2374 7 | savings-account : A61 8 | employment-duration : A75 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A121 14 | age : 21 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 2 18 | job : A174 19 | num-liable : 1 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample0.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample1.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample10.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample10.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample11.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample11.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample12.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample12.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample13.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample13.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample14.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample14.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample2.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample3.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample4.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample4.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample5.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample6.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample6.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample7.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample7.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample8.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample8.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample9.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/x_sample9.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample0.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample1.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample10.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample10.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample11.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample11.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample12.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample12.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample13.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample13.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample14.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample14.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample2.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample3.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample4.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample4.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample5.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample6.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample6.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample7.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample7.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample8.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample8.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample9.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/LR_Loan_Approval_Application/samples/y_sample9.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/x_test.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/x_test.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/x_train.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/x_train.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/x_val.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/x_val.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/y_test.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/y_test.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/y_train.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/y_train.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/y_val.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/datasets/y_val.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/generate_samples.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 5, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np\n", 11 | "from sklearn.model_selection import train_test_split\n", 12 | "import h5py\n", 13 | "import os\n", 14 | "from preprocessor import Preprocessor" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 6, 20 | "metadata": {}, 21 | "outputs": [ 22 | { 23 | "name": "stdout", 24 | "output_type": "stream", 25 | "text": [ 26 | "data shape: (242, 14)\n", 27 | "Age int64\n", 28 | "Sex int64\n", 29 | "Chest_pain int64\n", 30 | "Resting_blood_pressure int64\n", 31 | "Cholesterol int64\n", 32 | "Fasting_blood_sugar int64\n", 33 | "ECG_results int64\n", 34 | "Maximum_heart_rate int64\n", 35 | "Exercise_induced_angina int64\n", 36 | "ST_depression float64\n", 37 | "ST_slope int64\n", 38 | "Major_vessels int64\n", 39 | "Thalassemia_types int64\n", 40 | "Heart_attack int64\n", 41 | "dtype: object\n", 42 | "data shape: (61, 14)\n", 43 | "Age int64\n", 44 | "Sex int64\n", 45 | "Chest_pain int64\n", 46 | "Resting_blood_pressure int64\n", 47 | "Cholesterol int64\n", 48 | "Fasting_blood_sugar int64\n", 49 | "ECG_results int64\n", 50 | "Maximum_heart_rate int64\n", 51 | "Exercise_induced_angina int64\n", 52 | "ST_depression float64\n", 53 | "ST_slope int64\n", 54 | "Major_vessels int64\n", 55 | "Thalassemia_types int64\n", 56 | "Heart_attack int64\n", 57 | "dtype: object\n" 58 | ] 59 | }, 60 | { 61 | "name": "stderr", 62 | "output_type": "stream", 63 | "text": [ 64 | "/home/ehood/.pyenv/versions/3.8.5/envs/hecloud/lib/python3.8/site-packages/sklearn/utils/validation.py:1688: FutureWarning: Feature names only support names that are all strings. Got feature names with dtypes: ['int', 'str']. An error will be raised in 1.2.\n", 65 | " warnings.warn(\n", 66 | "/home/ehood/.pyenv/versions/3.8.5/envs/hecloud/lib/python3.8/site-packages/sklearn/utils/validation.py:1688: FutureWarning: Feature names only support names that are all strings. Got feature names with dtypes: ['int', 'str']. An error will be raised in 1.2.\n", 67 | " warnings.warn(\n", 68 | "/home/ehood/.pyenv/versions/3.8.5/envs/hecloud/lib/python3.8/site-packages/sklearn/utils/validation.py:1688: FutureWarning: Feature names only support names that are all strings. Got feature names with dtypes: ['int', 'str']. An error will be raised in 1.2.\n", 69 | " warnings.warn(\n" 70 | ] 71 | } 72 | ], 73 | "source": [ 74 | "def save_data_set(x, y, data_type, path, s=''):\n", 75 | " if not os.path.exists(path):\n", 76 | " os.makedirs(path)\n", 77 | " fname=os.path.join(path, f'x_{data_type}{s}.h5')\n", 78 | " # print(\"Saving x_{} of shape {} in {}\".format(data_type, x.shape, fname))\n", 79 | " xf = h5py.File(fname, 'w')\n", 80 | " xf.create_dataset('x_{}'.format(data_type), data=x)\n", 81 | " xf.close()\n", 82 | "\n", 83 | " # print(\"Saving y_{} of shape {} in {}\".format(data_type, y.shape, fname))\n", 84 | " yf = h5py.File(os.path.join(path, f'y_{data_type}{s}.h5'), 'w')\n", 85 | " yf.create_dataset(f'y_{data_type}', data=y)\n", 86 | " yf.close()\n", 87 | "\n", 88 | "df = pd.read_csv(\"datasets/heart_disease.csv\")\n", 89 | "\n", 90 | "X = df\n", 91 | "y = df['target']\n", 92 | "\n", 93 | "# Returned values type: \n", 94 | "# x_train - pandas.core.frame.DataFrame \n", 95 | "# y_train - pandas.core.series.Series \n", 96 | "# x_test - pandas.core.frame.DataFrame\n", 97 | "# y_test - pandas.core.series.Series\n", 98 | "x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=5)\n", 99 | "\n", 100 | "prep = Preprocessor()\n", 101 | "# Returned value type: Numpy NDArray\n", 102 | "x_train = prep.fit_transform(x_train)\n", 103 | "# Returned value type: Numpy NDArray\n", 104 | "x_test = prep.transform(x_test)\n", 105 | "\n", 106 | "# Returned values type: \n", 107 | "# x_test - numpy.ndarray \n", 108 | "# y_test - pandas.core.series.Series \n", 109 | "# x_val - numpy.ndarray\n", 110 | "# y_val - pandas.core.series.Series\n", 111 | "x_test, x_val, y_test, y_val = train_test_split(x_test, y_test, test_size=0.5, random_state=5)\n", 112 | "\n", 113 | "test_idx = y_test[0:15].index\n", 114 | "path = \"samples//\"\n", 115 | "if not os.path.exists(path):\n", 116 | " os.makedirs(path)\n", 117 | "\n", 118 | "for i in range(test_idx.size):\n", 119 | " out = f\"Sample_Index: {test_idx[i]}\\n\"\n", 120 | " for col in df.columns:\n", 121 | " out = out + col + \" : \" + str(df.loc[test_idx[i]][col]) + \"\\n\"\n", 122 | " fname = os.path.join(path, \"sample\" + str(i) + \".raw\")\n", 123 | " # print(\"Saving raw data to: \" + fname)\n", 124 | " with open(fname, 'w') as f:\n", 125 | " f.write(out)\n", 126 | " save_data_set(np.reshape(x_test[i], [1, x_test[i].shape[0]]), y_test.to_numpy()[i], data_type='sample'+str(i), path=path)\n" 127 | ] 128 | } 129 | ], 130 | "metadata": { 131 | "interpreter": { 132 | "hash": "43d982d829920eaf0507229beb1c4743214d55064409a8508c85e917891da2d5" 133 | }, 134 | "kernelspec": { 135 | "display_name": "Python 3.8.5 64-bit ('hecloud')", 136 | "language": "python", 137 | "name": "python3" 138 | }, 139 | "language_info": { 140 | "codemirror_mode": { 141 | "name": "ipython", 142 | "version": 3 143 | }, 144 | "file_extension": ".py", 145 | "mimetype": "text/x-python", 146 | "name": "python", 147 | "nbconvert_exporter": "python", 148 | "pygments_lexer": "ipython3", 149 | "version": "3.8.5" 150 | }, 151 | "orig_nbformat": 4 152 | }, 153 | "nbformat": 4, 154 | "nbformat_minor": 2 155 | } 156 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/model/heart_disease_model.type: -------------------------------------------------------------------------------- 1 | Neural Network -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/model/nn_heart_disease_model.json: -------------------------------------------------------------------------------- 1 | {"class_name": "Sequential", "config": {"name": "sequential", "layers": [{"class_name": "InputLayer", "config": {"batch_input_shape": [null, 27], "dtype": "float32", "sparse": false, "ragged": false, "name": "dense_input"}}, {"class_name": "Dense", "config": {"name": "dense", "trainable": true, "batch_input_shape": [null, 27], "dtype": "float32", "units": 50, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation", "trainable": true, "dtype": "float32", "activation": "square"}}, {"class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "dtype": "float32", "units": 1, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}]}, "keras_version": "2.8.0", "backend": "tensorflow"} -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/model/nn_heart_disease_model_weights.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/model/nn_heart_disease_model_weights.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/model/prep.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/model/prep.pickle -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/preprocessor.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pandas as pd 3 | from sklearn.preprocessing import MinMaxScaler 4 | import pickle 5 | 6 | class Preprocessor(): 7 | 8 | @staticmethod 9 | def load(path): 10 | with open(path, "rb") as f: 11 | return pickle.load(f) 12 | 13 | def __init__(self, feature_scaler=None, columns=None) -> None: 14 | if feature_scaler is None: 15 | self.feature_scaler = MinMaxScaler() 16 | else: 17 | self.feature_scaler = feature_scaler 18 | if columns is None: 19 | self.columns = [] 20 | else: 21 | self.columns = columns 22 | 23 | def fit_transform(self, df): 24 | return self._prep(df,is_train=True) 25 | 26 | def transform(self, df): 27 | return self._prep(df,is_train=False) 28 | 29 | def encode(self, dict): 30 | return self.transform(pd.DataFrame([dict])) 31 | 32 | def save(self, path): 33 | with open(os.path.join(path), "wb") as f: 34 | pickle.dump(self, f) 35 | 36 | def _prep(self, df, is_train): 37 | df.rename(columns={'age': 'Age', 'sex': 'Sex', 'cp': 'Chest_pain', 'trestbps': 'Resting_blood_pressure', 38 | 'chol': 'Cholesterol', 'fbs': 'Fasting_blood_sugar', 39 | 'restecg': 'ECG_results', 'thalach': 'Maximum_heart_rate', 40 | 'exang': 'Exercise_induced_angina', 'oldpeak': 'ST_depression', 'ca': 'Major_vessels', 41 | 'thal': 'Thalassemia_types', 'target': 'Heart_attack', 'slope': 'ST_slope'}, inplace=True) 42 | 43 | print(f'data shape: {df.shape}') 44 | print(df.dtypes) 45 | 46 | dummy1 = pd.get_dummies(df.Chest_pain) 47 | dummy2 = pd.get_dummies(df.Thalassemia_types) 48 | dummy3 = pd.get_dummies(df.ECG_results) 49 | dummy4 = pd.get_dummies(df.ST_slope) 50 | dummy5 = pd.get_dummies(df.Major_vessels) 51 | merge = pd.concat([df, dummy1, dummy2, dummy3, dummy4, dummy5], axis='columns') 52 | 53 | final = merge.drop(['Chest_pain', 'Thalassemia_types', 'ECG_results', 'ST_slope', 'Major_vessels'], axis=1) 54 | 55 | final = final.drop(['Heart_attack'], axis=1) 56 | # print(f'data shape: {final.shape}') 57 | 58 | if is_train: 59 | self.columns = final.columns 60 | final = self.feature_scaler.fit_transform(final) 61 | else: 62 | final = final.reindex(columns= self.columns, fill_value=0) 63 | final = self.feature_scaler.transform(final) 64 | return final -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample0.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 176 2 | age : 60.0 3 | sex : 1.0 4 | cp : 0.0 5 | trestbps : 117.0 6 | chol : 230.0 7 | fbs : 1.0 8 | restecg : 1.0 9 | thalach : 160.0 10 | exang : 1.0 11 | oldpeak : 1.4 12 | slope : 2.0 13 | ca : 2.0 14 | thal : 3.0 15 | target : 0.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample1.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 259 2 | age : 38.0 3 | sex : 1.0 4 | cp : 3.0 5 | trestbps : 120.0 6 | chol : 231.0 7 | fbs : 0.0 8 | restecg : 1.0 9 | thalach : 182.0 10 | exang : 1.0 11 | oldpeak : 3.8 12 | slope : 1.0 13 | ca : 0.0 14 | thal : 3.0 15 | target : 0.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample10.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 269 2 | age : 56.0 3 | sex : 1.0 4 | cp : 0.0 5 | trestbps : 130.0 6 | chol : 283.0 7 | fbs : 1.0 8 | restecg : 0.0 9 | thalach : 103.0 10 | exang : 1.0 11 | oldpeak : 1.6 12 | slope : 0.0 13 | ca : 0.0 14 | thal : 3.0 15 | target : 0.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample11.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 196 2 | age : 46.0 3 | sex : 1.0 4 | cp : 2.0 5 | trestbps : 150.0 6 | chol : 231.0 7 | fbs : 0.0 8 | restecg : 1.0 9 | thalach : 147.0 10 | exang : 0.0 11 | oldpeak : 3.6 12 | slope : 1.0 13 | ca : 0.0 14 | thal : 2.0 15 | target : 0.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample12.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 98 2 | age : 43.0 3 | sex : 1.0 4 | cp : 2.0 5 | trestbps : 130.0 6 | chol : 315.0 7 | fbs : 0.0 8 | restecg : 1.0 9 | thalach : 162.0 10 | exang : 0.0 11 | oldpeak : 1.9 12 | slope : 2.0 13 | ca : 1.0 14 | thal : 2.0 15 | target : 1.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample13.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 167 2 | age : 62.0 3 | sex : 0.0 4 | cp : 0.0 5 | trestbps : 140.0 6 | chol : 268.0 7 | fbs : 0.0 8 | restecg : 0.0 9 | thalach : 160.0 10 | exang : 0.0 11 | oldpeak : 3.6 12 | slope : 0.0 13 | ca : 2.0 14 | thal : 2.0 15 | target : 0.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample14.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 90 2 | age : 48.0 3 | sex : 1.0 4 | cp : 2.0 5 | trestbps : 124.0 6 | chol : 255.0 7 | fbs : 1.0 8 | restecg : 1.0 9 | thalach : 175.0 10 | exang : 0.0 11 | oldpeak : 0.0 12 | slope : 2.0 13 | ca : 2.0 14 | thal : 2.0 15 | target : 1.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample2.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 25 2 | age : 71.0 3 | sex : 0.0 4 | cp : 1.0 5 | trestbps : 160.0 6 | chol : 302.0 7 | fbs : 0.0 8 | restecg : 1.0 9 | thalach : 162.0 10 | exang : 0.0 11 | oldpeak : 0.4 12 | slope : 2.0 13 | ca : 2.0 14 | thal : 2.0 15 | target : 1.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample3.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 60 2 | age : 71.0 3 | sex : 0.0 4 | cp : 2.0 5 | trestbps : 110.0 6 | chol : 265.0 7 | fbs : 1.0 8 | restecg : 0.0 9 | thalach : 130.0 10 | exang : 0.0 11 | oldpeak : 0.0 12 | slope : 2.0 13 | ca : 1.0 14 | thal : 2.0 15 | target : 1.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample4.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 62 2 | age : 52.0 3 | sex : 1.0 4 | cp : 3.0 5 | trestbps : 118.0 6 | chol : 186.0 7 | fbs : 0.0 8 | restecg : 0.0 9 | thalach : 190.0 10 | exang : 0.0 11 | oldpeak : 0.0 12 | slope : 1.0 13 | ca : 0.0 14 | thal : 1.0 15 | target : 1.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample5.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 191 2 | age : 58.0 3 | sex : 1.0 4 | cp : 0.0 5 | trestbps : 128.0 6 | chol : 216.0 7 | fbs : 0.0 8 | restecg : 0.0 9 | thalach : 131.0 10 | exang : 1.0 11 | oldpeak : 2.2 12 | slope : 1.0 13 | ca : 3.0 14 | thal : 3.0 15 | target : 0.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample6.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 223 2 | age : 56.0 3 | sex : 0.0 4 | cp : 0.0 5 | trestbps : 200.0 6 | chol : 288.0 7 | fbs : 1.0 8 | restecg : 0.0 9 | thalach : 133.0 10 | exang : 1.0 11 | oldpeak : 4.0 12 | slope : 0.0 13 | ca : 2.0 14 | thal : 3.0 15 | target : 0.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample7.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 243 2 | age : 57.0 3 | sex : 1.0 4 | cp : 0.0 5 | trestbps : 152.0 6 | chol : 274.0 7 | fbs : 0.0 8 | restecg : 1.0 9 | thalach : 88.0 10 | exang : 1.0 11 | oldpeak : 1.2 12 | slope : 1.0 13 | ca : 1.0 14 | thal : 3.0 15 | target : 0.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample8.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 195 2 | age : 59.0 3 | sex : 1.0 4 | cp : 0.0 5 | trestbps : 170.0 6 | chol : 326.0 7 | fbs : 0.0 8 | restecg : 0.0 9 | thalach : 140.0 10 | exang : 1.0 11 | oldpeak : 3.4 12 | slope : 0.0 13 | ca : 0.0 14 | thal : 3.0 15 | target : 0.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/sample9.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 154 2 | age : 39.0 3 | sex : 0.0 4 | cp : 2.0 5 | trestbps : 138.0 6 | chol : 220.0 7 | fbs : 0.0 8 | restecg : 1.0 9 | thalach : 152.0 10 | exang : 0.0 11 | oldpeak : 0.0 12 | slope : 1.0 13 | ca : 0.0 14 | thal : 2.0 15 | target : 1.0 16 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample0.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample1.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample10.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample10.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample11.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample11.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample12.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample12.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample13.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample13.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample14.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample14.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample2.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample3.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample4.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample4.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample5.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample6.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample6.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample7.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample7.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample8.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample8.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample9.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/x_sample9.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample0.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample1.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample10.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample10.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample11.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample11.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample12.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample12.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample13.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample13.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample14.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample14.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample2.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample3.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample4.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample4.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample5.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample6.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample6.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample7.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample7.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample8.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample8.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample9.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Heart_Disease_Application/samples/y_sample9.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/x_test.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/x_test.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/x_train.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/x_train.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/x_val.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/x_val.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/y_test.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/y_test.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/y_train.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/y_train.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/y_val.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/datasets/y_val.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/generate_samples.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 26, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np\n", 11 | "from sklearn.model_selection import train_test_split\n", 12 | "import h5py\n", 13 | "import os\n", 14 | "from preprocessor import Preprocessor" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 27, 20 | "metadata": {}, 21 | "outputs": [], 22 | "source": [ 23 | "def save_data_set(x, y, data_type, path, s=''):\n", 24 | " if not os.path.exists(path):\n", 25 | " os.makedirs(path)\n", 26 | " fname=os.path.join(path, f'x_{data_type}{s}.h5')\n", 27 | " # print(\"Saving x_{} of shape {} in {}\".format(data_type, x.shape, fname))\n", 28 | " xf = h5py.File(fname, 'w')\n", 29 | " xf.create_dataset('x_{}'.format(data_type), data=x)\n", 30 | " xf.close()\n", 31 | "\n", 32 | " # print(\"Saving y_{} of shape {} in {}\".format(data_type, y.shape, fname))\n", 33 | " yf = h5py.File(os.path.join(path, f'y_{data_type}{s}.h5'), 'w')\n", 34 | " yf.create_dataset(f'y_{data_type}', data=y)\n", 35 | " yf.close()\n", 36 | "\n", 37 | "cols = {\n", 38 | " 'checking':str, \n", 39 | " 'duration':np.int64, \n", 40 | " 'credit-hist':str, \n", 41 | " 'purpose':str, \n", 42 | " 'credit-amount':np.int64,\n", 43 | " 'savings-account':str, \n", 44 | " 'employment-duration':str, \n", 45 | " 'installment-income-ratio':np.int64,\n", 46 | " 'marital-gender-status':str,\n", 47 | " 'debtors-guarantors':str, \n", 48 | " 'residence-since':str, \n", 49 | " 'property':str, \n", 50 | " 'age':np.int64,\n", 51 | " 'installment-plans':str, \n", 52 | " 'housing':str, \n", 53 | " 'num-existing-credits':np.int64, \n", 54 | " 'job':str,\n", 55 | " 'num-liable':np.int64, \n", 56 | " 'telephone':str, \n", 57 | " 'foreign-worker':str, \n", 58 | " 'is_good':np.int64\n", 59 | " }\n", 60 | "\n", 61 | "df = pd.read_csv('./datasets/loan_approval.generated', sep=\" \", index_col=False, names=cols.keys(), header=None, dtype=cols)\n", 62 | "\n", 63 | "X = df.drop(['is_good'], axis=1)\n", 64 | "y = df['is_good'].replace([1, 2], [1, 0])\n", 65 | "\n", 66 | "# Returned values type: \n", 67 | "# x_train - pandas.core.frame.DataFrame \n", 68 | "# y_train - pandas.core.series.Series \n", 69 | "# x_test - pandas.core.frame.DataFrame\n", 70 | "# y_test - pandas.core.series.Series\n", 71 | "x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=5, stratify=y)\n", 72 | "\n", 73 | "prep = Preprocessor()\n", 74 | "# Returned value type: Numpy NDArray\n", 75 | "x_train = prep.fit_transform(x_train)\n", 76 | "# Returned value type: Numpy NDArray\n", 77 | "x_test = prep.transform(x_test)\n", 78 | "\n", 79 | "# Returned values type: \n", 80 | "# x_test - numpy.ndarray \n", 81 | "# y_test - pandas.core.series.Series \n", 82 | "# x_val - numpy.ndarray\n", 83 | "# y_val - pandas.core.series.Series\n", 84 | "x_test, x_val, y_test, y_val = train_test_split(x_test, y_test, test_size=4096, random_state=5, stratify=y_test)\n", 85 | "\n", 86 | "test_idx = y_test[0:15].index\n", 87 | "path = \"samples//\"\n", 88 | "if not os.path.exists(path):\n", 89 | " os.makedirs(path)\n", 90 | "\n", 91 | "for i in range(test_idx.size):\n", 92 | " out = f\"Sample_Index: {test_idx[i]}\\n\"\n", 93 | " for col in df.columns:\n", 94 | " out = out + col + \" : \" + str(df.loc[test_idx[i]][col]) + \"\\n\"\n", 95 | " fname = os.path.join(path, \"sample\" + str(i) + \".raw\")\n", 96 | " # print(\"Saving raw data to: \" + fname)\n", 97 | " with open(fname, 'w') as f:\n", 98 | " f.write(out)\n", 99 | " save_data_set(np.reshape(x_test[i], [1, x_test[i].shape[0]]), y_test.to_numpy()[i], data_type='sample'+str(i), path=path)\n" 100 | ] 101 | } 102 | ], 103 | "metadata": { 104 | "interpreter": { 105 | "hash": "43d982d829920eaf0507229beb1c4743214d55064409a8508c85e917891da2d5" 106 | }, 107 | "kernelspec": { 108 | "display_name": "Python 3.8.5 64-bit ('hecloud')", 109 | "language": "python", 110 | "name": "python3" 111 | }, 112 | "language_info": { 113 | "codemirror_mode": { 114 | "name": "ipython", 115 | "version": 3 116 | }, 117 | "file_extension": ".py", 118 | "mimetype": "text/x-python", 119 | "name": "python", 120 | "nbconvert_exporter": "python", 121 | "pygments_lexer": "ipython3", 122 | "version": "3.8.5" 123 | }, 124 | "orig_nbformat": 4 125 | }, 126 | "nbformat": 4, 127 | "nbformat_minor": 2 128 | } 129 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/model/loan_approval_model.requirements: -------------------------------------------------------------------------------- 1 | {"rotation_keys":{"num_steps":"10", "step1":"-4096", "step2":"-128", "step3":"-16", "step4":"-4", "step5":"-1" , "step6":"1" , "step7":"4" , "step8":"16" , "step9":"128" , "step10":"4096"}} -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/model/loan_approval_model.type: -------------------------------------------------------------------------------- 1 | Neural Network -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/model/nn_loan_approval_model.json: -------------------------------------------------------------------------------- 1 | {"class_name": "Sequential", "config": {"name": "sequential_1", "layers": [{"class_name": "InputLayer", "config": {"batch_input_shape": [null, 62], "dtype": "float32", "sparse": false, "ragged": false, "name": "dense_3_input"}}, {"class_name": "Dense", "config": {"name": "dense_3", "trainable": true, "batch_input_shape": [null, 62], "dtype": "float32", "units": 200, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation_2", "trainable": true, "dtype": "float32", "activation": "square"}}, {"class_name": "Dense", "config": {"name": "dense_4", "trainable": true, "batch_input_shape": [null, 62], "dtype": "float32", "units": 100, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation_3", "trainable": true, "dtype": "float32", "activation": "square"}}, {"class_name": "Dense", "config": {"name": "dense_5", "trainable": true, "dtype": "float32", "units": 1, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}]}, "keras_version": "2.8.0", "backend": "tensorflow"} -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/model/nn_loan_approval_model_weights.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/model/nn_loan_approval_model_weights.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/model/prep.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/model/prep.pickle -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/preprocessor.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pandas as pd 3 | from sklearn.preprocessing import MinMaxScaler 4 | import pickle 5 | 6 | class Preprocessor(): 7 | 8 | @staticmethod 9 | def load(path): 10 | with open(path, "rb") as f: 11 | return pickle.load(f) 12 | 13 | def __init__(self, feature_scaler=None, columns=None) -> None: 14 | if feature_scaler is None: 15 | self.feature_scaler = MinMaxScaler() 16 | else: 17 | self.feature_scaler = feature_scaler 18 | if columns is None: 19 | self.columns = [] 20 | else: 21 | self.columns = columns 22 | 23 | def fit_transform(self, df): 24 | return self._prep(df,is_train=True) 25 | 26 | def transform(self, df): 27 | return self._prep(df,is_train=False) 28 | 29 | def encode(self, dict): 30 | return self.transform(pd.DataFrame([dict])) 31 | 32 | def save(self, path): 33 | with open(os.path.join(path), "wb") as f: 34 | pickle.dump(self, f) 35 | 36 | def _prep(self, df, is_train): 37 | df = df.copy() 38 | df['telephone'] = df['telephone'].replace(['A191', 'A192'], [0, 1]) 39 | df['foreign-worker'] = df['foreign-worker'].replace(['A201', 'A202'], [1, 0]) 40 | 41 | cat_features_list = ['checking', 'credit-hist', 'purpose', 'savings-account', 'employment-duration', 42 | 'marital-gender-status', 'debtors-guarantors', 'property', 'installment-plans', 'housing', 43 | 'num-existing-credits','job' ] 44 | 45 | for f in cat_features_list: 46 | dummy = pd.get_dummies(df[f], prefix=f.strip()) 47 | df = pd.concat([df, dummy], axis='columns') 48 | 49 | final = df.drop(cat_features_list,axis=1) 50 | # print(f'data shape: {final.shape}') 51 | 52 | if is_train: 53 | self.columns = final.columns 54 | final = self.feature_scaler.fit_transform(final) 55 | else: 56 | final = final.reindex(columns= self.columns, fill_value=0) 57 | final = self.feature_scaler.transform(final) 58 | return final -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample0.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 46729 2 | checking : A12 3 | duration : 9 4 | credit-hist : A30 5 | purpose : A42 6 | credit-amount : 360 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 2 10 | marital-gender-status : A91 11 | debtors-guarantors : A101 12 | residence-since : 3 13 | property : A122 14 | age : 27 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample1.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 37420 2 | checking : A11 3 | duration : 5 4 | credit-hist : A32 5 | purpose : A45 6 | credit-amount : 827 7 | savings-account : A61 8 | employment-duration : A72 9 | installment-income-ratio : 1 10 | marital-gender-status : A92 11 | debtors-guarantors : A101 12 | residence-since : 3 13 | property : A121 14 | age : 36 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample10.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 42668 2 | checking : A13 3 | duration : 11 4 | credit-hist : A30 5 | purpose : A42 6 | credit-amount : 258 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 4 10 | marital-gender-status : A92 11 | debtors-guarantors : A102 12 | residence-since : 4 13 | property : A121 14 | age : 23 15 | installment-plans : A143 16 | housing : A151 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample11.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 86410 2 | checking : A11 3 | duration : 8 4 | credit-hist : A32 5 | purpose : A40 6 | credit-amount : 434 7 | savings-account : A61 8 | employment-duration : A75 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A121 14 | age : 35 15 | installment-plans : A143 16 | housing : A151 17 | num-existing-credits : 1 18 | job : A172 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample12.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 82140 2 | checking : A14 3 | duration : 23 4 | credit-hist : A32 5 | purpose : A42 6 | credit-amount : 1308 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 1 10 | marital-gender-status : A92 11 | debtors-guarantors : A101 12 | residence-since : 1 13 | property : A121 14 | age : 19 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample13.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 57755 2 | checking : A14 3 | duration : 8 4 | credit-hist : A32 5 | purpose : A42 6 | credit-amount : 745 7 | savings-account : A61 8 | employment-duration : A72 9 | installment-income-ratio : 4 10 | marital-gender-status : A92 11 | debtors-guarantors : A101 12 | residence-since : 1 13 | property : A123 14 | age : 45 15 | installment-plans : A143 16 | housing : A151 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample14.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 92769 2 | checking : A11 3 | duration : 51 4 | credit-hist : A32 5 | purpose : A42 6 | credit-amount : 1542 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A124 14 | age : 33 15 | installment-plans : A143 16 | housing : A153 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 2 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 2 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample2.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 23187 2 | checking : A11 3 | duration : 5 4 | credit-hist : A32 5 | purpose : A42 6 | credit-amount : 267 7 | savings-account : A62 8 | employment-duration : A74 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 3 13 | property : A123 14 | age : 21 15 | installment-plans : A143 16 | housing : A151 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample3.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 30969 2 | checking : A11 3 | duration : 69 4 | credit-hist : A32 5 | purpose : A41 6 | credit-amount : 421 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A123 14 | age : 53 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 2 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample4.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 91526 2 | checking : A14 3 | duration : 5 4 | credit-hist : A34 5 | purpose : A43 6 | credit-amount : 252 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 4 10 | marital-gender-status : A92 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A121 14 | age : 31 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample5.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 93571 2 | checking : A13 3 | duration : 14 4 | credit-hist : A34 5 | purpose : A410 6 | credit-amount : 2270 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 1 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A123 14 | age : 19 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A174 19 | num-liable : 1 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample6.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 24456 2 | checking : A11 3 | duration : 12 4 | credit-hist : A32 5 | purpose : A42 6 | credit-amount : 289 7 | savings-account : A61 8 | employment-duration : A71 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A124 14 | age : 23 15 | installment-plans : A143 16 | housing : A153 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 1 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 2 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample7.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 22269 2 | checking : A14 3 | duration : 15 4 | credit-hist : A34 5 | purpose : A43 6 | credit-amount : 1942 7 | savings-account : A62 8 | employment-duration : A74 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 1 13 | property : A123 14 | age : 21 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A173 19 | num-liable : 2 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample8.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 31564 2 | checking : A14 3 | duration : 7 4 | credit-hist : A34 5 | purpose : A46 6 | credit-amount : 631 7 | savings-account : A61 8 | employment-duration : A73 9 | installment-income-ratio : 3 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 3 13 | property : A124 14 | age : 55 15 | installment-plans : A141 16 | housing : A152 17 | num-existing-credits : 1 18 | job : A172 19 | num-liable : 1 20 | telephone : A191 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/sample9.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 85849 2 | checking : A14 3 | duration : 21 4 | credit-hist : A34 5 | purpose : A43 6 | credit-amount : 2374 7 | savings-account : A61 8 | employment-duration : A75 9 | installment-income-ratio : 4 10 | marital-gender-status : A93 11 | debtors-guarantors : A101 12 | residence-since : 4 13 | property : A121 14 | age : 21 15 | installment-plans : A143 16 | housing : A152 17 | num-existing-credits : 2 18 | job : A174 19 | num-liable : 1 20 | telephone : A192 21 | foreign-worker : A201 22 | is_good : 1 23 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample0.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample1.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample10.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample10.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample11.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample11.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample12.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample12.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample13.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample13.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample14.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample14.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample2.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample3.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample4.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample4.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample5.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample6.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample6.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample7.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample7.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample8.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample8.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample9.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/x_sample9.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample0.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample1.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample10.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample10.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample11.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample11.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample12.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample12.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample13.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample13.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample14.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample14.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample2.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample3.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample4.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample4.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample5.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample6.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample6.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample7.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample7.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample8.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample8.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample9.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/NN_Loan_Approval_Application/samples/y_sample9.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/x_test.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/x_test.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/x_train.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/x_train.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/x_val.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/x_val.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/y_test.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/y_test.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/y_train.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/y_train.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/y_val.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/datasets/y_val.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/generate_samples.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 3, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np\n", 11 | "from sklearn.model_selection import train_test_split\n", 12 | "import h5py\n", 13 | "import os\n", 14 | "from preprocessor import Preprocessor" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 4, 20 | "metadata": {}, 21 | "outputs": [ 22 | { 23 | "data": { 24 | "text/plain": [ 25 | "array([[6.07436074e-01, 6.06806905e-01, 1.00000000e+00, ...,\n", 26 | " 0.00000000e+00, 5.50120603e-04, 4.22471910e-01],\n", 27 | " [3.39493395e-01, 3.38898077e-01, 1.00000000e+00, ...,\n", 28 | " 8.33333333e-02, 1.31952005e-03, 5.23595506e-02],\n", 29 | " [5.28055281e-01, 5.26841706e-01, 0.00000000e+00, ...,\n", 30 | " 0.00000000e+00, 1.40476951e-03, 2.24719101e-02],\n", 31 | " ...,\n", 32 | " [2.60232602e-01, 2.60690166e-01, 1.00000000e+00, ...,\n", 33 | " 0.00000000e+00, 1.35799002e-03, 4.50112360e-01],\n", 34 | " [1.88981890e-01, 1.89812901e-01, 1.00000000e+00, ...,\n", 35 | " 0.00000000e+00, 7.42470465e-04, 1.50292135e-01],\n", 36 | " [3.36753368e-01, 3.36038178e-01, 1.00000000e+00, ...,\n", 37 | " 0.00000000e+00, 5.50120603e-04, 1.57303371e-01]])" 38 | ] 39 | }, 40 | "metadata": {}, 41 | "output_type": "display_data" 42 | }, 43 | { 44 | "name": "stderr", 45 | "output_type": "stream", 46 | "text": [ 47 | "/tmp/ipykernel_9916/1649336773.py:48: FutureWarning: The behavior of `series[i:j]` with an integer-dtype index is deprecated. In a future version, this will be treated as *label-based* indexing, consistent with e.g. `series[i]` lookups. To retain the old behavior, use `series.iloc[i:j]`. To get the future behavior, use `series.loc[i:j]`.\n", 48 | " test_idx = y_test[0:15].index\n" 49 | ] 50 | } 51 | ], 52 | "source": [ 53 | "def save_data_set(x, y, data_type, path, s=''):\n", 54 | " if not os.path.exists(path):\n", 55 | " os.makedirs(path)\n", 56 | " fname=os.path.join(path, f'x_{data_type}{s}.h5')\n", 57 | " # print(\"Saving x_{} of shape {} in {}\".format(data_type, x.shape, fname))\n", 58 | " xf = h5py.File(fname, 'w')\n", 59 | " xf.create_dataset('x_{}'.format(data_type), data=x)\n", 60 | " xf.close()\n", 61 | "\n", 62 | " # print(\"Saving y_{} of shape {} in {}\".format(data_type, y.shape, fname))\n", 63 | " yf = h5py.File(os.path.join(path, f'y_{data_type}{s}.h5'), 'w')\n", 64 | " yf.create_dataset(f'y_{data_type}', data=y)\n", 65 | " yf.close()\n", 66 | "\n", 67 | "df = pd.read_csv(\"datasets/fraud_detection.csv\")\n", 68 | "df = df.iloc[0:100000,0:10]\n", 69 | "\n", 70 | "df.head()\n", 71 | "#X = df.drop(['TARGET'], axis=1)\n", 72 | "#y = df['TARGET']\n", 73 | "\n", 74 | "# Returned values type: \n", 75 | "# x_train - pandas.core.frame.DataFrame \n", 76 | "# y_train - pandas.core.series.Series \n", 77 | "# x_test - pandas.core.frame.DataFrame\n", 78 | "# y_test - pandas.core.series.Series\n", 79 | "train, test = train_test_split(df, test_size=0.2, random_state=5)\n", 80 | "#x_train, x_test, x_train, y_test = train_test_split(X, y, test_size=0.2, random_state=5)\n", 81 | "y_train = train[\"TARGET\"]\n", 82 | "y_test = test[\"TARGET\"]\n", 83 | "x_train = train.drop(\"TARGET\",axis=1)\n", 84 | "x_test = test.drop(\"TARGET\",axis=1)\n", 85 | "\n", 86 | "prep = Preprocessor()\n", 87 | "# Returned value type: Numpy NDArray\n", 88 | "x_train = prep.fit_transform(x_train)\n", 89 | "# Returned value type: Numpy NDArray\n", 90 | "x_test = prep.transform(x_test)\n", 91 | "\n", 92 | "display(x_test)\n", 93 | "# Returned values type: \n", 94 | "# x_test - numpy.ndarray \n", 95 | "# y_test - pandas.core.series.Series \n", 96 | "# x_val - numpy.ndarray\n", 97 | "# y_val - pandas.core.series.Series\n", 98 | "x_test, x_val, y_test, y_val = train_test_split(x_test, y_test, test_size=0.5, random_state=5)\n", 99 | "\n", 100 | "test_idx = y_test[0:15].index\n", 101 | "path = \"samples//\"\n", 102 | "if not os.path.exists(path):\n", 103 | " os.makedirs(path)\n", 104 | "\n", 105 | "for i in range(test_idx.size):\n", 106 | " out = f\"Sample_Index: {test_idx[i]}\\n\"\n", 107 | " for col in df.columns:\n", 108 | " out = out + col + \" : \" + str(df.loc[test_idx[i]][col]) + \"\\n\"\n", 109 | " fname = os.path.join(path, \"sample\" + str(i) + \".raw\")\n", 110 | " # print(\"Saving raw data to: \" + fname)\n", 111 | " with open(fname, 'w') as f:\n", 112 | " f.write(out)\n", 113 | " save_data_set(np.reshape(x_test[i], [1, x_test[i].shape[0]]), y_test.to_numpy()[i], data_type='sample'+str(i), path=path)\n" 114 | ] 115 | } 116 | ], 117 | "metadata": { 118 | "kernelspec": { 119 | "display_name": "Python 3.8.10 ('fhe-py38-env')", 120 | "language": "python", 121 | "name": "python3" 122 | }, 123 | "language_info": { 124 | "codemirror_mode": { 125 | "name": "ipython", 126 | "version": 3 127 | }, 128 | "file_extension": ".py", 129 | "mimetype": "text/x-python", 130 | "name": "python", 131 | "nbconvert_exporter": "python", 132 | "pygments_lexer": "ipython3", 133 | "version": "3.8.10" 134 | }, 135 | "orig_nbformat": 4, 136 | "vscode": { 137 | "interpreter": { 138 | "hash": "f497b8fb6983b2b7e8d6051f4315e544585546557ee2f98a631c292ad437c819" 139 | } 140 | } 141 | }, 142 | "nbformat": 4, 143 | "nbformat_minor": 2 144 | } 145 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/model/XGB_hyper_params.hyperparams: -------------------------------------------------------------------------------- 1 | { 2 | "featureRanges": [ 3 | [ 4 | 0.0, 5 | 1.0000000000000002 6 | ], 7 | [ 8 | 0.0, 9 | 1.0 10 | ], 11 | [ 12 | 0.0, 13 | 1.0 14 | ], 15 | [ 16 | 0.0, 17 | 1.0 18 | ], 19 | [ 20 | 0.0, 21 | 1.0 22 | ], 23 | [ 24 | 0.0, 25 | 1.0 26 | ], 27 | [ 28 | 0.0, 29 | 1.0 30 | ], 31 | [ 32 | 0.0, 33 | 0.9999999999999998 34 | ], 35 | [ 36 | 0.0, 37 | 1.0 38 | ] 39 | ], 40 | "gRep": 3, 41 | "fRep": 1 42 | } -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/model/prep.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/model/prep.pickle -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/preprocessor.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pandas as pd 3 | from sklearn.preprocessing import MinMaxScaler 4 | import pickle 5 | 6 | class Preprocessor(): 7 | 8 | @staticmethod 9 | def load(path): 10 | with open(path, "rb") as f: 11 | return pickle.load(f) 12 | 13 | def __init__(self, feature_scaler=None, columns=None) -> None: 14 | if feature_scaler is None: 15 | self.feature_scaler = MinMaxScaler() 16 | else: 17 | self.feature_scaler = feature_scaler 18 | if columns is None: 19 | self.columns = [] 20 | else: 21 | self.columns = columns 22 | 23 | def fit_transform(self, df): 24 | return self._prep(df,is_train=True) 25 | 26 | def transform(self, df): 27 | return self._prep(df,is_train=False) 28 | 29 | def encode(self, dict): 30 | return self.transform(pd.DataFrame([dict])) 31 | 32 | def save(self, path): 33 | with open(os.path.join(path), "wb") as f: 34 | pickle.dump(self, f) 35 | 36 | def _prep(self, df, is_train): 37 | df = df.copy() 38 | df['NAME_CONTRACT_TYPE'] = (df['NAME_CONTRACT_TYPE'] == 'Cash loans').astype('int') 39 | df['CODE_GENDER'] = (df['CODE_GENDER'] == 'F').astype('int') 40 | df['FLAG_OWN_CAR'] = (df['FLAG_OWN_CAR'] == 'Y').astype('int') 41 | df['FLAG_OWN_REALTY'] = (df['FLAG_OWN_REALTY'] == 'Y').astype('int') 42 | 43 | if is_train: 44 | final = self.feature_scaler.fit_transform(df) 45 | else: 46 | final = self.feature_scaler.transform(df) 47 | return final -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample0.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 56216 2 | Unnamed: 0 : 56216 3 | SK_ID_CURR : 165138 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : F 7 | FLAG_OWN_CAR : N 8 | FLAG_OWN_REALTY : N 9 | CNT_CHILDREN : 0 10 | AMT_INCOME_TOTAL : 108000.0 11 | AMT_CREDIT : 284400.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample1.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 60052 2 | Unnamed: 0 : 60052 3 | SK_ID_CURR : 169630 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : F 7 | FLAG_OWN_CAR : N 8 | FLAG_OWN_REALTY : Y 9 | CNT_CHILDREN : 0 10 | AMT_INCOME_TOTAL : 144000.0 11 | AMT_CREDIT : 359685.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample10.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 12359 2 | Unnamed: 0 : 12359 3 | SK_ID_CURR : 114408 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : M 7 | FLAG_OWN_CAR : Y 8 | FLAG_OWN_REALTY : Y 9 | CNT_CHILDREN : 0 10 | AMT_INCOME_TOTAL : 202500.0 11 | AMT_CREDIT : 675000.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample11.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 99220 2 | Unnamed: 0 : 99220 3 | SK_ID_CURR : 215200 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : F 7 | FLAG_OWN_CAR : N 8 | FLAG_OWN_REALTY : Y 9 | CNT_CHILDREN : 1 10 | AMT_INCOME_TOTAL : 103500.0 11 | AMT_CREDIT : 431280.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample12.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 42556 2 | Unnamed: 0 : 42556 3 | SK_ID_CURR : 149257 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : M 7 | FLAG_OWN_CAR : Y 8 | FLAG_OWN_REALTY : Y 9 | CNT_CHILDREN : 0 10 | AMT_INCOME_TOTAL : 225000.0 11 | AMT_CREDIT : 370912.5 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample13.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 2802 2 | Unnamed: 0 : 2802 3 | SK_ID_CURR : 103270 4 | TARGET : 1 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : M 7 | FLAG_OWN_CAR : Y 8 | FLAG_OWN_REALTY : Y 9 | CNT_CHILDREN : 0 10 | AMT_INCOME_TOTAL : 90000.0 11 | AMT_CREDIT : 225000.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample14.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 43887 2 | Unnamed: 0 : 43887 3 | SK_ID_CURR : 150823 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : M 7 | FLAG_OWN_CAR : Y 8 | FLAG_OWN_REALTY : N 9 | CNT_CHILDREN : 0 10 | AMT_INCOME_TOTAL : 135000.0 11 | AMT_CREDIT : 283419.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample2.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 61289 2 | Unnamed: 0 : 61289 3 | SK_ID_CURR : 171074 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : F 7 | FLAG_OWN_CAR : N 8 | FLAG_OWN_REALTY : Y 9 | CNT_CHILDREN : 3 10 | AMT_INCOME_TOTAL : 67500.0 11 | AMT_CREDIT : 675000.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample3.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 83412 2 | Unnamed: 0 : 83412 3 | SK_ID_CURR : 196746 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : F 7 | FLAG_OWN_CAR : N 8 | FLAG_OWN_REALTY : Y 9 | CNT_CHILDREN : 1 10 | AMT_INCOME_TOTAL : 180000.0 11 | AMT_CREDIT : 1762110.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample4.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 44492 2 | Unnamed: 0 : 44492 3 | SK_ID_CURR : 151547 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : M 7 | FLAG_OWN_CAR : Y 8 | FLAG_OWN_REALTY : N 9 | CNT_CHILDREN : 0 10 | AMT_INCOME_TOTAL : 225000.0 11 | AMT_CREDIT : 835380.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample5.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 15664 2 | Unnamed: 0 : 15664 3 | SK_ID_CURR : 118275 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : M 7 | FLAG_OWN_CAR : Y 8 | FLAG_OWN_REALTY : Y 9 | CNT_CHILDREN : 0 10 | AMT_INCOME_TOTAL : 180000.0 11 | AMT_CREDIT : 922266.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample6.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 49968 2 | Unnamed: 0 : 49968 3 | SK_ID_CURR : 157841 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : F 7 | FLAG_OWN_CAR : Y 8 | FLAG_OWN_REALTY : Y 9 | CNT_CHILDREN : 1 10 | AMT_INCOME_TOTAL : 126000.0 11 | AMT_CREDIT : 269550.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample7.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 81312 2 | Unnamed: 0 : 81312 3 | SK_ID_CURR : 194278 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Revolving loans 6 | CODE_GENDER : M 7 | FLAG_OWN_CAR : N 8 | FLAG_OWN_REALTY : N 9 | CNT_CHILDREN : 0 10 | AMT_INCOME_TOTAL : 225000.0 11 | AMT_CREDIT : 405000.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample8.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 69380 2 | Unnamed: 0 : 69380 3 | SK_ID_CURR : 180471 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : F 7 | FLAG_OWN_CAR : N 8 | FLAG_OWN_REALTY : Y 9 | CNT_CHILDREN : 0 10 | AMT_INCOME_TOTAL : 157500.0 11 | AMT_CREDIT : 495000.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/sample9.raw: -------------------------------------------------------------------------------- 1 | Sample_Index: 16255 2 | Unnamed: 0 : 16255 3 | SK_ID_CURR : 118961 4 | TARGET : 0 5 | NAME_CONTRACT_TYPE : Cash loans 6 | CODE_GENDER : M 7 | FLAG_OWN_CAR : N 8 | FLAG_OWN_REALTY : Y 9 | CNT_CHILDREN : 0 10 | AMT_INCOME_TOTAL : 172800.0 11 | AMT_CREDIT : 675000.0 12 | -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample0.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample1.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample10.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample10.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample11.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample11.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample12.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample12.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample13.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample13.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample14.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample14.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample2.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample3.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample4.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample4.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample5.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample6.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample6.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample7.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample7.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample8.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample8.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample9.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/x_sample9.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample0.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample1.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample10.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample10.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample11.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample11.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample12.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample12.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample13.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample13.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample14.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample14.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample2.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample3.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample4.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample4.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample5.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample6.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample6.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample7.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample7.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample8.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample8.h5 -------------------------------------------------------------------------------- /HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample9.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/helayers/8ce1496840dd8a339a1c7861118c1ab8b7c77540/HE4Cloud/Notebooks/XGB_Fraud_Detection_Application/samples/y_sample9.h5 -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # HElayers license 2 | 3 | HElayers is provided under a community edition license for non-commercial use; 4 | see [license](https://ibm.ent.box.com/s/zfl6rt2p09811nyy8yow8t3mpsmkmsw6). For 5 | commercial deployments and access to the source code, please contact 6 | [chamliam@ie.ibm.com](mailto:chamliam@ie.ibm.com) for the Premium Edition 7 | license. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HElayers 2 | 3 | ## Scope 4 | 5 | IBM HElayers is software development kit (SDK) for the practical and efficient 6 | execution of encrypted workloads using fully homomorphic encrypted data. 7 | HElayers is designed to enable application developers and data scientists to 8 | seamlessly apply advanced privacy preserving techniques without requiring 9 | specialized skills in cryptography. 10 | 11 | HElayers now powers [IBM's FHE Cloud Service](https://he4cloud.com/public/), a 12 | beta cloud service that enables data scientists and developers to deploy 13 | privacy preserving machine learning driven Software-as-a-Service (SaaS) 14 | applications in the Cloud. 15 | 16 | ## Usage 17 | 18 | Please refer to the [HElayers website](https://ibm.github.io/helayers/). 19 | 20 | ## License 21 | 22 | HElayers is provided under a community edition license for non-commercial use; 23 | see [license](https://ibm.ent.box.com/s/zfl6rt2p09811nyy8yow8t3mpsmkmsw6). For 24 | commercial deployments and access to the source code, please contact 25 | [chamliam@ie.ibm.com](mailto:chamliam@ie.ibm.com) for the Premium Edition 26 | license. 27 | --------------------------------------------------------------------------------