File size: 2,318 Bytes
2c61e02
 
 
 
 
 
 
55b09db
 
 
 
2c61e02
 
 
55b09db
 
 
 
 
2c61e02
 
 
55b09db
2c61e02
 
 
55b09db
acad05f
2c61e02
 
55b09db
2c61e02
 
 
 
 
 
 
 
9591a3a
 
2c61e02
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
library_name: keras
tags:
- structured-data
- tabular-data
- classification
---
# Tensorflow Keras Implementation of Structured data classification from scratch
This repo contains models and notebook for [Structured data classification from scratch](https://keras.io/examples/structured_data/structured_data_classification_from_scratch/).  
This example demonstrates how to do structured data classification, starting from a raw CSV file. Our data includes both numerical and categorical features. We will use Keras preprocessing layers to normalize the numerical features and vectorize the categorical ones.  
Full credits to [François Chollet](https://twitter.com/fchollet), creator of Keras!

## Model description

The model is a very simple MLP with only one hidden layer.
This example showcases how to perform preprocessing of common tabular data *inside* a Keras model.
It uses tensorflow.keras.layers.{IntegerLookup, Normalization, StringLookup} to process numerical and categorical (integer or string) features.



## Intended uses & limitations

This tool does not provide medical advice It is intended for informational purposes only. It is not a substitute for professional medical advice, diagnosis or treatment. 

## Training and evaluation data

[Our dataset](https://archive.ics.uci.edu/ml/datasets/heart+Disease) is provided by the Cleveland Clinic Foundation for Heart Disease. It's a CSV file with 303 rows. Each row contains information about a patient (a sample), and each column describes an attribute of the patient (a feature). We use the features to predict whether a patient has a heart disease (binary classification).
The model is trained on 80% of data and evaluated on remaining 20%.

## Training procedure
Training proceeds for 50 epochs with default Adam optimizer on binary crossentropy.

### Training hyperparameters

The following hyperparameters were used during training:
- optimizer: {'name': 'Adam', 'learning_rate': 0.001, 'decay': 0.0, 'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-07, 'amsgrad': False}
- training_precision: float32

 ## Training Metrics
Training achieves >83% accuracy on the held-out validation data.
Check TensorBoard "Metrics" tab above for details.
 ## Model Plot

<details>
<summary>View Model Plot</summary>

![Model Image](./model.png)

</details>