Skip to main content

Sklearn flavored library containing numerous Activity of Daily Livings datasets, preprocessing methods and visualizations.

Project description

Activities of Daily Living - Machine Learning

Contains data preprocessing and visualization methods for ADL datasets.

PyPI version Download Stats Read the Docs (version) License

Activities of Daily living (ADLs) e.g cooking, working, sleeping and device readings are recorded by Smart Home inhabitants.

The objective is to predict inhabitants activities using the device readings. Pyadlml offers an easy way to fetch, visualize and preprocess common datasets. Furthermore a pipeline and TODO

!! Disclaimer !!

Package is still an alpha-version and in active development. Consequently, things are going to change and break and may not work at all. Nevertheless, feel free to take a look the package and use what is already finished.

Last Stable Release

$ pip install pyadlml

Latest Development Changes

$ git clone https://github.com/tcsvn/pyadlml
$ cd pyadlml
$ pip install .

Usage example

from pyadlml.dataset import fetch_amsterdam

# Fetch dataset
data = fetch_amsterdam()
df_activites = data['activities']
df_devices = data['devices']

# Plot an inhabitants activity density distribution over one day
from pyadlml.plot import plot_act_density

plot_act_density(df_activities).show()

# Create a vector of smart home device states and discretize the event data in 20 second bins
from pyadlml.preprocessing import StateVectorEncoder, LabelEncoder

sve = StateVectorEncoder(encoding='raw', dt='20s')
raw = sve.fit_transform(df_devices)

# Label the datapoints with the corresponding activity
lbls = LabelEncoder().fit_transform(df_activities, raw)

X = raw.values
y = lbls.values

# Proceed with machine learning techniques you already know
from sklearn.tree import DecisionTreeClassifier

clf = DecisionTreeClassifier()
clf.fit(X, y)
...

For more examples and how to use, please refer to the documentation or the notebooks.

Features

  • 12 Datasets
  • Importing data from Home Assistant or Activity Assistant
  • Many visualizations and statistics for devices, activities and their interaction
  • Multiple device representations:
    • Raw
    • Changepoint
    • Lastfired
  • Timeseries sampler
    • Sequential
    • Timeslice
    • Event based
  • Feature extraction for event-times
  • Cross validation iterators adapted for ADLs

Supported Datasets

  • Amsterdam [1]
  • Aras [2]
  • Casas Aruba (2011) [3]
  • Kasteren House A,B,C [5]
  • MITLab [6]
  • Tuebingen 2019 [7]
  • UCI Adl Binary [8]
  • Casas Milan (2009) [4]
  • Casas Cairo [4]
  • Casas Tokyo [4]
  • Chinokeeh [9]

Educational examples, benchmarks and replications

The project includes a leaderboard of current models to the best of knowledge. In addition, a lot of models are compared on a cleaned version of all the available datasets. Furthermore, there is a useful list of references that is still growing on papers to read. For all this check out the notebooks.

Contributing

  1. Fork it (https://github.com/tcsvn/pyadlml/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Related projects

Support

Buy me a coffee

How to cite

If you are using pyadlml for publications consider citing the package

@software{pyadlml,
  author = {Christian Meier},
  title = {PyADLMl - Machine Learning library for Activities of Daily Living},    
  url = {https://github.com/tcsvn/pyadlml},
  version = {0.0.10-alpha},
  date = {2022-11-15}
}

Sources

[1]: T.L.M. van Kasteren; A. K. Noulas; G. Englebienne and B.J.A. Kroese, Tenth International Conference on Ubiquitous Computing 2008
[2]: H. Alemdar, H. Ertan, O.D. Incel, C. Ersoy, ARAS Human Activity Datasets in Multiple Homes with Multiple Residents, Pervasive Health, Venice, May 2013.
[3,4]: WSU CASAS smart home project: D. Cook. Learning setting-generalized activity models for smart spaces. IEEE Intelligent Systems, 2011.
[5]: Transferring Knowledge of Activity Recognition across Sensor networks. Eighth International Conference on Pervasive Computing. Helsinki, Finland, 2010.
[6]: E. Munguia Tapia. Activity Recognition in the Home Setting Using Simple and Ubiquitous sensors. S.M Thesis
[7]: Activity Recognition in Smart Home Environments using Hidden Markov Models. Bachelor Thesis. Uni Tuebingen.
[8]: Ordonez, F.J.; de Toledo, P.; Sanchis, A. Activity Recognition Using Hybrid Generative/Discriminative Models on Home Environments Using Binary Sensors. Sensors 2013, 13, 5460-5477.
[9]: D. Cook and M. Schmitter-Edgecombe, Assessing the quality of activities in a smart environment. Methods of information in Medicine, 2009

License

MIT © tcsvn

sdf

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyadlml-0.0.7.13a0.tar.gz (213.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyadlml-0.0.7.13a0-py3-none-any.whl (270.6 kB view details)

Uploaded Python 3

File details

Details for the file pyadlml-0.0.7.13a0.tar.gz.

File metadata

  • Download URL: pyadlml-0.0.7.13a0.tar.gz
  • Upload date:
  • Size: 213.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for pyadlml-0.0.7.13a0.tar.gz
Algorithm Hash digest
SHA256 d4d1f294029b2894e74f491f793c25e6f101539078b6fbbd9e60f4aab1c3f9aa
MD5 2983612486f2b0fa84afeeca6676c77d
BLAKE2b-256 8605c86a5afa801cd6db820e81c97194ca7dcffca5d5a145b34500c4aa9eeb42

See more details on using hashes here.

File details

Details for the file pyadlml-0.0.7.13a0-py3-none-any.whl.

File metadata

  • Download URL: pyadlml-0.0.7.13a0-py3-none-any.whl
  • Upload date:
  • Size: 270.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for pyadlml-0.0.7.13a0-py3-none-any.whl
Algorithm Hash digest
SHA256 8795923f1939405f6190dd1b5011e63790fe7ffe62bdb0e535260b59c5b39d64
MD5 58569cbb6a1a5d1dd5ac025a9b82aa6b
BLAKE2b-256 cf3f463e5b5bce89f719d71c8388a802685deb02028188a5b068a9ed8aafb986

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page