Hyperparameters are configuration variables that govern the training process itself. For example, part of setting up a deep neural network is deciding how many hidden layers of nodes to use between the input layer and the output layer, and how many nodes each layer should use. These variables are not directly related to the training data.
- The .ipynb (Jupyter Notebook/Google collab) file of the FULL CODE.
- The code snippets (.ipynb) which are attached in the article.
- The Breast cancer dataset used.
The full dataset can be accessed from HERE.
Variable | Definition | Key |
---|---|---|
id | ID number | |
diagnosis | The diagnosis of breast tissues | M = malignant, B = benign |
Feature | Defintion |
---|---|
Radius | Mean of distances from center to points on the perimeter |
Texture | Standard deviation of gray-scale values |
Perimeter | |
Area | |
Smoothness | Local variation in radius lengths |
Compactness | Perimeter^2 / area - 1.0 |
Concavity | Severity of concave portions of the contour |
Concave points | Number of concave portions of the contour |
Symmetry | |
Fractal dimension | "coastline approximation" - 1 |
Total True values | Diagnosed Type |
---|---|
357 | (B) benign |
212 | (M) malignant |
Where the model parameters specify how to transform the input data into the desired output, the hyperparameters define how our model is actually structured.
But unfortunately, there’s no one universal way to calculate “which way should one update the hyperparameters to reduce the loss and increase the efficiency?” (For e.g. The learning rate(α) of gradient descent, a method typically used in linear regression algorithm) in order to find the optimal model architecture. Thus, we generally resort to experimentation to figure out what works the best.
- Define a search space as a grid of hyperparameter values and evaluate every position in the grid.
- Define a search space as a bounded domain of hyperparameter values and randomly sample points in that domain.
- TPOT is a Python Automated Machine Learning tool that optimizes machine learning pipelines using genetic programming.
- Bayesian optimization is an approach to optimizing objective functions that take a long time (minutes or hours) to evaluate.