Dataset Viewer
Auto-converted to Parquet
Search is not available for this dataset
profile id
int64
#friends
int64
#following
int64
#community
int64
age
int64
#postshared
int64
#urlshared
int64
#photos/videos
int64
fpurls
float64
fpphotos/videos
float64
avgcomment/post
float64
likes/post
float64
tags/post
int64
#tags/post
int64
Label
int64
1
39
300
907
200
1,000
850
922
0.49
0.55
0.56
0.47
40
14
1
2
150
350
30
300
300
100
290
0.33
0.96
0.5
1.2
10
4
0
3
300
450
50
465
500
150
450
0.2
0.84
0.4
1.5
15
7
0
4
25
110
660
350
2,050
2,000
2,050
0.97561
1
0.7
0.3
54
21
1
5
24
100
150
800
950
1,000
900
1.052632
0.947368
0.66
0.5
55
20
1
6
562
350
55
650
450
250
900
0.555556
2
0.42
2.2
15
10
0
7
662
454
22
764
365
100
1,000
0.273973
2.739726
0.31
2.5
23
10
0
8
50
100
700
350
2,512
2,000
2,400
0.796178
0.955414
0.77
0.32
58
32
1
9
800
550
66
850
460
500
300
1.086957
0.652174
0.4
2
23
10
0
10
605
555
58
782
700
100
650
0.142857
0.928571
0.24
2.8
13
5
0
11
1,005
380
13
1,250
561
132
530
0.235294
0.944742
0.1
1.6
16
4
0
12
1,632
560
84
651
789
87
760
0.110266
0.963245
0.46
1.9
35
12
0
13
2,461
643
63
1,523
756
123
713
0.162698
0.943122
0.46
2.8
13
17
0
14
561
312
46
625
326
65
300
0.199387
0.920245
0.35
2.3
32
15
0
15
1,143
426
86
956
558
56
500
0.100358
0.896057
0.24
2.1
15
19
0
16
784
466
46
423
326
32
300
0.09816
0.920245
0.26
2.5
18
12
0
17
146
56
13
125
76
23
65
0.302632
0.855263
0.35
1.3
19
19
0
18
894
465
123
565
420
63
400
0.15
0.952381
0.482
1
25
11
0
19
463
143
32
421
186
50
168
0.268817
0.903226
0.38
1.4
23
16
0
20
1,164
786
46
864
546
95
500
0.173993
0.915751
0.36
1.5
29
13
0
21
265
165
26
410
130
25
115
0.192308
0.884615
0.32
1.9
26
14
0
22
632
164
29
476
331
46
302
0.138973
0.912387
0.41
0.8
27
15
0
23
789
652
56
432
187
46
176
0.245989
0.941176
0.57
0.7
29
13
0
24
146
138
13
269
138
24
200
0.173913
1.449275
0.38
1.3
27
19
0
25
864
975
78
366
214
75
187
0.350467
0.873832
0.33
1.4
19
18
0
26
1,112
1,234
96
846
364
105
300
0.288462
0.824176
0.44
1.9
23
17
0
27
1,147
1,232
87
961
226
42
202
0.185841
0.893805
0.22
1.5
22
19
0
28
1,135
1,542
97
511
444
35
394
0.078829
0.887387
0.32
1.6
16
11
0
29
2,311
1,666
54
964
555
78
500
0.140541
0.900901
0.22
1.1
36
6
0
30
1,231
1,164
88
642
554
32
522
0.057762
0.942238
0.21
0.9
33
10
0
31
1,133
1,124
33
1,532
789
123
700
0.155894
0.887199
0.13
0.8
35
11
0
32
2,321
1,532
53
964
884
112
822
0.126697
0.929864
0.25
0.7
33
16
0
33
2,862
2,645
66
1,523
562
85
550
0.151246
0.978648
0.16
0.6
22
29
0
34
460
323
36
1,724
773
99
723
0.128072
0.935317
0.32
1.9
13
23
0
35
1,386
1,245
48
1,894
886
84
840
0.094808
0.948081
0.13
1.4
18
18
0
36
2,678
1,648
66
1,947
1,231
66
1,160
0.053615
0.942323
0.364
2
33
15
0
37
2,216
1,894
51
2,697
1,226
49
956
0.039967
0.779772
0.268
2.1
35
14
0
38
2,649
2,131
25
2,246
1,500
46
1,463
0.030667
0.975333
0.21
1.6
26
13
0
39
2,134
2,364
33
2,164
1,700
68
1,532
0.04
0.901176
0.22
1.8
21
11
0
40
1,123
1,150
115
2,246
1,460
56
1,163
0.038356
0.796575
0.33
1.1
22
5
0
41
1,009
1,123
32
1,423
1,112
36
635
0.032374
0.571043
0.321
1.88
36
4
0
42
1,100
1,356
49
1,200
800
24
750
0.03
0.9375
0.213
1.4
24
9
0
43
149
153
26
264
108
28
99
0.259259
0.916667
0.13
1.6
11
11
0
44
1,489
1,009
45
365
321
58
300
0.180685
0.934579
0.18
1.8
14
13
0
45
1,444
1,564
63
225
210
21
210
0.1
1
0.11
1.3
23
16
0
46
1,563
1,142
31
606
521
55
500
0.105566
0.959693
0.09
0.99
19
13
0
47
2,120
2,130
39
753
650
85
623
0.130769
0.958462
0.095
0.85
13
10
0
48
3,261
3,225
84
798
564
96
546
0.170213
0.968085
0.32
0.75
22
15
0
49
1,231
1,364
59
465
336
87
301
0.258929
0.895833
0.21
0.87
28
16
0
50
889
1,003
42
550
460
56
440
0.121739
0.956522
0.13
0.75
32
16
0
51
223
130
12
365
130
13
115
0.1
0.884615
0.236
0.886
29
18
0
52
332
321
13
421
183
23
175
0.125683
0.956284
0.313
0.889
21
12
0
53
2,135
2,364
54
1,005
786
150
760
0.19084
0.966921
0.42
0.66
34
16
0
54
3,305
4,510
168
1,543
864
166
800
0.19213
0.925926
0.156
0.78
31
10
0
55
4,462
5,312
113
665
512
87
495
0.169922
0.966797
0.28
0.99
38
9
0
56
5,554
4,231
85
980
602
84
560
0.139535
0.930233
0.16
1.6
25
11
0
57
654
461
49
1,520
1,231
186
941
0.151097
0.764419
0.12
1.9
18
15
0
58
1,546
1,243
88
645
547
62
431
0.113346
0.787934
0.35
1.1
26
14
0
59
1,143
987
65
1,546
786
112
653
0.142494
0.830789
0.34
1.4
21
13
0
60
463
465
36
1,502
623
68
581
0.109149
0.932584
0.292
1.4
14
10
0
61
561
482
32
1,645
658
66
599
0.100304
0.91033
0.223
1.2
13
11
0
62
1,325
1,123
45
1,895
633
89
593
0.1406
0.936809
0.23
1.6
32
7
0
63
254
195
24
956
764
105
690
0.137435
0.903141
0.33
1.5
42
17
0
64
336
226
22
869
321
43
300
0.133956
0.934579
0.54
1.59
43
18
0
65
4,563
3,261
59
1,235
1,200
86
900
0.071667
0.75
0.55
1.8
46
19
0
66
1,500
1,643
45
1,356
546
56
536
0.102564
0.981685
0.468
0.9
44
13
0
67
1,623
1,123
79
1,130
697
78
580
0.111908
0.832138
0.33
0.7
29
16
0
68
1,395
1,234
66
1,392
632
73
600
0.115506
0.949367
0.36
1.1
22
9
0
69
923
726
23
1,396
586
43
570
0.073379
0.972696
0.346
0.9
35
14
0
70
1,203
1,132
32
1,143
623
43
610
0.069021
0.979133
0.28
1.23
36
15
0
71
664
632
56
1,236
756
56
710
0.074074
0.939153
0.531
1.3
38
11
0
72
536
633
51
1,632
846
59
800
0.06974
0.945626
0.61
0.7
41
10
0
73
1,300
1,423
76
1,752
541
63
521
0.116451
0.963031
0.55
1.32
31
8
0
74
751
921
56
1,364
663
66
883
0.099548
1.331825
0.41
0.86
45
18
0
75
668
1,354
39
1,463
786
84
751
0.10687
0.955471
0.38
1.87
46
13
0
76
1,330
2,513
54
846
656
76
610
0.115854
0.929878
0.36
1.2
34
19
0
77
789
954
74
946
746
43
701
0.057641
0.939678
0.028
1.5
37
13
0
78
331
456
26
786
689
58
652
0.08418
0.946299
0.456
1.6
38
18
0
79
456
586
46
843
695
38
653
0.054676
0.939568
0.54
0.95
27
17
0
80
745
568
48
694
497
39
485
0.078471
0.975855
0.38
0.86
38
10
0
81
1,234
2,146
39
846
486
28
470
0.057613
0.967078
0.33
0.98
34
6
0
82
1,843
2,543
77
1,431
840
53
752
0.063095
0.895238
0.52
0.96
26
5
0
83
1,543
2,438
67
1,321
742
42
684
0.056604
0.921833
0.34
0.95
32
13
0
84
1,324
2,164
57
1,124
646
39
587
0.060372
0.908669
0.45
0.85
29
9
0
85
792
594
59
1,315
759
41
598
0.054018
0.787879
0.38
0.89
39
18
0
86
864
601
71
1,413
854
48
761
0.056206
0.891101
0.36
0.94
43
16
0
87
954
524
69
1,312
921
52
841
0.05646
0.913138
0.27
0.83
41
12
0
88
915
2,042
74
1,049
741
27
661
0.036437
0.892038
0.19
0.73
12
4
0
89
892
1,469
54
981
648
26
564
0.040123
0.87037
0.56
0.76
17
10
0
90
1,132
1,328
68
943
923
23
843
0.024919
0.913326
0.58
0.81
31
19
0
91
1,245
1,542
89
962
925
51
846
0.055135
0.914595
0.65
0.86
36
17
0
92
1,169
1,432
81
849
929
61
851
0.065662
0.916039
0.64
0.74
49
5
0
93
1,236
1,321
73
1,032
498
63
404
0.126506
0.811245
0.72
0.98
48
6
0
94
1,289
1,214
56
1,021
484
73
399
0.150826
0.82438
0.43
0.79
39
8
0
95
919
1,239
52
1,026
659
43
574
0.06525
0.871017
0.32
0.88
18
14
0
96
1,019
693
43
837
743
41
651
0.055182
0.876178
0.59
0.93
19
11
0
97
1,021
961
68
1,129
793
59
710
0.074401
0.895334
0.69
0.97
11
9
0
98
971
2,049
38
1,034
894
79
812
0.088367
0.908277
0.49
0.87
25
12
0
99
977
2,324
54
1,023
991
68
911
0.068618
0.919273
0.56
0.88
15
7
0
100
1,029
1,694
64
1,079
994
29
913
0.029175
0.918511
0.43
0.96
42
18
0
End of preview. Expand in Data Studio

