Write-N-Refactor Archived

#4 ~ Machine Learning: Metal Brain 1 - Feature Selection and Data Structure

by Bobby Smith - Written on February 20, 2026 (originally published on July 25, 2017)


Happy Friday, everyone!

Hope everyone is having a great week. I know I have been. It's been a busy two months, but I'm glad to be back and sharing more insights with you all.

On this week's post, we'll be looking at my first foray into looking at machine learning and creating a post that is both informative and accessible.

I'm very impressed by my format at the time. I do think it would have been beneficial to include more visual aids to help explain the concepts. But, I'm glad I included my source so readers could explore further on their own.Lastly, I do feel like I've gotten better with titles. This title is super long.

Hope you enjoy and have a good weekend.




Machine Learning: Metal Brain 1 - Feature Selection and Data Structure

July 25, 2017 ~ COMBLY7

Welcome to the introduction to machine learning through my eyes and what I have found throughout my exploration of it. This first post will be a short one but it will deal with one of the most important if not the most important concept of machine learning. Feature selection and data structure.

What defines an object?

This one can be very complex, but lets just deal with it in broad sense then we can get more descriptive. Two major factors would be what it looks like and what it is called. What it looks like allows us to know what it is we are looking at. In machine learning this would be called the features of an object. If what we are looking at has a name it allows us to easily transfer this information to something else or someone else. In machine learning this is called the label.

What are features?

How do you determine what something is? You look at how this object is appearing via your senses. If I handed you an apple, how you would describe to me what an apple is? You would probably tell me that the skin was smooth, the color of the skin was red, it was firm to the touch, it was round yet it bulges from the top and the bottom, and it may even have a stem sticking out of the top. If you were to describe some sort of system or algorithm to determine whether an object was an apple you would probably look at all of these and probably more. These are what you would consider features.

Features are the life blood of machine learning without features there would be nothing to learn from in any system. And it is great to have large amounts of features that allow us to differentiate between objects, but we need to make sure that what features we use are good features. If there are too many features that may be shared by all objects within a system, why would we even need them if the computer will check yes on all of these. Determine which ones are important for your system and which are not and cull ones that are not needed. If you are constructing a feature set for, let's say, an Iris species you would want to use sepal length, sepal width, petal length, and petal width. These are the most important features to use to distinguish between different types.

"How would we use features within our program?" you may be asking yourself. How would say set a feature to be round so the computer would know? Well you need to get it into some form of numerical value. Say if you are dealing with a bumpy, a smooth, and a sharp shape. How I would put these into the object would be to construct a skin type value slot. I would then assign 0 for bumpy, 1 for smooth, and 2 for sharp. You can then feed them into your machine learning system. You must do this for all features. Now that we know a bit about features lets move onto labels.

What are labels?

Everything must have a name to define it. that is what labels are in machine learning. A name that can be given to the machine for it to learn what the features you gave it is describing or this name may be output based upon what it thinks some testing set may be.

One thing you should do, as you did with features, is put them into a numerical value. Some people may store their features as strings, but it is more useful to have them as numerical constants. Say you are working with Iris flowers. Each family you work with would be given a different value. Labels, as you see, are fairly simple, but are still very important.

How do handle this data?

To handle this data within a machine learning system you would want to have an object's features and labels easily handled together within a system. Personally I usually construct a float array for an object that holds all of its features then a simple integer that holds the object's label. This is one way to do it, but it is all up to the programmer. It is your system take these ideas and run with them. If you want to learn more about this topic I will be putting a link to a wonderful page that goes even more into detail about all of this and more.

This has been the first part of my machine learning series, Metal Brain. I hope you enjoyed it. It has been interesting writing and researching this so far. If you have any suggestions or comment don't hesitate to leave them below.

Thank you and goodbye until next time.

- Robert Smith


References/Notes

[1] Image Classification: Data-driven Approach, k-Nearest Neighbor, train/val/test splits




A Screenshot of the Original Post

A screenshot of the original post from July 25, 2017.

Screenshot of Machine Learning Metal Brain 1

Click on the screenshot to see the full sized image.