Course Wiki
Setting up the validation framework — Machine Learning Zoomcamp Module 2
In general, the dataset is splitted into three parts: training, validation, and test. For each partition, we need to obtain feature matrices (X) and vectors of targets (y). First, the size of the partitions is calculated. Next, the records...
Related Pages
Machine Learning Zoomcamp › Module 2: Machine Learning for Regression › Setting up the validation framework
Notes
In general, the dataset is splitted into three parts: training, validation, and test. For each partition, we need to obtain feature matrices (X) and vectors of targets (y). First, the size of the partitions is calculated. Next, the records are shuffled to ensure that the values in the three partitions contain non-sequential records from the dataset. Finally, the partitions are created using the shuffled indices.
Pandas attributes and methods:
df.iloc[]-> return subsets of records of a dataframe, being selected by numerical indicesdf.reset_index()-> restate the orginal indicesdel df[col]-> eliminate a column variable
Numpy methods:
np.arange()-> return an array of numbersnp.random.shuffle()-> return a shuffled arraynp.random.seed()-> set a seed for reproducibility
The entire code of this project is available in this jupyter notebook.
| ⚠️ |
The notes are written by the community. If you see an error here, please create a PR with a fix. |
Key concepts
Related notes
- mlz-m01-introduction-to-numpy
- mlz-m01-introduction-to-pandas
- mlz-m01-linear-algebra-refresher
- mlz-m01-setting-up-the-environment
- mlz-m01-summary
- mlz-m02-baseline-model-for-car-price-prediction-project
- mlz-m02-car-price-prediction-project
- mlz-m02-car-price-prediction-project-summary
- mlz-m02-categorical-variables
- mlz-m02-computing-rmse-on-validation-data
- mlz-m02-data-preparation
- mlz-m02-exploratory-data-analysis
- mlz-m02-explore-more
- mlz-m02-feature-engineering
- mlz-m02-linear-regression
- mlz-m02-linear-regression-vector-form
- mlz-m02-regularization
- mlz-m02-root-mean-squared-error-rmse
- mlz-m02-training-linear-regression-normal-equation
- mlz-m02-tuning-the-model
- mlz-m02-using-the-model
- mlz-m03-data-preparation
- mlz-m03-eda
- mlz-m03-feature-importance-churn-rate-and-risk-ratio
- mlz-m03-feature-importance-correlation
- mlz-m03-feature-importance-mutual-information
- mlz-m03-logistic-regression
- mlz-m03-model-interpretation
- mlz-m03-one-hot-encoding
- mlz-m03-setting-up-the-validation-framework
- mlz-m03-training-logistic-regression-with-scikit-learn
- mlz-m04-accuracy-and-dummy-model
- mlz-m04-confusion-table
- mlz-m04-cross-validation
- mlz-m04-roc-auc
- mlz-m04-roc-curves
- mlz-m04-summary
- mlz-m06-data-cleaning-and-preparation
- mlz-m06-decision-trees-parameter-tuning
- mlz-m06-gradient-boosting-and-xgboost
- mlz-m06-xgboost-parameter-tuning
- mlz-m08-installation-of-tensorflow
- mlz-m10-creating-a-pre-processing-service