Difference between parameters, features and class in Machine Learning

Viewed 24301

I am a newbie in Machine learning and Natural language processing.

I am always confused between what are those three terms?

From my understanding:

class: The various categories our model output. Given a name of person identify whether he/she is male or female?

Lets say I am using Naive Bayes classifier.

What would be my features and parameters?

Also, what are some of the aliases of the above words which are used interchangeably.

Thank you

6 Answers

I just wanted to add a definition that distinguishes between attributes and features, as these are often used interchangeably, and it may not be correct to do so. I'm quoting 'Hands-On Machine Learning with SciKit-Learn and TensorFlow'.

In Machine Learning an attribute is a data type (e.g., “Mileage”), while a feature has several meanings depending on the context, but generally means an attribute plus its value (e.g., “Mileage = 15,000”). Many people use the words attribute and feature interchangeably, though.

I like the definition in “Hands-on Machine Learning with Scikit and Tensorflow” (by Aurelian Geron) where ATTRIBUTE = DATA TYPE (e.g., Mileage) FEATURE = DATA TYPE + VALUE (e.g., Mileage = 50000)

Regarding FEATURE versus PARAMETER, based on the definition in Geron’s book I used to interpret FEATURE as the variable and the PARAMETER as the weight or coefficient, such as in the model below Y = a + b*X

X is the FEATURE a, b are the PARAMETERS

However, in some publications I have seen the following interpretation: X is the PARAMETER a, b are the WEIGHTS

So, lately, I’ve begun to use the following definitions:

FEATURE = variables of the RAW DATA (e.g., all columns in the spreadsheet)

PARAMETER = variables used in the MODEL (ie after selecting the features that will be in the model)

WEIGHT = coefficients of the parameters of the MODEL

Thoughts ?

Let's see if this works :)

Imagine you have an excel spreadsheet which has data about a specific product and the presence of 7 atomic elements in them.

[product] [calcium] [magnesium] [zinc] [iron] [potassium] [nitrogen] [carbon]

Features - are each column except the product because all the other columns are independent, coexisting, has measurable impact on the target i.e. the product. You can even choose to combine some of them to be called Essential Elements i.e. dimension reduction to make it more appropriate for analysis. The term "Dimension Reduction" is strictly for explanation here, not be confused by the PCA technique in unsupervised learning. Features are relevant for supervised learning technique.

Now, imagine a cool machine that has the capability of looking at the data above and inferring what the product is.

parameters are like levers and stopcocks to the specific to that machine which you can juggle with, and make sure that if the machine says "It's soap scum" it really/truly is. If you you think about yourself doing the dart board practice, what are the things you'd do to yourself to get closer to the bullseye (balance bias/variance)?

Hyperparameters are like parameters, BUT external to this machine we're talking about. What if the machine parts/mechanical elements are made of a specific compound e.g. carbon fibre or magnesium poly-alloy? How would this change what the machine can/can't do better?

I suppose it's an oversimplification of what things are, but hopefully acceptable?

Related