-
-
Save AI-MOO/fb919aa24c769617b2a761be6704fbf1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# المتغيرات الخاصة بالفئات الموجودة في الأعمدة | |
Acc = 0 | |
Gyro = 0 | |
other = 0 | |
for value in training_data.columns: | |
# التحقق من الأعمدة التي تحتوي على مستشعر التسارع | |
if "Acc" in str(value): | |
Acc += 1 | |
# التحقق من الأعمدة التي تحتوي على مستشعر الدوران | |
elif "Gyro" in str(value): | |
Gyro += 1 | |
# الأعمدة التي لا تشمل الفئتين السابقتين | |
else: | |
other += 1 | |
# طباعة عدد الأعمدة التابعة لكل فئة وتصويرها بيانيًا | |
plt.figure(figsize = (10, 5)) | |
print(f"Accelerometer:{Acc}\nGyroscope:{Gyro}\nOthers:{other}") | |
plt.bar(['Accelerometer', 'Gyroscope', 'Others'], [Acc, Gyro, other], color=('#002594','#00944c','#b31204')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment