Difference between revisions of "UBISS2024exam"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
<syntaxhighlight lang="python" line='line'> | <syntaxhighlight lang="python" line='line'> | ||
− | |||
− | |||
− | |||
− | |||
from sklearn.model_selection import train_test_split | from sklearn.model_selection import train_test_split | ||
− | |||
− | |||
− | |||
− | |||
X = df[["X", "Y", "Z"]].diff().iloc[1:].values | X = df[["X", "Y", "Z"]].diff().iloc[1:].values | ||
− | |||
− | |||
− | |||
− | |||
y = df.Label.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) | X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3) | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 12:35, 13 June 2024
1 from sklearn.model_selection import train_test_split
2 X = df[["X", "Y", "Z"]].diff().iloc[1:].values
3 y = df.Label.iloc[1:].values
4 X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)