<jupyter_start><jupyter_text>💻Week 2 Workbook of unpackAI "DL101 Bootcamp"  📕 Learning Objectives of the Week* Get hands-on experience on building tabular models   unpackAI Assignment Section *   **Assignment 1**: Go through the multiple choice questions below and choose the correct answer. Discuss during the presentation session.*   **Assignment 2**: Build an entire classification model starting from defining your objective, gathering data to training your model and interpreting the results.  Assignment 1:  The questions here are designed to ensure that you can know the following*    Why a random forest is useful as a ML algorithm*    Understand the difference between a categorical and a continous variable*    Understand the reasons why features can or should be removed from a the model*    **Ensure that you understand the names of the different variables, functions, and classes in the code, so that you can edit and reuse them independently.** The following questions are multiple choice to help guide undestanding of the content. However, there can be one or multiple answers to each of the questions. Please skim through the questions, and as you run through the notebooks fill in the answers as you find them. --- **Section A**: Understanding the Code 1. What is a "target variable? * A. It is similar to the y variable in an equation.* B. It informs the algorithm what to target during convolution data processing iterations.* C. It is the variable that our model seeks to predict.* D. It helps the algorithm decide how to split the data set 2. Why do you need to split your dataset into training, validation and test sets?* A. The model can easily overfit on the training set, so validation and test are extra sets to avoid overfitting.* B. You train on the training set, you check the metrics on the validation set, you make the model predictions on the test set.* C. The validation set is used to check your assumptions before the model training, while the test set is used test the results of the model training.* D. The training set is required to train the baseline model, the validation set is used for model tuning, the test set is used to fine-tune the model until it achieves the state-of-the-art result.3. After learning about AutoML, how would you approach machine learning tasks?* A. AutoML is inherently dumb thing, because you have to use the neural network algorithm in the most of the times as its very powerful in making predictions on sophisticated data.* B. AutoML allows you to explore how several algorithms might fit the data in order to determine the most suitable one.* C. AutoML is only for non-ML professionals because ML engineers know exactly what methods and techniques will work just by looking at the data.* D. AutoML is not easy at all as you still need to code AutoML steps, have strong mathematical and machine learning skills 4. Why would you cross validate the results of our training using many folds?* A.Splitting dataset to trainig/validation/test sets might not be enough as you might not have the same data distribution among all sets to confidentally determine ML model training results. * B.In case if you have a small dataset, you might have the validation set so small with only few examples of the particular class that will result in pure model evaluation* C. The similar model performance accross all folds might indicate that model will perform well on unseen data* D. Splitting the dataset randomly will not always result in randomness accross the trainining/validation/test sets ---**Section 2**: Understanding the difference between categorical and continous variables 5. Which of the following are properties of continuous variables?* A. They can be interpreted mathematically as data points along a line/plane* B. They are easy to identify whenever you see numbers in the dataset* C. They usually lie within a range and can be full integers (1,5,-7) or floating point decimals (88.01, 94.00) depending on how the data was collected* D. Their only purpose is to divide the dataset into easy to understand groups6. Which of the following are properties of categorical variables?* A. They tell us information which doesn't have immediate mathematical meaning like colors, locations, or names.* B. They allow us to group the dataset into categories based on properties * C. They always appear as text in a dataset. * D. They exist along a quantifiable spectrum.7. Which of the following should be treated as a continuous variable rather than a categorical variable?* A. E-commerce goods organized by their use/function on a website such as Amazon* B. Postal Codes and Phone Numbers from a customer database* C. Educational background (none, primary school, some secondary school, secondary school, some university, university, masters, doctorate, postdoc) * D. Randomly generated primary keys from a SQL database 8. Which of the following should be treated as a categorical variable rather than a continuous variable? * A. The standard deviation from the mean of a sample* B. The rolls of a 6 sided dice (1,2,3,4,5,6)* C. Temperature as reported by people (hot, cold, warm, freezing, cool)* D. The materials used in manufacturing a product (Plastic, Metal, Glass).  Assignment 2: Build an entire classification model starting from defining your objective, gathering data to training your model and interpreting the results.<jupyter_code>import sys
!pip install -Uqq pandas-profiling[notebook]
!pip install -Uqq pycaret
!jupyter nbextension enable --py widgetsnbextension
# Standard Library Imports
from pathlib import Path

# Installed packages
import pandas as pd
from ipywidgets import widgets

# Our package
from pandas_profiling import ProfileReport
from pandas_profiling.utils.cache import cache_file

#Enable pycaret on Colab
from pycaret.utils import enable_colab
enable_colab()
%matplotlib inline<jupyter_output>Colab mode enabled.<jupyter_text>0. Define a machine learning task Try to look first at the coursebook's example in order to articulare your machine learning task, what's observed and what answer you want the model to predict. **Machine Learning Task**: **Target**: **Samples**: .**Features**:   1. Choose your datasetWe highly recommend you to search for your own Tabular Data dataset. For that you can easily go on [Kaggle](https://www.kaggle.com/) and search for your own tabular classification dataset.Examples could be 1. [Online shopper purchasing intention:](https://archive.ics.uci.edu/ml/datasets/Online+Shoppers+Purchasing+Intention+Dataset) Will the shopper purchase or not purchase a product?1. [Mushroom Classification](https://www.kaggle.com/uciml/mushroom-classification): Edible or poisonous mushroom?1. [Others...](https://www.kaggle.com/datasets?search=classification&datasetsOnly=true)In order to  utilise the dataset, you will have to download it, and upload it into the Colab Notebook using the files feature on the left. See the image below for the step-by-step process.As a data requirement, make sure that you are working with a tabular data classification task. The data format has to be `csv`.  2. Prepare the dataset You can build DataFrame directly by reading csv file from download link we provided in the Assignment description.Tips: use `pd.read_csv("your path goes here")`> Make sure to not forget the "".<jupyter_code><jupyter_output><empty_output><jupyter_text>3. Explore your dataset using Pandas Profiling<jupyter_code><jupyter_output><empty_output><jupyter_text>Split the dataset to training and test sets<jupyter_code><jupyter_output><empty_output><jupyter_text>4. Automated Machine Learning<jupyter_code><jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.051937883335508285, 'fraction_numerical': 0.00561137935534386, 'mean_word_length': 4.918146718146718, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '118547', 'license': 'MIT', 'n_tokens_mistral': 1872, 'n_tokens_neox': 1791, 'n_words': 1112, 'path': '02_Tabular_Workbook.ipynb', 'repo_name': 'knectt/DL101', 'size': '7663'}