{"id":891,"date":"2023-03-14T09:02:00","date_gmt":"2023-03-14T08:02:00","guid":{"rendered":"https:\/\/itsonix.laolaweb.com\/?p=891"},"modified":"2026-05-18T09:09:28","modified_gmt":"2026-05-18T07:09:28","slug":"machine-learning-a-brief-introduction-using-python","status":"publish","type":"post","link":"https:\/\/itsonix.eu\/en\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/","title":{"rendered":"Machine Learning\u2014A Brief Introduction Using Python"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Sie hat ihren Ursprung in der Antike und ihr Gedanke treibt bis heute revolution\u00e4re Erfindungen an. Was lange Zeit nur in Mythen und fiktionalen Werken anzutreffen war, hat seit einigen Jahrzehnten einen festen Platz an vorderster Front der Wissenschaft. In dystopischen Weltentw\u00fcrfen rei\u00dft sie die gesamte Kontrolle \u00fcber den Planeten an sich und dennoch ist sie in der Lage, unser Leben in nahezu allen Bereichen zu optimieren: k\u00fcnstliche Intelligenz.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In unserem aktuellen Blogbeitrag untersuchen unsere Xperten eine besondere Auspr\u00e4gung dieses Teilgebiets innerhalb der Informatik: Machine Learning. Diese Subdisziplin befasst sich mit der Lernf\u00e4higkeit von Maschinen \u2013 der artifiziellen Hervorbringung von Wissen. Anhand eines kompakten Beispiels mit Python zeigen unsere Xperten, wie ein Modell mithilfe von Machine-Learning-Algorithmen Zahlen erkennen kann. Zu Beginn m\u00f6chten wir jedoch einige Begriffe und Konzepte zum besseren Verst\u00e4ndnis kl\u00e4ren.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">K\u00fcnstliche Intelligenz<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Unter k\u00fcnstlicher Intelligenz werden alle Verfahren verstanden, die einen Computeralgorithmus nutzen, um ein Modell zu trainieren. Das Wort k\u00fcnstlich legt erst einmal fest, dass es sich dabei um etwas handelt, das nicht in der Natur vorkommt. Intelligenz wird hier als die F\u00e4higkeit, Handlungen auf Zielerreichung auszurichten definiert \u2013 Aufgaben, bei denen Maschinen menschen\u00e4hnlich arbeiten sollen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Das trainierte Modell kann zur Umweltwahrnehmung und Entscheidungsfindung angewandt werden. Hierbei ist es notwendig, dass Eingangsdaten f\u00fcr dieses Modell vorhanden sind. Die k\u00fcnstliche Intelligenz ist daher auf eine realit\u00e4tsnahe Darstellung von bspw. Sensordaten oder anderen Eingangsgr\u00f6\u00dfen angewiesen. Die Methode zum Trainieren dieser Modelle nennt sich Machine Learning.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Machine Learning<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Mithilfe von Machine-Learning-Algorithmen sind Maschinen in der Lage, aus Daten zu lernen und Muster zu erkennen. Auf dieser Basis k\u00f6nnen sie menschen\u00e4hnliche Handlungen wie bspw. Vorhersagen oder Entscheidungen treffen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Um ein Modell zu trainieren, kommen im Machine Learning vordefinierte Features zum Einsatz, die vom Modell ber\u00fccksichtigt werden. Bei der Auswahl dieser Features hat der Mensch durch vielseitige Vorverarbeitungen im Erstellungsprozess einen signifikanten Einfluss. Dieser Aktionsradius erleichtert eine Feature Extraction am fertigen Modell.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Die Feature Extraction bezeichnet eine Methode im Machine Learning, mit der die aussagekr\u00e4ftigsten Eingangsgr\u00f6\u00dfen ermittelt werden k\u00f6nnen. So kann bspw. bei Bildklassifizierungsaufgaben ausgegeben werden, welche Pixel am wahrscheinlichsten welchem Objekt zuzuordnen sind.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Geht man im Machine Learning eine Stufe weiter bzw. tiefer, gelangt man in die Gefilde des Deep Learning. Anders als beim Machine Learning konzentriert sich dieser Teilbereich auf die versteckten Ebenen, die Hidden Layer, eines Modells. Zum Trainieren des Modells werden die Features hierbei nicht mehr vom Menschen festgelegt. Da hier nun einige Arbeitsschritte vor dem Training wegfallen, ist die Kontrolle \u00fcber das Ergebnis geringer als bei traditionellen Machine-Learning-Methoden. Die ersten Trainingsschritte \u2013 das Warm-up \u2013 sind ein zuf\u00e4lliges Zusammenw\u00fcrfeln der Features. Mithilfe der Hidden Layer entscheidet das Modell dann w\u00e4hrend des Trainingsprozesses, welche Features die aussagekr\u00e4ftigsten sind.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Da diese spezielle Form der k\u00fcnstlichen Intelligenz enorme Mengen an Trainingsdaten sowie Rechenleistung ben\u00f6tigt und somit auch einen hohen Kostenaufwand darstellt, eignet sich Deep Learning nicht f\u00fcr den breiten Anwendungsfall. K\u00f6nnte beim Machine Learning noch alles mit der Hand nachgerechnet werden, ist dies bei Deep Learning nicht mehr m\u00f6glich. Die Komplexit\u00e4t der Berechnungen ist f\u00fcr den Menschen im Einzelfall nicht mehr nachvollziehbar.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Unabh\u00e4ngig davon, ob es sich nun um Machine Learning oder Deep Learning handelt, den Kern beider bilden sogenannte k\u00fcnstliche neuronale Netze.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">K\u00fcnstliche Neuronale Netze<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Der Aufbau und die Funktion von k\u00fcnstlichen neuronalen Netzen sind dem menschlichen Gehirn nachempfunden. Sie eignen sich hervorragend f\u00fcr die Automatisierung von Aufgaben, um Muster oder Zusammenh\u00e4nge in gro\u00dfen Datenmengen zu erkennen. Das Fundament eines jeden k\u00fcnstlichen neuronalen Netzes wird von vielen untereinander vernetzten Recheneinheiten gebildet \u2013 den k\u00fcnstlichen Neuronen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"445\" src=\"https:\/\/test.itsonix.eu\/wp-content\/uploads\/2026\/05\/Funktionsweise-1024x445.jpg\" alt=\"\" class=\"wp-image-899\" title=\"Funktionsweise\" srcset=\"https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/Funktionsweise-1024x445.jpg 1024w, https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/Funktionsweise-300x130.jpg 300w, https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/Funktionsweise-768x334.jpg 768w, https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/Funktionsweise-1536x668.jpg 1536w, https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/Funktionsweise-2048x890.jpg 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Ein k\u00fcnstliches Neuron setzt sich aus mehreren Eing\u00e4ngen, die jeweils ein Signal empfangen, und einem Ausgang, der das Signal ausgibt, zusammen. Jedem Eingangswert wird eine sogenannte Wichtung zugeordnet, die den Beitrag dieses Eingangs zum Gesamtausgang des Neurons reguliert. Anschlie\u00dfend werden die gewichteten Eingangswerte addiert und an die Aktivierungsfunktion zur Ausgabe \u00fcbermittelt.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In einem k\u00fcnstlichen neuronalen Netz ist jedes dieser k\u00fcnstlichen Neuronen miteinander verbunden und beim Deep Learning sogar \u00fcber mehrere Schichten (Layer) hinweg.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Leistungskennzahlen<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ein wichtiges Hilfsmittel, um die Leistung von Machine-Learning-Modellen zu ermitteln, sind Leistungskennzahlen. Es handelt sich dabei um Evaluationsmetriken und je nach Anwendungsfall eignet sich die eine besser als die andere. Im Folgenden m\u00f6chten wir nun einen kurzen \u00dcberblick \u00fcber die gel\u00e4ufigsten dieser Operationen geben.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Wert<\/th><th class=\"has-text-align-left\" data-align=\"left\">Symobl oder Formel<\/th><th class=\"has-text-align-left\" data-align=\"left\">Definition<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\">True Positive<\/td><td class=\"has-text-align-left\" data-align=\"left\"><em>tp<\/em><\/td><td class=\"has-text-align-left\" data-align=\"left\">Richtig positiv klassifizierte Daten<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">True Negative<\/td><td class=\"has-text-align-left\" data-align=\"left\"><em>tn<\/em><\/td><td class=\"has-text-align-left\" data-align=\"left\">Richtig negative klassifizierte Daten<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">False Positive<\/td><td class=\"has-text-align-left\" data-align=\"left\"><em>fp<\/em><\/td><td class=\"has-text-align-left\" data-align=\"left\">Negative Daten positiv klassifiziert<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">False Negative<\/td><td class=\"has-text-align-left\" data-align=\"left\"><em>fn<\/em><\/td><td class=\"has-text-align-left\" data-align=\"left\">Daten negativ klassifiziert<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Genauigkeit (Accuracy): Die Genauigkeit ermittelt, wie oft das Modell richtig vorhersagt. Sie wird berechnet, indem die Anzahl der korrekten Vorhersagen durch die Gesamtzahl der Vorhersagen geteilt wird.<br><math><mfrac bevelled=\"true\"><mi>tp + tn<\/mi><mi>tp + tn + fp + fn<\/mi><\/mfrac><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pr\u00e4zision (Precision): Die Pr\u00e4zision ermittelt, wie oft das Modell richtig positive Vorhersagen macht. Sie wird berechnet, indem die Anzahl der korrekten positiven Vorhersagen durch die Gesamtzahl der positiven Vorhersagen geteilt wird.<br><math><mfrac bevelled=\"true\"><mi>tp<\/mi><mi>tp + fp<\/mi><\/mfrac><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Recall (Sensitivity): Mit dem Recall wird ermittelt, wie oft das Modell alle tats\u00e4chlichen positiven F\u00e4lle identifiziert hat. Er wird berechnet, indem die Anzahl der korrekt identifizierten positiven F\u00e4lle durch die Gesamtzahl der tats\u00e4chlichen positiven F\u00e4lle geteilt wird.<br><math><mfrac bevelled=\"true\"><mi>tp<\/mi><mi>tp + fn<\/mi><\/mfrac><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">F1-Score: Der F1-Score ist das harmonische Mittel aus Pr\u00e4zision und Recall. Hierdurch ist der F1-Score weniger anf\u00e4llig auf irref\u00fchrende Genauigkeitswerte und hat sich als Standard f\u00fcr die Genauigkeitsbewertung etabliert.<br><math><mrow><mn>2<\/mn><mo>*<\/mo><mfrac><mrow><mi>precision<\/mi><mo>*<\/mo><mi>recall<\/mi><\/mrow><mrow><mi>precision<\/mi><mo>+<\/mo><mi>recall<\/mi><\/mrow><\/mfrac><\/mrow><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anhand dieser Metriken l\u00e4sst sich ganz gut erkennen, ob ein System zu stark auf einer Seite ausschl\u00e4gt. Um das gew\u00fcnschte Ergebnis zu erreichen, k\u00f6nnen die Parameter gegebenenfalls angepasst werden, indem am Ende bspw. ein neuer Bias hinzugef\u00fcgt wird.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Hardwareanforderungen<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Grunds\u00e4tzlich reichen, um Machine Learning zu betreiben, nahezu alle g\u00e4ngigen PCs oder Laptops. Selbst f\u00fcr komplexe Anwendungen ist die Rechenleistung dieser Ger\u00e4te ausreichend. Bspw. k\u00f6nnen auch Einplatinencomputer wie bspw. der Raspberry Pi zum Einstieg ins Machine Learning genutzt werden. Beim Deep Learning gestalten sich die Hardwareanforderungen allerdings schon erheblich schwieriger. Aufgrund der k\u00fcnstlichen neuronalen Netze mit mehreren Schichten sowie den komplexen Berechnungen kann es ganze Rechenzentren zur Durchf\u00fchrung ben\u00f6tigen. Je gr\u00f6\u00dfer und komplexer das Modell ist, desto schneller steigen auch die Anforderungen an die ben\u00f6tigte Hardware.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Anwendung<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Da nun die grundlegenden Begriffe und Konzepte gekl\u00e4rt sind, m\u00f6chten wir nun in unser Praxisbeispiel mit Python gehen. Hierf\u00fcr bearbeiten wir eine pixelbasierte Zahlenerkennung mit einer logistischen Regression. Es handelt sich dabei um eine mathematische Funktion zur Abbildung des zu trainierenden Modells.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Zum Lernen eignet sich bspw. Jupyter Notebooks (.ipynb) bestens, da der Code in einzeln ausf\u00fchrbare Bl\u00f6cke heruntergebrochen werden kann. Jupyter ist als Standalone-Version, aber auch als Plug-in f\u00fcr beliebte Code-Editoren verf\u00fcgbar.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anfangs m\u00fcssen erst einmal die ben\u00f6tigten Bibliotheken in Python importiert werden.<\/p>\n\n\n<div\n    class=\"align wp-block-bch-code-highlight\"    id=\"bhcCodeHighlight-1\"\n    data-attributes='{&quot;cId&quot;:&quot;714fafc0-0&quot;,&quot;headerPart&quot;:true,&quot;align&quot;:&quot;&quot;,&quot;language&quot;:&quot;javascript&quot;,&quot;lineNumbers&quot;:true,&quot;copyBtnOption&quot;:&quot;Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;headingTitleTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;,&quot;textTransform&quot;:&quot;uppercase&quot;},&quot;codeTypo&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:15,&quot;mobile&quot;:14},&quot;clipBoard&quot;:true,&quot;wordWrap&quot;:true,&quot;width&quot;:{&quot;desktop&quot;:&quot;100%&quot;,&quot;tablet&quot;:&quot;100%&quot;,&quot;mobile&quot;:&quot;100%&quot;},&quot;height&quot;:{&quot;desktop&quot;:&quot;0px&quot;,&quot;tablet&quot;:&quot;0px&quot;,&quot;mobile&quot;:&quot;0px&quot;},&quot;padding&quot;:{&quot;top&quot;:&quot;0px&quot;,&quot;right&quot;:&quot;0px&quot;,&quot;bottom&quot;:&quot;0px&quot;,&quot;left&quot;:&quot;0px&quot;},&quot;background&quot;:{&quot;color&quot;:&quot;#d3cfcf42&quot;},&quot;headerBg&quot;:{&quot;color&quot;:&quot;#2f446e&quot;},&quot;headerTextColor&quot;:{&quot;color&quot;:&quot;#ffff&quot;},&quot;headerThemeOpt&quot;:&quot;one&quot;,&quot;layout&quot;:{&quot;align&quot;:&quot;left&quot;},&quot;border&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;},&quot;shadow&quot;:[{&quot;hOffset&quot;:&quot;0px&quot;,&quot;vOffset&quot;:&quot;0px&quot;,&quot;blur&quot;:&quot;0px&quot;,&quot;spread&quot;:&quot;0px&quot;,&quot;color&quot;:&quot;rgba(0, 0, 0, 0.16)&quot;,&quot;isInset&quot;:false}],&quot;alignment&quot;:&quot;center&quot;,&quot;copyTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:13,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;clipBoardColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#00000024&quot;},&quot;copyIconSize&quot;:{&quot;desktop&quot;:24,&quot;tablet&quot;:20,&quot;mobile&quot;:18},&quot;copyBtnPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;headerPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;14px&quot;,&quot;left&quot;:&quot;14px&quot;,&quot;bottom&quot;:&quot;14px&quot;,&quot;right&quot;:&quot;14px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;12px&quot;,&quot;left&quot;:&quot;12px&quot;,&quot;bottom&quot;:&quot;12px&quot;,&quot;right&quot;:&quot;12px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;10px&quot;,&quot;left&quot;:&quot;10px&quot;,&quot;bottom&quot;:&quot;10px&quot;,&quot;right&quot;:&quot;10px&quot;}},&quot;copyBtnPosition&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;}},&quot;codeBg&quot;:{&quot;color&quot;:&quot;&quot;},&quot;outputOption&quot;:false,&quot;outputText&quot;:&quot;Hello Word !&quot;,&quot;outputColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#2F446E&quot;},&quot;outputTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:21,&quot;tablet&quot;:17,&quot;mobile&quot;:13},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;outputPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;8px&quot;,&quot;left&quot;:&quot;8px&quot;,&quot;bottom&quot;:&quot;8px&quot;,&quot;right&quot;:&quot;8px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;7px&quot;,&quot;left&quot;:&quot;7px&quot;,&quot;bottom&quot;:&quot;7px&quot;,&quot;right&quot;:&quot;7px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;5px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;outputBorder&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;,&quot;radius&quot;:&quot;7px&quot;},&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true}}'\n>\n    <pre class=\"bchCodeData\" style=\"display:none;\">&quot;import numpy as np\\nimport sklearn\\nimport matplotlib.pyplot as plt\\nimport pandas as pd\\n%matplotlib inline&quot;<\/pre>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Der MNIST-Datensatz des National Institute of Standards and Technology ist frei verf\u00fcgbar und beinhaltet eine Vielzahl von Trainings- und Testdaten. Dieser kann mit folgendem Code heruntergeladen und in Python eingelesen werden:<\/p>\n\n\n<div\n    class=\"align wp-block-bch-code-highlight\"    id=\"bhcCodeHighlight-2\"\n    data-attributes='{&quot;cId&quot;:&quot;257ef6bf-3&quot;,&quot;headerPart&quot;:true,&quot;align&quot;:&quot;&quot;,&quot;language&quot;:&quot;javascript&quot;,&quot;lineNumbers&quot;:true,&quot;copyBtnOption&quot;:&quot;Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;headingTitleTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;,&quot;textTransform&quot;:&quot;uppercase&quot;},&quot;codeTypo&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:15,&quot;mobile&quot;:14},&quot;clipBoard&quot;:true,&quot;wordWrap&quot;:true,&quot;width&quot;:{&quot;desktop&quot;:&quot;100%&quot;,&quot;tablet&quot;:&quot;100%&quot;,&quot;mobile&quot;:&quot;100%&quot;},&quot;height&quot;:{&quot;desktop&quot;:&quot;0px&quot;,&quot;tablet&quot;:&quot;0px&quot;,&quot;mobile&quot;:&quot;0px&quot;},&quot;padding&quot;:{&quot;top&quot;:&quot;0px&quot;,&quot;right&quot;:&quot;0px&quot;,&quot;bottom&quot;:&quot;0px&quot;,&quot;left&quot;:&quot;0px&quot;},&quot;background&quot;:{&quot;color&quot;:&quot;#d3cfcf42&quot;},&quot;headerBg&quot;:{&quot;color&quot;:&quot;#2f446e&quot;},&quot;headerTextColor&quot;:{&quot;color&quot;:&quot;#ffff&quot;},&quot;headerThemeOpt&quot;:&quot;one&quot;,&quot;layout&quot;:{&quot;align&quot;:&quot;left&quot;},&quot;border&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;},&quot;shadow&quot;:[{&quot;hOffset&quot;:&quot;0px&quot;,&quot;vOffset&quot;:&quot;0px&quot;,&quot;blur&quot;:&quot;0px&quot;,&quot;spread&quot;:&quot;0px&quot;,&quot;color&quot;:&quot;rgba(0, 0, 0, 0.16)&quot;,&quot;isInset&quot;:false}],&quot;alignment&quot;:&quot;center&quot;,&quot;copyTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:13,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;clipBoardColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#00000024&quot;},&quot;copyIconSize&quot;:{&quot;desktop&quot;:24,&quot;tablet&quot;:20,&quot;mobile&quot;:18},&quot;copyBtnPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;headerPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;14px&quot;,&quot;left&quot;:&quot;14px&quot;,&quot;bottom&quot;:&quot;14px&quot;,&quot;right&quot;:&quot;14px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;12px&quot;,&quot;left&quot;:&quot;12px&quot;,&quot;bottom&quot;:&quot;12px&quot;,&quot;right&quot;:&quot;12px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;10px&quot;,&quot;left&quot;:&quot;10px&quot;,&quot;bottom&quot;:&quot;10px&quot;,&quot;right&quot;:&quot;10px&quot;}},&quot;copyBtnPosition&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;}},&quot;codeBg&quot;:{&quot;color&quot;:&quot;&quot;},&quot;outputOption&quot;:false,&quot;outputText&quot;:&quot;Hello Word !&quot;,&quot;outputColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#2F446E&quot;},&quot;outputTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:21,&quot;tablet&quot;:17,&quot;mobile&quot;:13},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;outputPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;8px&quot;,&quot;left&quot;:&quot;8px&quot;,&quot;bottom&quot;:&quot;8px&quot;,&quot;right&quot;:&quot;8px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;7px&quot;,&quot;left&quot;:&quot;7px&quot;,&quot;bottom&quot;:&quot;7px&quot;,&quot;right&quot;:&quot;7px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;5px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;outputBorder&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;,&quot;radius&quot;:&quot;7px&quot;},&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true}}'\n>\n    <pre class=\"bchCodeData\" style=\"display:none;\">&quot;from six.moves import urllib\\nfrom scipy.io import loadmat\\nmnist_url = \\&quot;https:\\\/\\\/github.com\\\/amplab\\\/datascience-sp14\\\/raw\\\/master\\\/lab7\\\/mldata\\\/mnist-original.mat\\&quot;\\nmnist_path = \\&quot;.\\\/mnist-original2.mat\\&quot;\\nresponse = urllib.request.urlopen(mnist_url)\\nwith open(mnist_path, \\&quot;wb\\&quot;) as f:\\n    content = response.read()\\n    f.write(content)\\nmnist_raw = loadmat(mnist_path)\\nmnist = {\\n    \\&quot;data\\&quot;: mnist_raw[\\&quot;data\\&quot;].T,\\n    \\&quot;target\\&quot;: mnist_raw[\\&quot;label\\&quot;][0],\\n    \\&quot;COL_NAMES\\&quot;: [\\&quot;label\\&quot;, \\&quot;data\\&quot;],\\n    \\&quot;DESCR\\&quot;: \\&quot;mldata.org dataset: mnist-original\\&quot;,\\n}&quot;<\/pre>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Die nun deklarierte &#8222;mnist&#8220;-Variable muss noch in Trainings- und Testdaten aufgeteilt werden. F\u00fcr unser Beispiel verwenden wir 60.000 Trainings- und 10.000 Testdaten.<\/p>\n\n\n<div\n    class=\"align wp-block-bch-code-highlight\"    id=\"bhcCodeHighlight-3\"\n    data-attributes='{&quot;cId&quot;:&quot;33005d5e-c&quot;,&quot;headerPart&quot;:true,&quot;align&quot;:&quot;&quot;,&quot;language&quot;:&quot;javascript&quot;,&quot;lineNumbers&quot;:true,&quot;copyBtnOption&quot;:&quot;Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;headingTitleTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;,&quot;textTransform&quot;:&quot;uppercase&quot;},&quot;codeTypo&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:15,&quot;mobile&quot;:14},&quot;clipBoard&quot;:true,&quot;wordWrap&quot;:true,&quot;width&quot;:{&quot;desktop&quot;:&quot;100%&quot;,&quot;tablet&quot;:&quot;100%&quot;,&quot;mobile&quot;:&quot;100%&quot;},&quot;height&quot;:{&quot;desktop&quot;:&quot;0px&quot;,&quot;tablet&quot;:&quot;0px&quot;,&quot;mobile&quot;:&quot;0px&quot;},&quot;padding&quot;:{&quot;top&quot;:&quot;0px&quot;,&quot;right&quot;:&quot;0px&quot;,&quot;bottom&quot;:&quot;0px&quot;,&quot;left&quot;:&quot;0px&quot;},&quot;background&quot;:{&quot;color&quot;:&quot;#d3cfcf42&quot;},&quot;headerBg&quot;:{&quot;color&quot;:&quot;#2f446e&quot;},&quot;headerTextColor&quot;:{&quot;color&quot;:&quot;#ffff&quot;},&quot;headerThemeOpt&quot;:&quot;one&quot;,&quot;layout&quot;:{&quot;align&quot;:&quot;left&quot;},&quot;border&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;},&quot;shadow&quot;:[{&quot;hOffset&quot;:&quot;0px&quot;,&quot;vOffset&quot;:&quot;0px&quot;,&quot;blur&quot;:&quot;0px&quot;,&quot;spread&quot;:&quot;0px&quot;,&quot;color&quot;:&quot;rgba(0, 0, 0, 0.16)&quot;,&quot;isInset&quot;:false}],&quot;alignment&quot;:&quot;center&quot;,&quot;copyTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:13,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;clipBoardColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#00000024&quot;},&quot;copyIconSize&quot;:{&quot;desktop&quot;:24,&quot;tablet&quot;:20,&quot;mobile&quot;:18},&quot;copyBtnPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;headerPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;14px&quot;,&quot;left&quot;:&quot;14px&quot;,&quot;bottom&quot;:&quot;14px&quot;,&quot;right&quot;:&quot;14px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;12px&quot;,&quot;left&quot;:&quot;12px&quot;,&quot;bottom&quot;:&quot;12px&quot;,&quot;right&quot;:&quot;12px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;10px&quot;,&quot;left&quot;:&quot;10px&quot;,&quot;bottom&quot;:&quot;10px&quot;,&quot;right&quot;:&quot;10px&quot;}},&quot;copyBtnPosition&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;}},&quot;codeBg&quot;:{&quot;color&quot;:&quot;&quot;},&quot;outputOption&quot;:false,&quot;outputText&quot;:&quot;Hello Word !&quot;,&quot;outputColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#2F446E&quot;},&quot;outputTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:21,&quot;tablet&quot;:17,&quot;mobile&quot;:13},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;outputPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;8px&quot;,&quot;left&quot;:&quot;8px&quot;,&quot;bottom&quot;:&quot;8px&quot;,&quot;right&quot;:&quot;8px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;7px&quot;,&quot;left&quot;:&quot;7px&quot;,&quot;bottom&quot;:&quot;7px&quot;,&quot;right&quot;:&quot;7px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;5px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;outputBorder&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;,&quot;radius&quot;:&quot;7px&quot;},&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true}}'\n>\n    <pre class=\"bchCodeData\" style=\"display:none;\">&quot;from sklearn.model_selection import train_test_split\\nX_train, X_test, y_train, y_test = train_test_split(mnist[&#039;data&#039;], mnist[&#039;target&#039;],train_size=6\\\/7, test_size=1\\\/7,random_state=101)&quot;<\/pre>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Datenerkundung und Vorverarbeitung<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Die im MNIST-Datensatz enthaltenen Daten sind Bilder mit einer Aufl\u00f6sung von 28&#215;28 Pixeln.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mit dem Befehl <code>plt.imshow(X_test[0].reshape(28,28))<\/code> l\u00e4sst sich das erste Bild im Testdatensatz anzeigen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"251\" height=\"248\" src=\"https:\/\/test.itsonix.eu\/wp-content\/uploads\/2026\/05\/Beispielzahl-MNIST.png\" alt=\"\" class=\"wp-image-898\" title=\"Beispielzahl%20MNIST\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Um das Training des Machine-Learning-Modells zu starten, muss es zun\u00e4chst mit <code>from sklearn.linear_model import LogisticRegression<\/code> importiert und als <code>model=LogisticRegression()<\/code> definiert werden.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Wie oft das Modell durch den Trainingsdatensatz iterieren soll, wird mit <code>model.max_iter=4<\/code> definiert. Die Wahl der Iterationen ist im Machine Learning von gro\u00dfer Bedeutung. Wird ein Modell untertrainiert, kann es m\u00f6glicherweise die zu erkennenden \u201eFeatures\u201c nicht verallgemeinern. Ein \u00fcbertrainierts Modell hingegen ist m\u00f6glicherweise sehr genau, wenn man es gegen den Trainingsdatensatz pr\u00fcft, w\u00fcrde aber bedeutend schlechter gegen neue Testdatens\u00e4tze abschneiden.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Schlie\u00dflich kann mittels <code>model.fit(X=X_train, y=y_train)<\/code> das Training gestartet werden.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Durch die geringe Anzahl der Iterationen, Trainingsdaten und zu verarbeitenden Pixel pro Bild ist dieses Modell innerhalb von wenigen Sekunden vollst\u00e4ndig trainiert. Eine Gegebenheit, die auch der Rechenleistung heutiger Hardware geschuldet ist.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Um die Genauigkeit des Modells bestimmen zu k\u00f6nnen, werden die Genauigkeitswerte ben\u00f6tigt. Diese k\u00f6nnen von sklearn mit folgendem Code berechnet werden:<\/p>\n\n\n<div\n    class=\"align wp-block-bch-code-highlight\"    id=\"bhcCodeHighlight-4\"\n    data-attributes='{&quot;cId&quot;:&quot;5fc986fc-a&quot;,&quot;headerPart&quot;:true,&quot;align&quot;:&quot;&quot;,&quot;language&quot;:&quot;javascript&quot;,&quot;lineNumbers&quot;:true,&quot;copyBtnOption&quot;:&quot;Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;headingTitleTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;,&quot;textTransform&quot;:&quot;uppercase&quot;},&quot;codeTypo&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:15,&quot;mobile&quot;:14},&quot;clipBoard&quot;:true,&quot;wordWrap&quot;:true,&quot;width&quot;:{&quot;desktop&quot;:&quot;100%&quot;,&quot;tablet&quot;:&quot;100%&quot;,&quot;mobile&quot;:&quot;100%&quot;},&quot;height&quot;:{&quot;desktop&quot;:&quot;0px&quot;,&quot;tablet&quot;:&quot;0px&quot;,&quot;mobile&quot;:&quot;0px&quot;},&quot;padding&quot;:{&quot;top&quot;:&quot;0px&quot;,&quot;right&quot;:&quot;0px&quot;,&quot;bottom&quot;:&quot;0px&quot;,&quot;left&quot;:&quot;0px&quot;},&quot;background&quot;:{&quot;color&quot;:&quot;#d3cfcf42&quot;},&quot;headerBg&quot;:{&quot;color&quot;:&quot;#2f446e&quot;},&quot;headerTextColor&quot;:{&quot;color&quot;:&quot;#ffff&quot;},&quot;headerThemeOpt&quot;:&quot;one&quot;,&quot;layout&quot;:{&quot;align&quot;:&quot;left&quot;},&quot;border&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;},&quot;shadow&quot;:[{&quot;hOffset&quot;:&quot;0px&quot;,&quot;vOffset&quot;:&quot;0px&quot;,&quot;blur&quot;:&quot;0px&quot;,&quot;spread&quot;:&quot;0px&quot;,&quot;color&quot;:&quot;rgba(0, 0, 0, 0.16)&quot;,&quot;isInset&quot;:false}],&quot;alignment&quot;:&quot;center&quot;,&quot;copyTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:13,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;clipBoardColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#00000024&quot;},&quot;copyIconSize&quot;:{&quot;desktop&quot;:24,&quot;tablet&quot;:20,&quot;mobile&quot;:18},&quot;copyBtnPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;headerPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;14px&quot;,&quot;left&quot;:&quot;14px&quot;,&quot;bottom&quot;:&quot;14px&quot;,&quot;right&quot;:&quot;14px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;12px&quot;,&quot;left&quot;:&quot;12px&quot;,&quot;bottom&quot;:&quot;12px&quot;,&quot;right&quot;:&quot;12px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;10px&quot;,&quot;left&quot;:&quot;10px&quot;,&quot;bottom&quot;:&quot;10px&quot;,&quot;right&quot;:&quot;10px&quot;}},&quot;copyBtnPosition&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;}},&quot;codeBg&quot;:{&quot;color&quot;:&quot;&quot;},&quot;outputOption&quot;:false,&quot;outputText&quot;:&quot;Hello Word !&quot;,&quot;outputColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#2F446E&quot;},&quot;outputTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:21,&quot;tablet&quot;:17,&quot;mobile&quot;:13},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;outputPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;8px&quot;,&quot;left&quot;:&quot;8px&quot;,&quot;bottom&quot;:&quot;8px&quot;,&quot;right&quot;:&quot;8px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;7px&quot;,&quot;left&quot;:&quot;7px&quot;,&quot;bottom&quot;:&quot;7px&quot;,&quot;right&quot;:&quot;7px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;5px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;outputBorder&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;,&quot;radius&quot;:&quot;7px&quot;},&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true}}'\n>\n    <pre class=\"bchCodeData\" style=\"display:none;\">&quot;from sklearn.metrics import classification_report, confusion_matrix\\ny_train_pred_first = model.predict(X_train)\\ny_pred = model.predict(X_test)\\nplt.matshow(confusion_matrix(y_test, y_pred))\\n\\ny_train_pred = model.predict(X_train)\\ny_test_pred = model.predict(X_test)\\nprint(classification_report(y_test, y_pred))\\n&quot;<\/pre>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Die hierbei entstehende Confusion-Matrix beschreibt, welche Zahlen das Modell korrekt erkennt.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In dieser Grafik ist die 5 wenig ausgepr\u00e4gt sowie mit deutlichen Abweichungen in den Zahlen 3 und 8. Dies bedeutet, dass die 5 besonders schlecht als solche vom Modell erkannt und h\u00e4ufig als 3 oder 8 fehlerkannt wird.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"250\" height=\"258\" src=\"https:\/\/test.itsonix.eu\/wp-content\/uploads\/2026\/05\/Confusion-Matrix.png\" alt=\"\" class=\"wp-image-897\" title=\"Confusion%20Matrix\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Das trainierte Modell<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Mit dem Befehl <code>plt.imshow(model.coef_[8].reshape(28,28))<\/code> k\u00f6nnen die Koeffizienten eines Modells (hier der Zahl 8) veranschaulicht werden. Die hellen, gelben Bereiche stellen dabei jene Pixel dar, die das Modell klar mit der Zahl 8 verbindet. Befindet sich ein Pixel jedoch in einem dunkelblauen Bereich, spricht dies gegen eine Klassifizierung als 8.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">F\u00fcr jede zu erkennende Zahl wird am Ende der Verarbeitungskette am Ausgangsneuron eine Wahrscheinlichkeit f\u00fcr die m\u00f6glichen Zahlen 0 bis 9 ausgegeben. Die Zahl mit der h\u00f6chsten Wahrscheinlichkeit wird am Ende als erkannte Zahl verwendet.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"251\" height=\"248\" src=\"https:\/\/test.itsonix.eu\/wp-content\/uploads\/2026\/05\/Koeffizienten_ML.png\" alt=\"\" class=\"wp-image-896\" title=\"Koeffizienten_ML\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Exkurs Datenvorverarbeitung<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Im Machine Learning ist eine Vorverarbeitung der Daten essenziell, um bessere Ergebnisse zu erzielen. Der MNIST-Datensatz ist bereits von vielen Fehlerquellen bereinigt.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">M\u00f6gliche Vorverarbeitungen im Falle einer Zahlenerkennung sind u. a. das Reduzieren von Helligkeitsinformationen, eine Kantenhervorhebung oder das Neuausrichten der Zahlen zur Bildmitte. Es kann sich durchaus lohnen, diese Methoden auszuprobieren und im Anschluss die Genauigkeitswerte zu vergleichen. Hierf\u00fcr m\u00fcssen lediglich die Werte von <code>X_train<\/code> und <code>X_test<\/code> ersetzt werden.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Informationsreduktion<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Im Fall des MNIST-Datensatzes sind Helligkeitswerte von 0 bis 255 vorhanden (8 Bit). Die Helligkeitswerte k\u00f6nnen mittels <code>X_train.min()<\/code> und <code>X_train.max()<\/code> ermittelt werden. Diese Informationen k\u00f6nnen bspw. auf 1 Bit reduziert werden, indem ein Schwellenwert bestimmt wird, unter welchem alle Werte als 0 und \u00fcber welchem alle Werte als 1 definiert werden.<\/p>\n\n\n<div\n    class=\"align wp-block-bch-code-highlight\"    id=\"bhcCodeHighlight-5\"\n    data-attributes='{&quot;cId&quot;:&quot;a6b34c74-0&quot;,&quot;headerPart&quot;:true,&quot;align&quot;:&quot;&quot;,&quot;language&quot;:&quot;javascript&quot;,&quot;lineNumbers&quot;:true,&quot;copyBtnOption&quot;:&quot;Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;headingTitleTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;,&quot;textTransform&quot;:&quot;uppercase&quot;},&quot;codeTypo&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:15,&quot;mobile&quot;:14},&quot;clipBoard&quot;:true,&quot;wordWrap&quot;:true,&quot;width&quot;:{&quot;desktop&quot;:&quot;100%&quot;,&quot;tablet&quot;:&quot;100%&quot;,&quot;mobile&quot;:&quot;100%&quot;},&quot;height&quot;:{&quot;desktop&quot;:&quot;0px&quot;,&quot;tablet&quot;:&quot;0px&quot;,&quot;mobile&quot;:&quot;0px&quot;},&quot;padding&quot;:{&quot;top&quot;:&quot;0px&quot;,&quot;right&quot;:&quot;0px&quot;,&quot;bottom&quot;:&quot;0px&quot;,&quot;left&quot;:&quot;0px&quot;},&quot;background&quot;:{&quot;color&quot;:&quot;#d3cfcf42&quot;},&quot;headerBg&quot;:{&quot;color&quot;:&quot;#2f446e&quot;},&quot;headerTextColor&quot;:{&quot;color&quot;:&quot;#ffff&quot;},&quot;headerThemeOpt&quot;:&quot;one&quot;,&quot;layout&quot;:{&quot;align&quot;:&quot;left&quot;},&quot;border&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;},&quot;shadow&quot;:[{&quot;hOffset&quot;:&quot;0px&quot;,&quot;vOffset&quot;:&quot;0px&quot;,&quot;blur&quot;:&quot;0px&quot;,&quot;spread&quot;:&quot;0px&quot;,&quot;color&quot;:&quot;rgba(0, 0, 0, 0.16)&quot;,&quot;isInset&quot;:false}],&quot;alignment&quot;:&quot;center&quot;,&quot;copyTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:13,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;clipBoardColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#00000024&quot;},&quot;copyIconSize&quot;:{&quot;desktop&quot;:24,&quot;tablet&quot;:20,&quot;mobile&quot;:18},&quot;copyBtnPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;headerPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;14px&quot;,&quot;left&quot;:&quot;14px&quot;,&quot;bottom&quot;:&quot;14px&quot;,&quot;right&quot;:&quot;14px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;12px&quot;,&quot;left&quot;:&quot;12px&quot;,&quot;bottom&quot;:&quot;12px&quot;,&quot;right&quot;:&quot;12px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;10px&quot;,&quot;left&quot;:&quot;10px&quot;,&quot;bottom&quot;:&quot;10px&quot;,&quot;right&quot;:&quot;10px&quot;}},&quot;copyBtnPosition&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;}},&quot;codeBg&quot;:{&quot;color&quot;:&quot;&quot;},&quot;outputOption&quot;:false,&quot;outputText&quot;:&quot;Hello Word !&quot;,&quot;outputColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#2F446E&quot;},&quot;outputTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:21,&quot;tablet&quot;:17,&quot;mobile&quot;:13},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;outputPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;8px&quot;,&quot;left&quot;:&quot;8px&quot;,&quot;bottom&quot;:&quot;8px&quot;,&quot;right&quot;:&quot;8px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;7px&quot;,&quot;left&quot;:&quot;7px&quot;,&quot;bottom&quot;:&quot;7px&quot;,&quot;right&quot;:&quot;7px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;5px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;outputBorder&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;,&quot;radius&quot;:&quot;7px&quot;},&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true}}'\n>\n    <pre class=\"bchCodeData\" style=\"display:none;\">&quot;from sklearn.preprocessing import minmax_scale, binarize\\nX_train_binarized = minmax_scale(X_train)\\nX_test_binarized = binarize(X_test, threshold=96)&quot;<\/pre>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Mit dieser Methode wurden die Eingangsdaten f\u00fcr das Machine-Learning-Modell um ein 128-faches reduziert. Die Genauigkeit sinkt durch diese Vorverarbeitung jedoch um 1 % im F1-Score. Das Beispiel zeigt deutlich, dass im Machine Learning h\u00e4ufig Modelle f\u00fcr schw\u00e4chere Hardware oder eingeschr\u00e4nkte Daten\u00fcbertragungswege herunterskaliert werden k\u00f6nnen, ohne einen gro\u00dfen Genauigkeitsverlust hinnehmen zu m\u00fcssen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"251\" height=\"248\" src=\"https:\/\/test.itsonix.eu\/wp-content\/uploads\/2026\/05\/Informationsreduktion.png\" alt=\"\" class=\"wp-image-895\" title=\"Informationsreduktion\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Kantenerkennung<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Eine weitere M\u00f6glichkeit der Datenvorverarbeitung ist das Anlegen von Bildern mithilfe von Kantenerkennung. Bildmanipulationen k\u00f6nnen mit der Python Image Library PIL durchgef\u00fchrt werden. Nachdem diese importiert wurde, m\u00fcssen die Pixel der Trainingsdaten als Bilder eingelesen werden. Anschlie\u00dfend kann auf diese eine Kantendetektion angewandt werden. Um die Bilder sp\u00e4ter als Trainingsdaten verwenden zu k\u00f6nnen, m\u00fcssen sie wieder als einzelne Pixel in ein Array geschrieben werden. Dieser Prozess wird mit dem Testdatensatz wiederholt. Das hierbei entstehende Array hat drei Dimensionen, unser Modell kann jedoch mit maximal zwei Dimensionen trainiert werden. Die Dimensionen lassen sich mit <code>np.concatenate<\/code> reduzieren.<\/p>\n\n\n<div\n    class=\"align wp-block-bch-code-highlight\"    id=\"bhcCodeHighlight-6\"\n    data-attributes='{&quot;cId&quot;:&quot;a4ad2caa-b&quot;,&quot;headerPart&quot;:true,&quot;align&quot;:&quot;&quot;,&quot;language&quot;:&quot;javascript&quot;,&quot;lineNumbers&quot;:true,&quot;copyBtnOption&quot;:&quot;Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;headingTitleTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;,&quot;textTransform&quot;:&quot;uppercase&quot;},&quot;codeTypo&quot;:{&quot;desktop&quot;:18,&quot;tablet&quot;:15,&quot;mobile&quot;:14},&quot;clipBoard&quot;:true,&quot;wordWrap&quot;:true,&quot;width&quot;:{&quot;desktop&quot;:&quot;100%&quot;,&quot;tablet&quot;:&quot;100%&quot;,&quot;mobile&quot;:&quot;100%&quot;},&quot;height&quot;:{&quot;desktop&quot;:&quot;0px&quot;,&quot;tablet&quot;:&quot;0px&quot;,&quot;mobile&quot;:&quot;0px&quot;},&quot;padding&quot;:{&quot;top&quot;:&quot;0px&quot;,&quot;right&quot;:&quot;0px&quot;,&quot;bottom&quot;:&quot;0px&quot;,&quot;left&quot;:&quot;0px&quot;},&quot;background&quot;:{&quot;color&quot;:&quot;#d3cfcf42&quot;},&quot;headerBg&quot;:{&quot;color&quot;:&quot;#2f446e&quot;},&quot;headerTextColor&quot;:{&quot;color&quot;:&quot;#ffff&quot;},&quot;headerThemeOpt&quot;:&quot;one&quot;,&quot;layout&quot;:{&quot;align&quot;:&quot;left&quot;},&quot;border&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;},&quot;shadow&quot;:[{&quot;hOffset&quot;:&quot;0px&quot;,&quot;vOffset&quot;:&quot;0px&quot;,&quot;blur&quot;:&quot;0px&quot;,&quot;spread&quot;:&quot;0px&quot;,&quot;color&quot;:&quot;rgba(0, 0, 0, 0.16)&quot;,&quot;isInset&quot;:false}],&quot;alignment&quot;:&quot;center&quot;,&quot;copyTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:13,&quot;tablet&quot;:13,&quot;mobile&quot;:11},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;clipBoardColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#00000024&quot;},&quot;copyIconSize&quot;:{&quot;desktop&quot;:24,&quot;tablet&quot;:20,&quot;mobile&quot;:18},&quot;copyBtnPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;2px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;2px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;headerPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;14px&quot;,&quot;left&quot;:&quot;14px&quot;,&quot;bottom&quot;:&quot;14px&quot;,&quot;right&quot;:&quot;14px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;12px&quot;,&quot;left&quot;:&quot;12px&quot;,&quot;bottom&quot;:&quot;12px&quot;,&quot;right&quot;:&quot;12px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;10px&quot;,&quot;left&quot;:&quot;10px&quot;,&quot;bottom&quot;:&quot;10px&quot;,&quot;right&quot;:&quot;10px&quot;}},&quot;copyBtnPosition&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;right&quot;:&quot;15px&quot;}},&quot;codeBg&quot;:{&quot;color&quot;:&quot;&quot;},&quot;outputOption&quot;:false,&quot;outputText&quot;:&quot;Hello Word !&quot;,&quot;outputColors&quot;:{&quot;color&quot;:&quot;#fff&quot;,&quot;bg&quot;:&quot;#2F446E&quot;},&quot;outputTypo&quot;:{&quot;fontWeight&quot;:400,&quot;fontSize&quot;:{&quot;desktop&quot;:21,&quot;tablet&quot;:17,&quot;mobile&quot;:13},&quot;lineHeight&quot;:1.5,&quot;fontFamily&quot;:&quot;Aleo&quot;},&quot;outputPadding&quot;:{&quot;desktop&quot;:{&quot;top&quot;:&quot;8px&quot;,&quot;left&quot;:&quot;8px&quot;,&quot;bottom&quot;:&quot;8px&quot;,&quot;right&quot;:&quot;8px&quot;},&quot;tablet&quot;:{&quot;top&quot;:&quot;7px&quot;,&quot;left&quot;:&quot;7px&quot;,&quot;bottom&quot;:&quot;7px&quot;,&quot;right&quot;:&quot;7px&quot;},&quot;mobile&quot;:{&quot;top&quot;:&quot;5px&quot;,&quot;left&quot;:&quot;5px&quot;,&quot;bottom&quot;:&quot;5px&quot;,&quot;right&quot;:&quot;5px&quot;}},&quot;outputBorder&quot;:{&quot;color&quot;:&quot;#000&quot;,&quot;style&quot;:&quot;solid&quot;,&quot;width&quot;:&quot;0px&quot;,&quot;radius&quot;:&quot;7px&quot;},&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true}}'\n>\n    <pre class=\"bchCodeData\" style=\"display:none;\">&quot;from PIL import Image, ImageFilter\\nX_train_pil = [Image.fromarray(x.reshape(28, 28)) for x in X_train]\\nX_train_pil_edges = [x.filter(ImageFilter.FIND_EDGES) for x in X_train_pil]\\nX_train_edges = np.array([np.array(x).reshape(-1, 784) for x in X_train_pil_edges])\\nX_test_pil = [Image.fromarray(x.reshape(28, 28)) for x in X_test]\\nX_test_pil_edges = [x.filter(ImageFilter.FIND_EDGES) for x in X_test_pil]\\nX_test_edges = np.array([np.array(x).reshape(-1, 784) for x in X_test_pil_edges])\\nX_data_train = np.concatenate([X_train, X_train_edges[:, 0, :]], axis=1)\\nX_data_test = np.concatenate([X_test, X_test_edges[:, 0, :]], axis=1)&quot;<\/pre>\n<\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"251\" height=\"248\" src=\"https:\/\/test.itsonix.eu\/wp-content\/uploads\/2026\/05\/Kantenerkennung-1.png\" alt=\"\" class=\"wp-image-894\" title=\"Kantenerkennung\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Diese Datenvorverarbeitung bringt mit einem Genauigkeitsverlust von 2 % ebenfalls leider keinen Genauigkeitsgewinn im F1-Score. Die Bilder im MNIST-Datensatz sind bereits gut f\u00fcr die Weiterverarbeitung vorverarbeitet. Unser kleines Experiment zeigt aber, dass zahlreiche Optionen existieren, einem Machine-Learning-Modell Daten zuzuf\u00fchren.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wie wir arbeiten<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Die Einsatzm\u00f6glichkeiten von Machine Learning sind vielf\u00e4ltig. In der Umsetzung von Predictive-Maintenance-Anwendungen leistet Machine Learning einen wertvollen Beitrag in unseren Projekten. Auf einem k\u00fcnstlichen neuronalen Netz basierend, haben wir bspw. eine Anwendung entwickelt, die selbstst\u00e4ndig zu wartende Ger\u00e4te erkennt.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Zukunft werden sich die Branchen, in denen Machine Learning ein wichtiger Faktor sein wird, zunehmend ausweiten, nicht zuletzt durch die kontinuierlich steigende Hardwareleistung. Aufgrund seiner Leichtgewichtigkeit wird Machine Learning auch neben Deep Learning im Vorantreiben des technologischen Wandels noch lange Bestand haben.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sie hat ihren Ursprung in der Antike und ihr Gedanke treibt bis heute revolution\u00e4re Erfindungen an. Was lange Zeit nur in Mythen und fiktionalen Werken anzutreffen war, hat seit einigen Jahrzehnten einen festen Platz an vorderster Front der Wissenschaft. In dystopischen Weltentw\u00fcrfen rei\u00dft sie die gesamte Kontrolle \u00fcber den Planeten an sich und dennoch ist [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":892,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-891","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kuenstliche-intelligenz"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python - IT Sonix - Ihr Partner f\u00fcr individuelle Softwarel\u00f6sungen<\/title>\n<meta name=\"description\" content=\"it Sonix Blog: Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itsonix.eu\/en\/blog\/machine-learning-a-brief-introduction-using-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python - IT Sonix - Ihr Partner f\u00fcr individuelle Softwarel\u00f6sungen\" \/>\n<meta property=\"og:description\" content=\"it Sonix Blog: Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itsonix.eu\/en\/blog\/machine-learning-a-brief-introduction-using-python\/\" \/>\n<meta property=\"og:site_name\" content=\"IT Sonix - Ihr Partner f\u00fcr individuelle Softwarel\u00f6sungen\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-14T08:02:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-18T07:09:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/Blogbeitrag-Header_ML-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1113\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Praktikant\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Praktikant\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/\"},\"author\":{\"name\":\"Praktikant\",\"@id\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/#\\\/schema\\\/person\\\/829813e3a66c2dfbb030cd6647f3caf3\"},\"headline\":\"Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python\",\"datePublished\":\"2023-03-14T08:02:00+00:00\",\"dateModified\":\"2026-05-18T07:09:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/\"},\"wordCount\":1940,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/itsonix.eu\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/Blogbeitrag-Header_ML-scaled.jpg\",\"articleSection\":[\"K\u00fcnstliche Intelligenz\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/\",\"url\":\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/\",\"name\":\"Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python - IT Sonix - Ihr Partner f\u00fcr individuelle Softwarel\u00f6sungen\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/itsonix.eu\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/Blogbeitrag-Header_ML-scaled.jpg\",\"datePublished\":\"2023-03-14T08:02:00+00:00\",\"dateModified\":\"2026-05-18T07:09:28+00:00\",\"description\":\"it Sonix Blog: Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/itsonix.eu\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/Blogbeitrag-Header_ML-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/itsonix.eu\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/Blogbeitrag-Header_ML-scaled.jpg\",\"width\":2560,\"height\":1113,\"caption\":\"Grafische Darstellung eines Roboterkopfs und Katzen.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/itsonix.eu\\\/blog\\\/machine-learning-eine-kurze-einfuehrung-mit-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Start\",\"item\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/#website\",\"url\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/\",\"name\":\"IT Sonix - Ihr Partner f\u00fcr individuelle Softwarel\u00f6sungen\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/#organization\",\"name\":\"IT Sonix - Ihr Partner f\u00fcr individuelle Softwarel\u00f6sungen\",\"url\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/itsonix.eu\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/itsonix_rgb.png\",\"contentUrl\":\"https:\\\/\\\/itsonix.eu\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/itsonix_rgb.png\",\"width\":1755,\"height\":296,\"caption\":\"IT Sonix - Ihr Partner f\u00fcr individuelle Softwarel\u00f6sungen\"},\"image\":{\"@id\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/itsonix.eu\\\/de\\\/#\\\/schema\\\/person\\\/829813e3a66c2dfbb030cd6647f3caf3\",\"name\":\"Praktikant\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dcf1b27e4ed416dc1ee2931ab8eac2c1ed8dc060bed9a0d6bb1f0501c05c25d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dcf1b27e4ed416dc1ee2931ab8eac2c1ed8dc060bed9a0d6bb1f0501c05c25d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dcf1b27e4ed416dc1ee2931ab8eac2c1ed8dc060bed9a0d6bb1f0501c05c25d?s=96&d=mm&r=g\",\"caption\":\"Praktikant\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Machine Learning \u2013 A Brief Introduction Using Python - IT Sonix - Your Partner for Custom Software Solutions","description":"it Sonix Blog: Machine Learning\u2014A Brief Introduction Using Python","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itsonix.eu\/en\/blog\/machine-learning-a-brief-introduction-using-python\/","og_locale":"en_US","og_type":"article","og_title":"Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python - IT Sonix - Ihr Partner f\u00fcr individuelle Softwarel\u00f6sungen","og_description":"it Sonix Blog: Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python","og_url":"https:\/\/itsonix.eu\/en\/blog\/machine-learning-a-brief-introduction-using-python\/","og_site_name":"IT Sonix - Ihr Partner f\u00fcr individuelle Softwarel\u00f6sungen","article_published_time":"2023-03-14T08:02:00+00:00","article_modified_time":"2026-05-18T07:09:28+00:00","og_image":[{"width":2560,"height":1113,"url":"https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/Blogbeitrag-Header_ML-scaled.jpg","type":"image\/jpeg"}],"author":"Praktikant","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Praktikant","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/#article","isPartOf":{"@id":"https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/"},"author":{"name":"Praktikant","@id":"https:\/\/itsonix.eu\/de\/#\/schema\/person\/829813e3a66c2dfbb030cd6647f3caf3"},"headline":"Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python","datePublished":"2023-03-14T08:02:00+00:00","dateModified":"2026-05-18T07:09:28+00:00","mainEntityOfPage":{"@id":"https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/"},"wordCount":1940,"commentCount":0,"publisher":{"@id":"https:\/\/itsonix.eu\/de\/#organization"},"image":{"@id":"https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/#primaryimage"},"thumbnailUrl":"https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/Blogbeitrag-Header_ML-scaled.jpg","articleSection":["K\u00fcnstliche Intelligenz"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/","url":"https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/","name":"Machine Learning \u2013 A Brief Introduction Using Python - IT Sonix - Your Partner for Custom Software Solutions","isPartOf":{"@id":"https:\/\/itsonix.eu\/de\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/#primaryimage"},"image":{"@id":"https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/#primaryimage"},"thumbnailUrl":"https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/Blogbeitrag-Header_ML-scaled.jpg","datePublished":"2023-03-14T08:02:00+00:00","dateModified":"2026-05-18T07:09:28+00:00","description":"it Sonix Blog: Machine Learning\u2014A Brief Introduction Using Python","breadcrumb":{"@id":"https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/#primaryimage","url":"https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/Blogbeitrag-Header_ML-scaled.jpg","contentUrl":"https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/Blogbeitrag-Header_ML-scaled.jpg","width":2560,"height":1113,"caption":"Grafische Darstellung eines Roboterkopfs und Katzen."},{"@type":"BreadcrumbList","@id":"https:\/\/itsonix.eu\/blog\/machine-learning-eine-kurze-einfuehrung-mit-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Start","item":"https:\/\/itsonix.eu\/de\/"},{"@type":"ListItem","position":2,"name":"Machine Learning \u2013 eine kurze Einf\u00fchrung mit Python"}]},{"@type":"WebSite","@id":"https:\/\/itsonix.eu\/de\/#website","url":"https:\/\/itsonix.eu\/de\/","name":"IT Sonix - Your Partner for Custom Software Solutions","description":"","publisher":{"@id":"https:\/\/itsonix.eu\/de\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itsonix.eu\/de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/itsonix.eu\/de\/#organization","name":"IT Sonix - Your Partner for Custom Software Solutions","url":"https:\/\/itsonix.eu\/de\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsonix.eu\/de\/#\/schema\/logo\/image\/","url":"https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/itsonix_rgb.png","contentUrl":"https:\/\/itsonix.eu\/wp-content\/uploads\/2026\/05\/itsonix_rgb.png","width":1755,"height":296,"caption":"IT Sonix - Ihr Partner f\u00fcr individuelle Softwarel\u00f6sungen"},"image":{"@id":"https:\/\/itsonix.eu\/de\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/itsonix.eu\/de\/#\/schema\/person\/829813e3a66c2dfbb030cd6647f3caf3","name":"Intern","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5dcf1b27e4ed416dc1ee2931ab8eac2c1ed8dc060bed9a0d6bb1f0501c05c25d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dcf1b27e4ed416dc1ee2931ab8eac2c1ed8dc060bed9a0d6bb1f0501c05c25d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dcf1b27e4ed416dc1ee2931ab8eac2c1ed8dc060bed9a0d6bb1f0501c05c25d?s=96&d=mm&r=g","caption":"Praktikant"}}]}},"_links":{"self":[{"href":"https:\/\/itsonix.eu\/en\/wp-json\/wp\/v2\/posts\/891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsonix.eu\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsonix.eu\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsonix.eu\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/itsonix.eu\/en\/wp-json\/wp\/v2\/comments?post=891"}],"version-history":[{"count":1,"href":"https:\/\/itsonix.eu\/en\/wp-json\/wp\/v2\/posts\/891\/revisions"}],"predecessor-version":[{"id":900,"href":"https:\/\/itsonix.eu\/en\/wp-json\/wp\/v2\/posts\/891\/revisions\/900"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itsonix.eu\/en\/wp-json\/wp\/v2\/media\/892"}],"wp:attachment":[{"href":"https:\/\/itsonix.eu\/en\/wp-json\/wp\/v2\/media?parent=891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsonix.eu\/en\/wp-json\/wp\/v2\/categories?post=891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsonix.eu\/en\/wp-json\/wp\/v2\/tags?post=891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}