Skip to content
Machine Learning Fundamentals

MLFundamentals

Learn the basic principles of machine learning, understand important algorithms and start your journey into the world of artificial intelligence.

Beginner-Friendly

15 min read

Praxisbeispiele

With Python code

ML Quick Tips

Data quality

80% of ML time goes into data preparation

Start Simple

Start with simple algorithms

Overfitting vermeiden

Use validation split

Python Ecosystem

scikit-learn, pandas, numpy

What is Machine Learning?

Machine Learning (ML) is a subfield of artificial intelligence (AI) in which computers use algorithms to recognize patterns in data and make predictions without being explicitly programmed for every task.

Kernkonzept

Traditional programming: input + program → output

Machine Learning: Input + Output → Programm (Modell)

Practical applications

E-Commerce

  • • Produktempfehlungen
  • • Price optimization
  • • Fraud detection

Healthcare

  • - Diagnostic support
  • • Drug development
  • - Image recognition (X-ray, MRI)

Transport

  • • Autonomes Fahren
  • • Route optimization
  • • Predictive Maintenance

Finanzen

  • • Credit risk assessment
  • • Algorithmic Trading
  • - compliance monitoring

Types of Machine Learning

Supervised Learning

Learning with labeled data

Classification

Regression

Spam detection

House price prediction

Unsupervised Learning

Muster in ungelabelten Daten finden

Clustering

Dimensionality reduction

Customer segmentation

Anomaly detection

Reinforcement Learning

Learning through reward and punishment

Spielstrategien

Robotik

Autonomes Fahren

Trading-Algorithmen

Important algorithms for beginners

Linear Regression

Einsteiger

Model simple linear relationships

Einsatz:Kontinuierliche Vorhersagen
Advantages:Interpretierbar, schnell
Disadvantages:Only linear relationships

Decision Trees

Einsteiger

Entscheidungsregeln in Baumstruktur

Einsatz:Klassifikation & Regression
Advantages:Highly interpretable
Disadvantages:Tends to overfit

Random Forest

Mittel

Ensemble of many decision trees

Einsatz:Robuste Vorhersagen
Advantages:Robust, feature importance
Disadvantages:Weniger interpretierbar

K-Means Clustering

Einsteiger

Daten in k Gruppen clustern

Einsatz:Customer segmentation
Advantages:Simple, schnell
Disadvantages:k must be specified in advance

Practical example: house price prediction

A simple example of how an ML project could be structured:

Python code example

# 1. Import libraries
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error, r2_score

# 2. Load data
data = pd.read_csv('house_prices.csv')

# 3. Define features and target
X = data[['size', 'bedrooms', 'age', 'location_score']]
y = data['price']

# 4. Train/Test Split
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=42
)

# 5. Train model
model = LinearRegression()
model.fit(X_train, y_train)

# 6. Vorhersagen machen
y_pred = model.predict(X_test)

# 7. Evaluate model
rmse = mean_squared_error(y_test, y_pred, squared=False)
r2 = r2_score(y_test, y_pred)

print(f"RMSE: {rmse:.2f}")
print(f"R² Score: {r2:.3f}")

Explanation steps

  1. Steps 1-2: Load the required libraries and data
  2. Step 3: Define features (inputs) and target (prediction)
  3. Step 4: Split the data into training (80%) and test (20%)
  4. Step 5: Train a linear regression model with the training data
  5. Step 6: Make predictions on the test data
  6. Step 7: Evaluate performance with RMSE and R²

Data preparation

Important note

80% of the time in ML projects is spent on data preparation. Data quality = model quality!

Typical steps

  1. 1Data collection: gather relevant data from various sources
  2. 2Data cleaning: remove duplicates, handle missing values
  3. 3Feature Engineering: Select/create relevant properties
  4. 4Data normalization: scaling for better performance
  5. 5Train/Test Split: split the data into training and test sets

Next steps

Practical tools

Python:scikit-learn, pandas, numpy
Online:Google Colab, Kaggle Notebooks
Viz:matplotlib, seaborn, plotly
Datasets:Kaggle, UCI ML Repository

Empfohlenes Vorgehen

  1. 1. Start with simple projects (e.g. Iris classification)
  2. 2. Practice data preparation with real data sets
  3. 3. Experiment with different algorithms
  4. 4. Learn through Kaggle competitions
  5. 5. Build a portfolio with your own projects