Commit cc7399bd authored by Anuththara18's avatar Anuththara18

Data Visualization Files Added

parent f353a9b0
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
# -*- coding: utf-8 -*-
"""
E:\Education\SLIIT\Year 04\IT4010 - Research Project\19. DATA
@author: Anuththara
"""
import pandas as pd
import matplotlib.pyplot as plt
'''
correct_responses
commission_errors
omission_errors
mean_reaction_time
'''
###############################################################################
df1 = pd.read_csv("AA4.csv")
x = df1[['id']]
y = df1[['commission_errors']]
plt.scatter(x, y, c ="blue")
x2 = df1[['id']]
y2 = df1[['omission_errors']]
plt.scatter(x2, y2, c ="red")
plt.xlabel("ID")
plt.ylabel("Blue = CE, Red = OE")
plt.title("AA5 --> TCR = 19")
df1.plot(kind='scatter',x='id',y='correct_responses', c ="orange", title="AA4") # scatter plot
df1.plot(kind='scatter',x='id',y='mean_reaction_time', c ="green", title="AA4") # scatter plot
###############################################################################
df2 = pd.read_csv("AA5.csv")
df2.plot(kind='scatter',x='id',y='commission_errors', c ="blue") # scatter plot
x2 = df2[['id']]
y2 = df2[['omission_errors']]
plt.scatter(x2, y2, c ="red")
plt.xlabel("ID")
plt.ylabel("Blue = CE, Red = OE")
plt.title("AA5 --> TCR = 19")
df2.plot(kind='scatter',x='id',y='correct_responses', c ="orange", title="AA5") # scatter plot
df2.plot(kind='scatter',x='id',y='mean_reaction_time', c ="green", title="AA5") # scatter plot
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "26924545",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"id": "a46983af",
"metadata": {},
"source": [
"## Focused Attention"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "a22f3ece",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"stimulus\n",
"cow 2\n",
"giraffe 1\n",
"lion 3\n",
"zebra 3\n",
"dtype: int64"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data = pd.read_csv(r\"FA4.csv\")\n",
"df = data.loc[data['level'] == 3]\n",
"\n",
"occur = df.groupby(['stimulus']).size()\n",
"display(occur)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "62da490b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"stimulus\n",
"cow 1\n",
"dog 3\n",
"giraffe 2\n",
"zebra 1\n",
"dtype: int64"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data = pd.read_csv(r\"FA5.csv\")\n",
"df = data.loc[data['level'] == 3]\n",
"occur = df.groupby(['stimulus']).size()\n",
"display(occur)"
]
},
{
"cell_type": "markdown",
"id": "7333ca15",
"metadata": {},
"source": [
"## Sustained Attention "
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "3979e4b1",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"stimulus\n",
"pink 5\n",
"red 2\n",
"yellow 1\n",
"dtype: int64"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df = pd.read_csv(r\"SuA4.csv\")\n",
"occur = df.groupby(['stimulus']).size()\n",
"display(occur)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "29596833",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"stimulus\n",
"blue 2\n",
"pink 5\n",
"red 2\n",
"dtype: int64"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df = pd.read_csv(r\"SuA5.csv\")\n",
"occur = df.groupby(['stimulus']).size()\n",
"display(occur)"
]
},
{
"cell_type": "markdown",
"id": "260b5e44",
"metadata": {},
"source": [
"## Selective Attention "
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "ccebf218",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>percentage_no_of_correct_responses</th>\n",
" </tr>\n",
" <tr>\n",
" <th>stimulus</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>bee</th>\n",
" <td>88.541667</td>\n",
" </tr>\n",
" <tr>\n",
" <th>bird</th>\n",
" <td>97.564935</td>\n",
" </tr>\n",
" <tr>\n",
" <th>butterfly</th>\n",
" <td>93.750000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>flower</th>\n",
" <td>94.444444</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ladybird</th>\n",
" <td>92.682073</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" percentage_no_of_correct_responses\n",
"stimulus \n",
"bee 88.541667\n",
"bird 97.564935\n",
"butterfly 93.750000\n",
"flower 94.444444\n",
"ladybird 92.682073"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df = pd.read_csv(r\"SA4.csv\")\n",
"\n",
"# standardizing the data\n",
"from sklearn.preprocessing import StandardScaler\n",
"scaler = StandardScaler()\n",
"data_scaled = scaler.fit_transform(df)\n",
"\n",
"# statistics of scaled data\n",
"pd.DataFrame(data_scaled).describe()\n",
"avg = df.groupby('stimulus')[['percentage_no_of_correct_responses']].mean()\n",
"display(avg)"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "b8221fa7",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>percentage_no_of_correct_responses</th>\n",
" </tr>\n",
" <tr>\n",
" <th>stimulus</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>bear</th>\n",
" <td>91.666667</td>\n",
" </tr>\n",
" <tr>\n",
" <th>bee</th>\n",
" <td>92.063492</td>\n",
" </tr>\n",
" <tr>\n",
" <th>bird</th>\n",
" <td>98.484848</td>\n",
" </tr>\n",
" <tr>\n",
" <th>butterfly</th>\n",
" <td>94.444444</td>\n",
" </tr>\n",
" <tr>\n",
" <th>flower</th>\n",
" <td>96.904762</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ladybird</th>\n",
" <td>100.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>pig</th>\n",
" <td>100.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" percentage_no_of_correct_responses\n",
"stimulus \n",
"bear 91.666667\n",
"bee 92.063492\n",
"bird 98.484848\n",
"butterfly 94.444444\n",
"flower 96.904762\n",
"ladybird 100.000000\n",
"pig 100.000000"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df = pd.read_csv(r\"SA5.csv\")\n",
"avg = df.groupby('stimulus')[['percentage_no_of_correct_responses']].mean()\n",
"display(avg)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8aff0262",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment