Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

classification of human activity using tabPFN sample notebook #2189

Open
wants to merge 5 commits into
base: next
Choose a base branch
from

Conversation

moonlanderr
Copy link
Collaborator

@moonlanderr moonlanderr commented Jan 13, 2025

classification of human activity using tabPFN sample notebook

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -0,0 +1,2168 @@
{
Copy link
Collaborator

@SurajBaloni SurajBaloni Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use proper capitalization, change Mobile dataset to Mobile Dataset


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,2168 @@
{
Copy link
Collaborator

@SurajBaloni SurajBaloni Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Here you have written TabFPN, will it be TabPFN ?
  • Accessing the datasets? but the heading below is Accessing the dataset

Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected

@@ -0,0 +1,2168 @@
{
Copy link
Collaborator

@SurajBaloni SurajBaloni Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%%time

import arcgis

are they required?


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -0,0 +1,2168 @@
{
Copy link
Collaborator

@SurajBaloni SurajBaloni Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HAR could be written as Human Activity Recognition (HAR)


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@@ -0,0 +1,2168 @@
{
Copy link
Collaborator

@SurajBaloni SurajBaloni Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • train datas should be train data
  • save ing to saving

Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected

@@ -0,0 +1,2168 @@
{
Copy link
Collaborator

@SurajBaloni SurajBaloni Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default initialization of the TabPFN classifier model object is shown below:


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected

@@ -0,0 +1,2168 @@
{
Copy link
Collaborator

@SurajBaloni SurajBaloni Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put all import in the first section


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@@ -0,0 +1,2168 @@
{
Copy link
Collaborator

@SurajBaloni SurajBaloni Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can see that the model score is showing excellent results.


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@@ -0,0 +1,2168 @@
{
Copy link
Collaborator

@SurajBaloni SurajBaloni Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we weill evaluate, spelling mistake


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected

@@ -0,0 +1,2168 @@
{
Copy link
Collaborator

@SurajBaloni SurajBaloni Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put all the imports in the first section


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@SurajBaloni
Copy link
Collaborator

Add required citation/license details as suggested by Rohit.

Copy link
Collaborator

@SurajBaloni SurajBaloni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@moonlanderr
Copy link
Collaborator Author

@BP-Ent , could you please review this notebook

@@ -0,0 +1,2179 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It enhances workplace safety by identifying risky workers' activities in hazardous industrial environments, such as in mining and on oil rigs, ensuring safety and reducing accidents. Furthermore, in the case of smart cities and urban mobility, HAR data from pedestrians and commuters can be efficiently classified to optimize traffic flow, public transport systems, and urban planning initiatives. Additionally, HAR supports emergency response efforts during disasters by locating people in need of help. TabPFN's speed, simplicity, and effectiveness make it an ideal choice for these real-time HAR applications.


Reply via ReviewNB

@@ -0,0 +1,2179 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the training dataframe above we use  Activity as the target label to be predicted, using the rest of the features as explanatory variables X. We define the explanatory variables as follows:


Reply via ReviewNB

@@ -0,0 +1,2179 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the explanatory variables X are defined, they are used as input in the prepare_tabulardata method from the tabular learner in arcgis.learn. The method takes the feature layer or a spatial dataframe containing the dataset and prepares it for fitting the model.

The input parameters required for the tool are used as follows:


Reply via ReviewNB

@@ -0,0 +1,2179 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get a sense of what the training data looks like, the show_batch() method will randomly pick a few training samples and visualize them. The samples show the explanatory variables and the Activity target label to predict.


Reply via ReviewNB

@@ -0,0 +1,2179 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next, we will evaluate the model's performance. This will print out multiple model metrics that we can use to assess the model quality. These metrics include a combination of multiple evaluation criteria, such as accuracyprecisionrecall and F1-Score, which collectively measure the model's performance on the validation set.


Reply via ReviewNB

@@ -0,0 +1,2179 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project highlights the powerful capabilities of the TabPFN classifier for Human Activity Recognition (HAR) tasks. Even with a training dataset of just 1,020 samples, the model achieved impressive results on a larger test dataset of 6,332 samples, with an accuracy of 96.81%, and precision, recall, and F1 scores all reaching 0.97. The TabPFN model's speed, simplicity, and strong performance in classifying human activities, highlight its potential for applications in healthcare, fitness, smart cities and disaster relief operations, offering an efficient and scalable solution for HAR systems.


Reply via ReviewNB

Copy link
Collaborator

@BP-Ent BP-Ent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested changes made on reviewnb

@moonlanderr
Copy link
Collaborator Author

@BP-Ent , I have added the suggestions, please check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants