Direkt zum Hauptbereich

Posts

Pi And More 11 - QMC5883 Magnetic Field Sensor Class

A little aside from the analytical topics of this blog, I also was occupied with a little ubiquitous computing project. It was about machine learning with a magnetic field sensor, the QMC5883. In the Arduino module GY-271, usually the chip HMC5883 is equipped. Unfortunately, in cheap modules from china, another chip is used: the QMC5883. And, as a matter of course, the software library used for the HMC5883 does not work with the QMC version, because the I2C adress and the usage is a little bit different. Another problem to me was, that I  didn't find any proper working source codes for that little magnetic field device, and so I had to debug a source code I found for Arduino at Github  (thanks to dthain ). Unfortunately it didn't work properly at this time, and to change it for the Raspberry Pi into Python. Below you can find the "driver" module for the GY-271 with the QMC5883 chip. Sorry for the bad documentation, but at least it will work on a Raspberry Pi 3. ...

Data Analytics: How to protect against random correlations

Many analysts know it: You find a significant correlation - and then you wonder how secure the knowledge actually is. Of course, a good model inevitably requires an evaluation based on test data, because there is no way around it. But sometimes doubts remain - because even test data can be unreliable. At the beginning of this year, during my work, I found such a significant correlation (0.8 after Spearman). However, an evaluation was only possible to a limited extent, because due to external circumstances many attributes of the data can change in the respective department and not all changes are documented. Incompleteness in the dataset - that too will be known to analysts. Now I asked myself the question: how can I secure my knowledge nevertheless. The nature of the correlation was of central importance. The situation was similar to a well-insulated building in which the room temperature is dependent on both the outside temperature and a heating. Due to the thick insulation of t...

Introduction to Design Patterns (2): The Singleton

The Singleton The Singleton design pattern can be seen as a special case of a Lazy Getter . Indeed, the Lazy Getter is the basic construct of a Singleton. Additional, the Singleton does not use a member variable, but a global (static) variable, so that any call to the class would return the same variable. Why is this useful? Just imagine, You are developing an e-mail application with an address book function. Hence an address book can contain a lot of contacs, stored somehow in a data file that maybe need to be loaded by an SQLite database, this can take a few moments on initial data access. So when a user opens the address book the first time, the Laze Gette will cteate the address book object and load the contacts from SQLite. Now it is not that difficult to imagine, that the user may opens more than one e-mail window and writes some e-mails in those windows and every e-mail window is using the address book. To avoid multiple timespans for initially loading the contacts for each...

Introduction to Design Patterns (1): The Lazy Getter

The Laze Getter pattern Example for Java Example for Lazarus and language hint The term "Lazy Getter" refers to the Java vocabular, where a Getter is a method, that returns a feedback value or object. And lazy means, that the effect of this Getter method is somehow delayed. Some more precise, it is delayed until one need it. But what do we need? An object, of course! So we need an instantiation of an object delayed. or maybe we don't need this object at all and this is, why we are using a Lazy Getter. To save resources, it is inevitable to not create the maybe required object at startup. But of course we need to create it, when it is needed. To reach this, the Lazy Getter method is used as a synonyme for the late created object in the source code. This method does nothing else than looking, if the object is created - if yes, then return it - or not - then create and return it. That's all. A simple basic pattern. Example for Java: // somewhere you have de...

CREATE DATABASE via ODBC

When using ODBC, there are some facts to be considered. One of these facts is good to know when one is about to create a new database with an ODBC connection. General you should avoid ODBC if possible. But in some cases this is not possible because ODBC is still the only connection you have. This can happen if you use (for example) Mircrosoft Access to connect to a MySQL Server or a similar scenario. If you already worked successfully with data on that kind of connection, but now you have to create a database, there will occur a problem. Oh the existing connection you usually will have no success when trying to create a database because you maybe dont have the privilege. But even if you have, there will occur a problem.

The dark Side of Data Analytics

Meanwhile I am working as a data analyst for an industry company. One part of my job is to research production processes and reducing defects on the products to avoid them. Unfortunately during analysis with decision trees and logistic regression models a correlation very often is given, though a causality in many cases doesn't exist. And even if a causality exists, I have to consider the direction to avoid mistaking cause and impact. All these considerations are known under the term "Business Understanding". If you don't have the business understanding for your job, data mining and more simply analytics can get misleading very fast. Business Understanding an its spread Nearly every company that uses analytics and data mining has a strong concern in using the insights proper, because a wrong used information can cause bad consequences. This issue is that present in the heads of many managers, that they attach a lot of importance to business understanding. Th...

Unsolvable Windows Problems #1 - If you can' start the spooler service

A recent case of unusual computer problem induced me to write this post. Background A freind asked me because he had a computer problem that even an expert couldn't solve and he recommended to re-install Windows to solve the problem. Hence this friend of mine was a entrepreneur and he needed his computer every day, he din't want to re-install Windows and all the applications he uses every day. Not to mention the costs of the re-installation of his service-software. So I agreed to have a look at the problem. The problem itself The problem was, that he couldn't print anymore, though it was still possible seven days ago and he (of course) didn't change anything on the system. The first thing was, that I tried to print. I got an error, that the spooler service was not started. So I tried to start the spooler service, but this didn't work. Everytime I tried to start the spooler service, I got the error message "Windows Error 0x800706b9 - Not enough resource...