Facebook Spam Detection Dataset

Dataset Summary

This dataset contains 600 Facebook profiles with behavioral and activity features designed for spam detection in social media. The dataset enables binary classification to distinguish between spam accounts (Label=1) and legitimate accounts (Label=0), providing insights into spammer behavior patterns on Facebook.

Dataset Details

  • Total Samples: 600 profiles
  • Classes: Binary (0 = Legitimate, 1 = Spam)
  • Class Distribution: Imbalanced (17.2% spam, 82.8% legitimate)
  • Features: 14 behavioral characteristics + 1 target label
  • Format: CSV file

Features Description

Feature Type Description Range
profile id Integer Unique profile identifier 1-600
#friends Integer Number of friends 4-5,554
#following Integer Number of accounts being followed 1-5,312
#community Integer Number of communities/groups joined 12-1,789
age Integer Account age (likely in days) 125-2,697
#postshared Integer Total number of posts shared 76-3,896
#urlshared Integer Number of URLs shared in posts 11-2,956
#photos/videos Integer Number of photos/videos posted 65-3,891
fpurls Float Frequency/proportion of URLs in posts 0.01-1.09
fpphotos/videos Float Frequency/proportion of media content 0.0-2.74
avgcomment/post Float Average comments per post 0.0-665
likes/post Float Average likes per post 0.1-2.8
tags/post Integer Tags used in posts 10-99
#tags/post Integer Number of tags per post 1-32
Label Integer Target variable - Spam (1) or Legitimate (0) 0-1

Key Statistics

  • Network Size: Average 1,066 friends and 1,069 following
  • Community Engagement: Average 208 communities joined
  • Account Maturity: Average age of 1,215 days (~3.3 years)
  • Content Activity:
    • Average 1,158 posts shared
    • Average 370 URLs shared
    • Average 1,121 photos/videos posted
  • Engagement Metrics:
    • Average 1.6 comments per post
    • Average 0.88 likes per post
    • Average 16 tags per post

Class Imbalance

⚠️ Important: This dataset is imbalanced:

  • Legitimate accounts: 497 samples (82.8%)
  • Spam accounts: 103 samples (17.2%)

Consider using techniques like SMOTE, class weighting, or balanced sampling for training.

Use Cases

This dataset is ideal for:

  • Spam Detection: Build classifiers to identify Facebook spam accounts
  • Behavioral Analysis: Study differences between spam and legitimate user behavior
  • Anomaly Detection: Develop unsupervised methods for suspicious activity detection
  • Social Media Security: Research automated content moderation systems
  • Imbalanced Learning: Practice techniques for handling skewed datasets

Quick Start

import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report, confusion_matrix
from imblearn.over_sampling import SMOTE

# Load dataset
df = pd.read_csv('Facebook Spam Dataset.csv')

# Prepare features and target
X = df.drop(['Label', 'profile id'], axis=1)
y = df['Label']

# Handle class imbalance with SMOTE
smote = SMOTE(random_state=42)
X_resampled, y_resampled = smote.fit_resample(X, y)

# Split data
X_train, X_test, y_train, y_test = train_test_split(
    X_resampled, y_resampled, test_size=0.2, random_state=42, stratify=y_resampled
)

# Train model
model = RandomForestClassifier(
    n_estimators=100, 
    class_weight='balanced',
    random_state=42
)
model.fit(X_train, y_train)

# Evaluate
y_pred = model.predict(X_test)
print("Classification Report:")
print(classification_report(y_test, y_pred))

Suggested Approaches

Traditional ML

  • Random Forest: Handles mixed data types well
  • Gradient Boosting: XGBoost, LightGBM for performance
  • SVM: With RBF kernel for non-linear patterns
  • Logistic Regression: With proper feature scaling

Handling Imbalance

  • Sampling: SMOTE, ADASYN for oversampling
  • Cost-sensitive: Class weights in algorithms
  • Ensemble: Balanced bagging, EasyEnsemble
  • Metrics: Focus on F1-score, AUC-ROC, precision/recall

Feature Engineering

  • Ratios: Create engagement ratios (likes/posts, comments/posts)
  • Behavioral: URL sharing patterns, media content ratios
  • Network: Friend-to-following ratios, community participation
  • Temporal: Account age interactions with activity levels

Model Evaluation Tips

Given the class imbalance, prioritize these metrics:

  • F1-Score: Harmonic mean of precision and recall
  • AUC-ROC: Area under the ROC curve
  • Precision/Recall: Especially for spam class (minority)
  • Confusion Matrix: To understand false positives/negatives

Data Quality

  • Complete Data: No missing values
  • ⚠️ Class Imbalance: 82.8% legitimate vs 17.2% spam
  • Feature Variety: Network, content, and engagement metrics
  • Realistic Ranges: All features show plausible Facebook activity patterns

Research Opportunities

  1. Behavioral Patterns: What distinguishes spam from legitimate user behavior?
  2. Feature Importance: Which metrics are most predictive of spam accounts?
  3. Temporal Analysis: How does account age correlate with spam likelihood?
  4. Network Effects: Do spam accounts show distinct networking patterns?
  5. Content Analysis: How do URL sharing and media patterns differ?

Potential Applications

  • Social Media Platforms: Automated spam account detection
  • Content Moderation: Flagging suspicious posting patterns
  • User Safety: Protecting users from spam and malicious content
  • Research: Understanding social media abuse patterns
  • Security Systems: Real-time threat detection algorithms

Citation

@dataset{facebook_spam_detection_2024,
  title={Facebook Spam Detection Dataset},
  year={2025},
  publisher={Hugging Face},
  url={https://huggingface.co/datasets/nahiar/facebook-spam-detection}
}

Notes

  • The age feature appears to be in days rather than years
  • Some ratio features (like fpurls, fpphotos/videos) may exceed 1.0, indicating normalized metrics
  • Consider feature scaling for distance-based algorithms
  • The dataset reflects Facebook's ecosystem and user behavior patterns
Downloads last month
49