Skip to content

Commit

Permalink
Update example 4
Browse files Browse the repository at this point in the history
Co-authored-by: gvieralopez <[email protected]>
  • Loading branch information
jmorgadov and gvieralopez committed Jun 8, 2023
1 parent 64ef7fc commit 1f3d4a8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/example_04.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
Dataset.uci_characters(),
Dataset.uci_movement_libras(),
]


# Select the desired features to be extracted from the trajectories
featurizer = featurizers.UniversalFeaturizer()

for dataset in datasets:
print(f"\nDataset: {dataset.name}\n")

# Split the dataset into train and test
# Split the dataset into train and test and filter out short trajectories
train, test = dataset.filter(
lambda traj, _: len(traj) >= 5 and traj.r.delta.norm.sum() > 0
lambda traj, label: len(traj) >= 5
and traj.r.delta.norm.sum() > 0
and dataset.label_counts[label] > 5
).split(
train_size=0.7,
random_state=SEED,
)

# Select the desired features to be extracted from the trajectories
featurizer = featurizers.UniversalFeaturizer()

# Define the model
model = XGBoostModel(featurizer=featurizer)

Expand Down

0 comments on commit 1f3d4a8

Please sign in to comment.