Postato is a tool that identifies the position of your body with fuzzy logic.
The fuzzy rule set is built upon crisp data which is accepted under the form of a dataset where each tuple is in the format (xWrist, yWrist, zWrist, xThigh, yThigh, zThigh, activity)
. The data used is provided by the UCI data repo. It is first fuzzified with soft kMeans++
using Newton's gravity formula producing a super cluster of fuzzy clusters. Once they are obtained a fuzzy rule is generated from the fuzzy boundaries of each cluster. A rule consists of a mapping between a body position axis and a fuzzy number. Currently Postato supports triangular and gaussian fuzzy numbers.
But how is this valuable? 🤔
A fuzzy inferer is required to make use of a fuzzy rule set. Postato uses the one of Mamdani.
At the moment only fuzzy rule set plotting is supported. It can be executed with:
# git clone this repo
# Fetch all dependencies.
go get ./...
# If you have direnv installed run `direnv allow` otherwise
source .envrc
# For gaussian fuzzy numbers
go run cmd/postato/main.go draw -d data/sample.csv -t gaussian
# For triangular fuzzy numbers
go run cmd/postato/main.go draw -d data/sample.csv -t triangular
All images are generated within the gen/image
directory. There is an example dataset located at data/sample.csv
.
It is tested using 10-fold-cross validation which can be tested like executed like this:
# For gaussian fuzzy numbers. Shows a success rate of ~82%.
go run cmd/postato/main.go test -d data/sample.csv -t gaussian
# For triangular fuzzy numbers. Shows a success rate of ~12% which is far worse.
go run cmd/postato/main.go test -d data/sample.csv -t triangular