Swiftorial Logo
Home
Swift Lessons
Matchups
CodeSnaps
Tutorials
Career
Resources

Introduction to DataScience: Key Concepts and Terms

1. Data

Data is the foundation of Data Science. It refers to information that can be processed by computers. Data can be structured (e.g., databases) or unstructured (e.g., text, images).

Example of structured data:

IDNameAge
1John Doe28
2Jane Smith34

2. Data Analysis

Data Analysis involves examining, cleaning, transforming, and modeling data to discover useful information, draw conclusions, and support decision-making.

Example of data analysis using Python:

import pandas as pd
data = {'ID': [1, 2], 'Name': ['John Doe', 'Jane Smith'], 'Age': [28, 34]}
df = pd.DataFrame(data)
print(df.describe())
                    
            ID        Age
count  2.000000   2.000000
mean   1.500000  31.000000
std    0.707107   4.242641
min    1.000000  28.000000
25%    1.250000  29.500000
50%    1.500000  31.000000
75%    1.750000  32.500000
max    2.000000  34.000000
                    

3. Machine Learning

Machine Learning is a subset of artificial intelligence that involves training algorithms to make predictions or decisions based on data. It is a key component of Data Science.

Example of a simple machine learning model using Python:

from sklearn.linear_model import LinearRegression
import numpy as np

# Simple dataset
X = np.array([[1], [2], [3], [4], [5]])
y = np.array([1, 3, 3, 2, 5])

# Create and train the model
model = LinearRegression()
model.fit(X, y)

# Make a prediction
prediction = model.predict([[6]])
print(prediction)
                    
[4.6]
                    

4. Big Data

Big Data refers to extremely large datasets that may be analyzed computationally to reveal patterns, trends, and associations, especially relating to human behavior and interactions.

Example of Big Data technologies:

  • Hadoop
  • Spark
  • NoSQL Databases (e.g., MongoDB)

5. Data Visualization

Data Visualization is the graphical representation of information and data. It uses visual elements like charts, graphs, and maps to help understand trends, outliers, and patterns in data.

Example of a data visualization using Python's Matplotlib:

import matplotlib.pyplot as plt

# Data
x = [1, 2, 3, 4, 5]
y = [1, 3, 3, 2, 5]

# Create a plot
plt.plot(x, y)
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Simple Plot')
plt.show()
                    

6. Data Cleaning

Data Cleaning is the process of detecting and correcting (or removing) corrupt or inaccurate records from a dataset. It is a crucial step before analyzing data.

Example of data cleaning using Python:

import pandas as pd

# Sample data with missing values
data = {'ID': [1, 2, 3], 'Name': ['John Doe', 'Jane Smith', None], 'Age': [28, None, 34]}
df = pd.DataFrame(data)

# Fill missing values
df['Name'].fillna('Unknown', inplace=True)
df['Age'].fillna(df['Age'].mean(), inplace=True)

print(df)
                    
   ID        Name   Age
0   1     John Doe  28.0
1   2   Jane Smith  31.0
2   3      Unknown  34.0