UBISS2024exam: Difference between revisions

From Sketching with Hardware at LMU Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<syntaxhighlight lang="python" line='line'>
<syntaxhighlight lang="python" line='line'>
from machine import Pin, ADC
from sklearn.model_selection import train_test_split
from time import sleep
X = df[["X", "Y", "Z"]].diff().iloc[1:].values
 
y = df.Label.iloc[1:].values
y = ADC(Pin(26))
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)
 
while True:
  z = y.read_u16()
  print(z)
  sleep(1)
</syntaxhighlight>
</syntaxhighlight>

Revision as of 13:34, 13 June 2024

from sklearn.model_selection import train_test_split
X = df[["X", "Y", "Z"]].diff().iloc[1:].values
y = df.Label.iloc[1:].values
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)