Conteúdo do Curso
ML Introduction with scikit-learn
ML Introduction with scikit-learn
Types of Data
Each column(feature) in a training set has a datatype associated with it. Those datatypes can be grouped into Numerical, Categorical, and Date and(or) Time.
Unfortunately, most ML algorithms only work well with numbers. So we need a way to convert the categorical data and the datetime data to numbers.
Regarding date and time, you can use features like 'year', 'month', etc., based on your task. Those features are numerical values, so there is no problem with them.
Categorical data is a little more challenging to deal with. Let's look at the types of categorical data.
Types of categorical data
- Ordinal data is a type of categorical data in which categories follow a natural order.
For example, level of education (from elementary school to Ph.D.) or rates (from very bad to very well), etc; - Nominal data is a type of categorical data that follows no natural order.
For example, name, gender, country of origin, etc.
As you will see in later chapters, converting ordinal and nominal data types to numerical values is different, that's why we need to separate them.
Note
There are better ways to convert dates to numerical values that are out of the scope of this introductory course.
For example, if we just use the 'month' feature, it will not consider that 12th month is actually closer to 1st than to 9th.
Obrigado pelo seu feedback!