スキップしてメイン コンテンツに移動

投稿

Understanding k-Nearest Neighbors from Scratch

 In the world of data analysis, k-Nearest Neighbors (kNN) has a reputation for being easy to try but surprisingly deep. It has very few difficult parameters and is intuitively easy to understand, but there are unexpected tricks to mastering it in practice. 1. What is k-Nearest Neighbors? For a given unknown sample, kNN finds the k nearest points (neighbors) within the learning data space. It then uses a simple method – majority voting of the labels (for classification) or the average of the values (for regression) – to predict the answer. You can switch between Euclidean distance, Manhattan distance, cosine similarity, and others depending on the characteristics of the problem. - Too Small a k It becomes sensitive to noise and prone to overfitting (e.g., k=1 is the most unstable). - Too Large a k It creates overly smooth boundaries, risking ignoring fine differences between categories (underfitting). - Empirical Tuning The standard approach is to find the optimal k using cross-vali...

Understanding Logistic Regression from Scratch

 Logistic regression is one of the most popular methods at the intersection of statistics and machine learning. Despite its name including “regression”, it’s actually a classification model that predicts “0 or 1”.  With its intuitive probabilistic interpretation and simple implementation, it's widely used in a variety of fields, from business to healthcare and web analytics. 1. What is Logistic Regression? While general linear regression predicts continuous values, logistic regression outputs the probability of an event occurring. By classifying instances as class 1 if the resulting probability exceeds a threshold, and class 0 if it falls below, it solves binary classification problems. Estimation is performed by maximising the log-likelihood function to best explain the correct labels. Mathematically, it involves finding the gradient and iteratively updating, meaning you can complete learning with just a few lines of code using Python’s `scikit-learn` or `statsmodels`. 2. Whe...

Understanding Linear Regression from Scratch

 Linear regression, known as a gateway to statistics and machine learning, is a method for simply capturing the linear relationship between variables.  It’s a fundamental technique for discovering patterns hidden within data and applying them to predictions and decision-making. 1. What is Linear Regression? Linear regression is a method for predicting changes in a target variable (such as sales or temperature) using the relationship with explanatory variables (such as advertising spend or time). The simplest form, “simple linear regression,” uses a single straight line, while “multiple linear regression,” which deals with multiple factors, models the relationship with a high-dimensional “plane” or “hyperplane.” - Example of Simple Linear Regression Represent the relationship between "study time" and "test scores" with a straight line, and estimate how many points the score will increase if study time increases by one hour. - Example of Multiple Linear Regression Pre...

Understanding the Improved Perceptron (The Ancestor of Deep Learning)

 The development of artificial intelligence and machine learning has its roots in the “simple models” of the 1950s and 60s. Among these, the ADALINE (Adaptive Linear Neuron) is a groundbreaking model that underpins today’s deep learning. 1. What is ADALINE? 1.1 Basic Structure and Operating Principle ADALINE is a simple “single-layer neural model” with a straight connection from input to output. It first adjusts multiple input signals with appropriate weight values, sums the results, and passes them to the output layer. Unlike conventional perceptrons, it doesn’t include a non-linear switch internally. Instead, it calculates the output value itself solely through multiplication and addition of inputs and weights. The difference between the resulting predicted value and the correct label is evaluated using a metric called “mean squared error”, and learning progresses to minimise this error. 1.2 Learning Algorithm ADALINE learning is performed using a method called the “Least Mean Sq...

Understanding Perceptrons: A Foundation for Deep Learning

 When discussing the world of Artificial Intelligence (AI), the concept of the “Perceptron” is unavoidable. The Perceptron is a simple model that emerged in the 1950s.  It now forms the bedrock of deep learning and provides a valuable perspective that is useful in all areas of AI research and practice. 1. What is a Perceptron? A simple yet powerful “artificial neuron.” - Model Overview The Perceptron is a “binary classifier” proposed by Frank Rosenblatt in 1958. It mimics the neurons in the human brain, multiplying input signals by weights, summing them, and returning an output of 1 (ON) if the sum exceeds a threshold, or 0 (OFF) if it does not. - Historical Background and Limitations - A Theory That Supported the AI Boom In early AI research, it was groundbreaking that “weights could be automatically adjusted through learning.” - The Pitfalls of the ‘XOR Problem’ However, it was discovered that it could not solve problems that were not linearly separable, leading to a winter ...

Bilder verkleinern! Was ist Bildkompression? Eine gründliche Erklärung zu Anwendungsfällen und Lernvorteilen

Haben Sie jemals mit großen Dateigrößen beim Umgang mit Fotos, die Sie mit Ihrem Smartphone aufgenommen haben, oder mit Bildern auf Websites zu kämpfen gehabt? Dann kommt die "Bildkompression" ins Spiel. Dieser Artikel erklärt die Grundlagen der Bildkompression, ihre Anwendungsfälle und die Vorteile des Lernens. Beherrschen Sie die Bildkompression und genießen Sie ein komfortableres digitales Leben! 1. Was ist Bildkompression? Bildkompression ist der Prozess der Reduzierung der Dateigröße eines Bildes. Konkret wird die Dateigröße durch Reduzierung der Pixelanzahl in einem Bild oder durch Senkung der Bildqualität reduziert. Warum Bilder komprimieren? ・ Effiziente Dateiübertragung: Beim Senden von Bildern per E-Mail oder Chat können große Dateigrößen lange dauern oder das Senden sogar verhindern. ・ Verbesserte Website-Ladegeschwindigkeit: Große Bilddateien auf einer Website können die Seitenladegeschwindigkeit verlangsamen und die Benutzererfahrung beeinträchtigen. ・ Speicherpl...

Gestalten Sie Ihre Fotos ansprechender! Was ist Bildkorrektur?

Haben Sie schon einmal vom Begriff „Bildkorrektur“ gehört? Es handelt sich um eine Technologie, die tatsächlich in verschiedenen Bereichen unseres Lebens eingesetzt wird, beispielsweise in Filtern in Smartphone-Kamera-Apps und in der Retusche durch professionelle Fotografen. Dieser Artikel erklärt die Grundlagen der Bildkorrektur, ihre Anwendungsbereiche und die Vorteile des Erlernens. Beherrschen Sie die Bildkorrektur und steigern Sie die Ausdruckskraft Ihrer Fotos! 1. Was ist Bildkorrektur? Bildkorrektur ist eine Technologie, die die Farbe, Helligkeit, den Kontrast und die Schärfe digitaler Bilder anpasst, um sie besser sichtbar und ansprechender zu gestalten. Einfach ausgedrückt ist es das „Anpassen von Bildern“. Haupttypen der Bildkorrektur: ・ Helligkeits- und Kontrasteinstellung:*・ Passt die allgemeine Helligkeit und den Unterschied zwischen hellen und dunklen Bereichen des Bildes an. ・ Farbtemperatureinstellung:*・ Passt den Farbton des Bildes an, um ihn wärmer (rötlicher) oder kü...