Will JavaScript type annotations kill TypeScript?
The creators of Svelte and Turbo 8 both dropped TS recently saying that "it's not worth it".
Yes: If JavaScript gets type annotations then there's no reason for TypeScript to exist.
No: TypeScript remains the best language for structuring large enterprise applications.
TBD: The existing user base and its corpensource owner means that TypeScript isn’t likely to reach EOL without a putting up a fight.
I hope they both die. I mean, if you really need strong types in the browser then you could leverage WASM and use a real programming language.
I don’t know and I don’t care.
Data / Software Development

Get More out of Machine Learning with Data Preprocessing

Preprocessing is a crucial step in machine learning model development. Check out these developer tips to organize and prepare your data sets. 
Mar 21st, 2023 5:00am by
Featued image for: Get More out of Machine Learning with Data Preprocessing
Image via Shutterstock.

Machine learning is used for everything from filtering spam out of email inboxes, to analyzing websites, to personalizing ads and product searches. So when ML developers create new algorithms, they want to know they are producing optimal results. Due to several possible faults, however, machine learning development can often run into problems that delay or detract from effective performance, making results unreliable.

This article will look at the factors that can obstruct an effective machine learning model. Then we will explore how preprocessing can help enhance machine learning and how ML teams can implement preprocessing to improve the results that machine learning models provide.

What Is Preprocessing

Preprocessing is the vital first step in preparing raw data for machine learning models. Raw data usually contains various errors, anomalies, and redundancies. Or it may be presented in a format that the specific machine learning model cannot use. Preprocessing the data ensures the data set is ready to work with a particular machine learning model and its algorithms.

Issues That Can Interfere with ML Models

Countless issues can interfere with a machine learning model’s performance. These problems can range from issues with the data itself to poor choices on the part of the developers.

If the machine learning model attempts to draw from a data set with poor quality or faulty data, the results will be skewed and unreliable. Similarly, if there is simply not enough data to power the process, the results will be unsatisfactory. And if there is inherent bias within the data set that was not identified, then the machine learning results will reflect and magnify those biases, creating faulty results.

In addition, it is up to the machine learning developers to choose the correct algorithm to approach each data set; the wrong choice can result in messy, inefficient processing. Developers should be wary of both overfitting and underfitting, which can dilute and invalidate the machine learning performance, producing inaccurate results with either too much variance or too much bias.

Developers must also choose the best hyperparameters to fit with the given data set; poor hyperparameter tuning is another potential issue that can have detrimental effects on a machine-learning model.

How Preprocessing Can Enhance ML Performance

Setting up an efficient, trustworthy, and reliable machine learning model is a multistep process, regardless of the data set. Taking time to preprocess data thoroughly is an important step in this overall process.

Attentive preprocessing can save developers time in the long run, as it sets up the machine learning model for success, preventing the need to alter results or go back to the beginning stages of establishing the model after the fact.

Developers must carefully choose the specific preprocessing methods to match a particular data set. The depth of preprocessing will also depend on each data set and algorithm; preprocessing is not a one-size-fits-all methodology.

Steps of Data Preprocessing

Assemble the Data Set

The first step of preprocessing data is to assemble the data set. This includes gathering data from all of its disparate locations and consolidating it into one location, such as a data warehouse. This will cut back inefficiency and repetitive results when you enact the algorithms. Assembling the data set can include importing data from different libraries and converting files to the correct format, to make all the data the algorithm needs to process usable and easily accessible.

For example, a video editor who uses machine learning to create smooth transitions between video clips will have better results if they start the process with a clean set of preprocessed video files. Rather than sending large video files one at a time and activating the machine learning algorithm repeatedly, the video editor should assemble all of their clips in one place and sort through the media before deploying the algorithm that will automate parts of the editing process.

Import Libraries and the Data Set

Once you have assembled your data set, you will need to import your core libraries. Most machine learning developers use Python, so be sure to import the essential Python libraries for your model.

After you have imported your relevant Python libraries, you will import the data set itself. This key step includes extracting independent and dependent variables, which will prevent mistakes further down the line.

Assess the Quality of the Data Set

It is normal for raw data sets to have at least some missing or anomalous values; what is essential is to identify and address these gaps before using the algorithm. Look for outliers in the data that can skew the overall results. Check for mismatched data types and mixed-up data values; these data “typos” can lead to unreliable results. Address any missing data during the data cleaning process.

Data Cleaning

In the data cleaning step of preprocessing, you will need to adjust, fix, or delete irrelevant and faulty data from the data set. In this step, you can replace missing data or adjust the data set to compensate for missing values.

This is the most significant part of data preprocessing, because this is where you make sure that your data is trustworthy and reliable.

Reduce Data

If you are working with large quantities of data, then reducing the data to a manageable size will lend itself to efficient algorithmic processing. Not all data in the data set will be relevant for each specific processing task; consolidating and organizing to the most concise relevant package will produce clearer and more efficient results.

Transform Data

In this preprocessing step, you will need to transform the data into appropriate formats for your specific algorithms and models.

Normalizing your data allows you to compare disparate forms on cohesive terms, while feature selection lends itself to algorithms in which certain types of data are considered more significant and are highlighted accordingly. This makes your data results easier to interpret, with consistent standards of measurement.

The Benefits of Preprocessing

Perhaps the most obvious benefit of preprocessing data is that it can improve the accuracy of the machine-learning model. By cleaning and organizing the data to ensure that it is trustworthy, the machine learning model algorithm will be able to produce more robust, accurate results without drawing from faulty, irrelevant, or biased data to begin with.

Starting with preprocessed data can reduce the likelihood of both overfitting and underfitting. Since this essential initial step of the process roots out and eliminates redundant and irrelevant data, the machine learning model will be able to incorporate new information accurately.

Preprocessing also enhances the model’s efficiency. Preprocessing takes time, but it can lead to shorter overall training times for the model itself. This means that developers can save both time and resources by cutting down on the amount of insignificant data the algorithm is trained to process.

Preprocessing for Clear, Efficient Machine Learning Models

Preprocessing is a crucial step in machine learning model development. Developers should devote ample time and resources to organizing and preparing their data sets attentively before introducing the data to the machine learning algorithms.

Starting with a clean, preprocessed data set will allow the algorithm to provide clearer results that are easier to interpret. This saves time for analysts and resources at the analysis stage; and allows developers to more easily understand the machine learning process and how to improve the algorithms for future data analyses.

Group Created with Sketch.
TNS owner Insight Partners is an investor in: Pragma.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.