Skip to content

Commit b91d729

Browse files
committed
all suggestions added
1 parent 665c67e commit b91d729

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

samples/04_gis_analysts_data_scientists/classifying_human_activity_using _tabPFN_classifier.ipynb

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@
1414
"## Table of Contents <a class=\"anchor\" id=\"0\"></a>\n",
1515
"* [Introduction](#1) \n",
1616
"* [Necessary imports](#2)\n",
17-
"* [Connecting to ArcGIS](#3)\n",
18-
"* [Accessing the datasets](#4) \n",
17+
"* [Connect to ArcGIS](#3)\n",
18+
"* [Access the datasets](#4) \n",
1919
"* [Prepare training data for TabPFN](#5)\n",
20-
" * [Data Preprocessing for TabPFN Classifier Model](#6) \n",
20+
" * [Data preprocessing for TabPFN classifier model](#6) \n",
2121
" * [Visualize training data](#9)\n",
22-
"* [Model Training](#10) \n",
22+
"* [Model training](#10) \n",
2323
" * [Define the TabPFN classifier model ](#11)\n",
2424
" * [Fit the model](#12)\n",
2525
" * [Visualize results in validation set](#13)\n",
26-
"* [Predicting using TabPFN classifier model](#14)\n",
27-
" * [Predict using the trained model](#15)\n",
28-
"* [Accuracy assessment: Compute Model Metric](#16)\n",
26+
"* [Predict using TabPFN classifier model](#14)\n",
27+
"* [Accuracy assessment: Compute model metric](#16)\n",
2928
"* [Conclusion](#17)\n",
30-
"* [TabPFN License Information](#18) "
29+
"* [TabPFN license information](#18) "
3130
]
3231
},
3332
{
@@ -84,7 +83,7 @@
8483
"cell_type": "markdown",
8584
"metadata": {},
8685
"source": [
87-
"## Connecting to ArcGIS <a class=\"anchor\" id=\"3\"></a>"
86+
"## Connect to ArcGIS <a class=\"anchor\" id=\"3\"></a>"
8887
]
8988
},
9089
{
@@ -93,14 +92,14 @@
9392
"metadata": {},
9493
"outputs": [],
9594
"source": [
96-
"gis = GIS(\"/home\")"
95+
"gis = GIS(\"home\")"
9796
]
9897
},
9998
{
10099
"cell_type": "markdown",
101100
"metadata": {},
102101
"source": [
103-
"## Accessing the datasets <a class=\"anchor\" id=\"4\"></a>\n",
102+
"## Access the datasets <a class=\"anchor\" id=\"4\"></a>\n",
104103
"\n",
105104
"Here we will access the train and test datasets. The Human Activity Recognition (HAR) training dataset consists of 1,020 rows and 561 features, capturing sensor data from mobile devices to classify human activities like walking, running, and sitting. The data includes measurements from accelerometers, gyroscopes, and GPS, providing insights into movement patterns while ensuring that location data remains anonymized for privacy protection. Features such as BodyAcc (body accelerometer), GravityAcc (gravity accelerometer), BodyAccJerk, BodyGyro (body gyroscope), and BodyGyroJerk are used to capture dynamic and rotational movements. Time-domain and frequency-domain features are extracted from these raw signals, helping to distinguish between various activities based on patterns in acceleration, rotation, and speed, making the dataset ideal for activity classification tasks."
106105
]
@@ -1354,7 +1353,7 @@
13541353
"cell_type": "markdown",
13551354
"metadata": {},
13561355
"source": [
1357-
"### Data Preprocessing for TabPFN Classifier Model<a class=\"anchor\" id=\"6\"></a>"
1356+
"### Data preprocessing for TabPFN classifier model<a class=\"anchor\" id=\"6\"></a>"
13581357
]
13591358
},
13601359
{
@@ -1459,7 +1458,7 @@
14591458
"metadata": {},
14601459
"outputs": [],
14611460
"source": [
1462-
"data = prepare_tabulardata(X_train_lda_df, 'Activity',explanatory_variables=X)"
1461+
"data = prepare_tabulardata(X_train_lda_df, 'Activity', explanatory_variables=X)"
14631462
]
14641463
},
14651464
{
@@ -1582,15 +1581,15 @@
15821581
"cell_type": "markdown",
15831582
"metadata": {},
15841583
"source": [
1585-
"### Model Training <a class=\"anchor\" id=\"10\"></a>\n",
1586-
"First we initialize the model as follows:"
1584+
"### Model training <a class=\"anchor\" id=\"10\"></a>\n",
1585+
"First, we initialize the model as follows:"
15871586
]
15881587
},
15891588
{
15901589
"cell_type": "markdown",
15911590
"metadata": {},
15921591
"source": [
1593-
"### Define the TabPFN classifier model <a class=\"anchor\" id=\"11\"></a>\n",
1592+
"### Model initialization <a class=\"anchor\" id=\"11\"></a>\n",
15941593
"\n",
15951594
"The default, initialization of the TabPFN classifier model object is shown below:"
15961595
]
@@ -1601,7 +1600,7 @@
16011600
"metadata": {},
16021601
"outputs": [],
16031602
"source": [
1604-
"tabpfn_classifier = MLModel(data, 'tabpfn.TabPFNClassifier',device='cpu', N_ensemble_configurations=32)"
1603+
"tabpfn_classifier = MLModel(data, 'tabpfn.TabPFNClassifier', device='cpu', N_ensemble_configurations=32)"
16051604
]
16061605
},
16071606
{
@@ -1777,7 +1776,7 @@
17771776
"cell_type": "markdown",
17781777
"metadata": {},
17791778
"source": [
1780-
"## Predicting using the TabPFN classifier model <a class=\"anchor\" id=\"14\"></a>\n",
1779+
"## Predict using the TabPFN classifier model <a class=\"anchor\" id=\"14\"></a>\n",
17811780
"\n",
17821781
"Once the TabPFN classifier is trained on the smaller dataset of 1,020 samples, we can use it to predict the classes of a larger dataset containing 6,332 samples. Given TabPFN’s ability to process data efficiently with a single forward pass, it can handle this larger dataset quickly, classifying each sample based on the patterns learned during training. Since the model is optimized for fast and scalable predictions, it will generate class predictions for all samples. \n",
17831782
"\n",
@@ -1916,7 +1915,7 @@
19161915
"cell_type": "markdown",
19171916
"metadata": {},
19181917
"source": [
1919-
"### Predicting using the trained model <a class=\"anchor\" id=\"15\"></a>"
1918+
"### Predict <a class=\"anchor\" id=\"15\"></a>"
19201919
]
19211920
},
19221921
{
@@ -2144,7 +2143,7 @@
21442143
"cell_type": "markdown",
21452144
"metadata": {},
21462145
"source": [
2147-
"### TabPFN License Information <a class=\"anchor\" id=\"18\"></a>"
2146+
"### TabPFN license information <a class=\"anchor\" id=\"18\"></a>"
21482147
]
21492148
},
21502149
{

0 commit comments

Comments
 (0)