Can you change the axis in Signal Labeler?

2 visualizzazioni (ultimi 30 giorni)
Nathan
Nathan il 18 Lug 2022
Commentato: Nathan il 4 Ott 2023
I have a long array of an endpoint position as it moves around the workspace (x,y). I'm only interested in labeling the circular movements, and ignoring the other motions. I was hoping to use Classification Learner across all trials, but need to start with some training data. Is there a way to change Signal Labeler to plot x vs y instead of x vs t & y vs t? That way I can label my "circles" and "noise".
I don't have to use Signal Labeler and Classification Learner. I'm open to other approaches to learn and extract unique shapes from x,y data.

Risposte (1)

Pratheek
Pratheek il 22 Set 2023
Hi Nathan,
I understand you want to plot X vs Y in Signal Labeler, But the Signal Labeler app in MATLAB does not directly support plotting x vs y instead of x vs t and y vs t. However, you can achieve your goal by using a different approach.
Assuming the data is small and manually Visualizable
  1. Plot x vs y using MATLAB's scatter function
  2. Use the interactive scatter plot to visually identify the circular movements and label them accordingly. You can use the ginput function to interactively select points on the scatter plot and assign labels programmatically.
Sample code for the same:
% Generate random x and y values
numPoints = 1000; % Number of data points
x = rand(numPoints, 1); % Random x values
y = rand(numPoints, 1); % Random y values
% Plot x vs y using scatter plot
scatter(x, y);
xlabel('x');
ylabel('y');
title('Scatter Plot of Random Data');
disp('Click on the scatter plot to label circular movements. Press enter when done.');
[x_circles, y_circles] = ginput();
When you have large data, here are alternative approaches to learn and extract unique shapes from x, y data without using Signal Labeler and Classification Learner:
  1. Manual labeling and feature extraction: Visually inspect the x, y data, manually label circular movements, and extract features like radius or frequency for further analysis.
  2. Clustering algorithms: Apply k-means clustering or DBSCAN to automatically group similar patterns in the x, y data, and identify circular motion clusters.
  3. Fourier analysis: Use Fourier analysis to extract frequency components from the x, y data, enabling identification of dominant frequencies associated with circular movements.
  4. Template matching: Create templates of circular movements from a subset of the data and compare segments of x, y data to identify similarity and detect circular patterns.
  5. Machine learning algorithms: Train SVM, random forest, or neural network models using labeled circular and non-circular data segments to classify new data as circles or noise.
These approaches offer different levels of automation and require experimentation to determine the best fit for your data and application.
  1 Commento
Nathan
Nathan il 4 Ott 2023
I've tried many of those approaches with limited success. My data consists of trajectories in x,y space, not indipendent points in x,y space. So k-means, training SVM, and random forest would tell me that yes there is a circle, and points 2,3,17, 42, 54, 103, 24601, 8675309 are in it.
But I'm looking to find out which continous segments take on a "circle-like" trajectory. And where these segments start/stop.
So I'm looking for clustering or ML approaches that cluster at time t, but somehow incorperate the position at t-1, and/or t+1.

Accedi per commentare.

Categorie

Scopri di più su Get Started with Statistics and Machine Learning Toolbox in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by