Skip to main content

DCS725-1 Week 4 MODULE FOUR: AI in Data Analysis

Lesson Overview

Welcome to AI in Data Analysis

Embark on a journey into the realms of Artificial Intelligence (AI) as it transforms the landscape of data analysis. This self-paced module is designed to empower you with the knowledge and skills required to leverage AI for insightful data analysis.

Overview of the Self-Paced Module

Dive into the world of AI-driven data analysis through a meticulously crafted curriculum. This module combines theoretical foundations with hands-on application, providing a comprehensive learning experience.

Objectives and Outcomes

  • Develop a deep understanding of data mining techniques and algorithms.
  • Apply data mining to real-world datasets through hands-on exercises and projects.
  • Explore data warehousing tools and platforms, including Oracle Exadata, Teradata, and Amazon Redshift.
  • Engage in project-based learning to reinforce theoretical concepts.
  • Evaluate your progress through self-check exercises and project evaluations.
  • Access resources and participate in discussion forums for continuous learning.

Resources:

Access links to free AI data analysis tools for interactive exploration. Utilize documentation and tutorials for algorithms, data mining, and data warehousing, enriching your learning experience.

Discussion Forum:

Participate in the discussion forum for sharing insights and challenges. Collaborate with peers on the practical applications of free AI tools, fostering a community of continuous learning. Must reply to at least 2 peers with authentic feedback and reflection. 

Assignment:

Find a case study to evaluate and explore using the Judson Library Databases. 

Data Warehousing Overview

Grasp the Roles of Oracle Exadata, Teradata, and Amazon Redshift in Data Warehousing

Data warehousing plays a pivotal role in modern data management, providing a centralized repository for large volumes of structured and unstructured data. In this module section, you are introduced to key data warehousing platforms, specifically Oracle Exadata, Teradata, and Amazon Redshift. Through an exploration of their roles and functionalities, you will gain a foundational understanding that sets the stage for in-depth exploration.

1. Oracle Exadata:

  • Role in Data Warehousing: Oracle Exadata is renowned for its role as a high-performance database appliance designed for large-scale data warehousing and transactional processing. Explore how Oracle Exadata accelerates query performance, optimizes storage, and supports analytics workloads.

  • Introductory Understanding: Develop an understanding the architecture and features of Oracle Exadata. Discuss its integration with Oracle Database and how it enhances data processing capabilities.

2. Teradata:

  • Role in Data Warehousing: Teradata has been a long-standing player in the data warehousing landscape, known for its parallel processing architecture. Discover how Teradata excels in managing and analyzing massive datasets, supporting complex queries and analytics.

  • Introductory Understanding: Explore the fundamentals of Teradata, emphasizing its capabilities in distributed data storage and parallel processing. Explore how Teradata enables scalability and high-performance analytics.

3. Amazon Redshift:

  • Role in Data Warehousing: Amazon Redshift, a cloud-based data warehousing solution, allows for seamless scalability and flexibility. Explore how Amazon Redshift is utilized to handle data warehousing needs in the cloud, catering to organizations with dynamic workloads.

  • Introductory Understanding:  Look at its architecture, cost-effectiveness, and integration with other AWS services. Discuss the advantages of using a cloud-based data warehousing solution.

Hands-On Exploration with Free AI Tools:

  • Tool Selection: Use free AI tools such as Google Colab or Jupyter Notebooks to explore introductory concepts related to Oracle Exadata, Teradata, and Amazon Redshift.

  • Comparative Analysis: Facilitate a comparative analysis to understand the strengths and weaknesses of each platform. Discuss considerations for selecting a data warehousing solution based on specific business requirements.


Clustering in Action

Real-World Applications of Clustering Techniques

Clustering, a fundamental technique in data analysis, finds its applications across various industries and scenarios. In this section of the module, we explore real-world applications to showcase the practical significance of clustering techniques. Through interactive scenarios and hands-on experiences with free AI data analysis tools, learners gain valuable insights into how clustering can be effectively employed.

1. Customer Segmentation in E-Commerce:

  • Witness how clustering is applied to segment customers based on their purchasing behavior, preferences, and demographics. Understand how these customer segments can inform targeted marketing strategies and personalized recommendations.

  • Interactive Scenario: Use a free AI tool to cluster customers from an e-commerce dataset. Visualize the distinct customer segments and analyze their characteristics.

2. Healthcare Data Analysis:

  • Explore how clustering is utilized in healthcare to categorize patients with similar medical profiles. Witness how this technique contributes to the identification of patient cohorts, facilitating personalized treatment plans and improving healthcare outcomes.

  • Interactive Scenario: Apply clustering algorithms to healthcare data, grouping patients with similar conditions. Evaluate the potential impact on treatment strategies and resource allocation.

3. Anomaly Detection in Network Security:

  • Delve into the application of clustering for anomaly detection in network security. Understand how clustering helps identify unusual patterns or behaviors in network traffic, indicating potential security threats.

  • Interactive Scenario: Use clustering techniques to detect anomalies in a simulated network dataset. Explore the implications of early threat detection and proactive security measures.

4. City Planning and Urban Development:

  • Witness how clustering is employed in urban planning to categorize neighborhoods based on various factors such as demographics, infrastructure, and amenities. Explore how this information can guide city planners in making informed decisions for sustainable development.

  • Interactive Scenario: Use clustering algorithms to categorize neighborhoods within a city dataset. Visualize the clusters and analyze the key features influencing urban development.

Hands-On Exploration with Free AI Tools:

  • Tool Selection: Choose from popular free AI data analysis tools such as Google Colab, Jupyter Notebooks, or RStudio, ensuring accessibility for learners.

  • Guided Exercises: Engage learners in guided exercises that involve applying clustering algorithms to real-world datasets. Provide step-by-step instructions on loading data, selecting features, and interpreting clustering results.

  • Visualization Techniques: Emphasize the importance of visualization in understanding clustering outcomes. Encourage learners to create visually appealing and informative plots to communicate their findings.


Interactive Exploration #1

Scenario: Loan Approval Prediction

Background:

You are a data analyst at a financial institution tasked with improving the efficiency of the loan approval process. The traditional approach relies on manual evaluation, leading to delays and potential inaccuracies. The management has decided to leverage AI and classification algorithms to streamline the process.

Task:

Your objective is to build a classification model that predicts whether a loan application should be approved or denied based on various factors such as income, credit score, loan amount, and employment status.

Dataset:

Features:

  1. Income: Annual income of the applicant.
  2. Credit Score: The credit score of the applicant.
  3. Loan Amount: The requested loan amount.
  4. Employment Status: Current employment status of the applicant (e.g., employed, self-employed, unemployed).

Target Variable:

  • Loan Approval Status: Binary variable (1 for approved, 0 for denied).

Data Set (Sample):

IncomeCredit ScoreLoan AmountEmployment StatusLoan Approval Status
5000070020000Employed1
3000065015000Self-Employed0
7000075050000Employed1
2500060010000Unemployed0
8000072075000Employed1


Instructions:

Explore the Dataset:
  1. Use free AI data analysis tools to load and explore the dataset. Examine the distribution of features and the loan approval status.
  2. Keep track of the Prompts and tools you use to explore the data set and complete the exercises below. BE SPECIFIC. Examples are shared in the following pages. 

Apply Classification Algorithms:

  • Implement classification algorithms such as Logistic Regression, Decision Trees, or Random Forest to train a model on the historical loan data.

Evaluate and Optimize:

  • Evaluate the model's performance using metrics like accuracy, precision, recall, and F1-score. Optimize the model by fine-tuning hyperparameters.

Predict New Loan Applications:

  • Apply the trained model to predict the loan approval status for new applications. Assess the model's effectiveness in automating the approval decision-making process.

Data Exploration Example

AI Tool: Google Colab

Google Colab is a free, cloud-based platform that provides a Jupyter notebook environment with free access to GPU and TPU resources. It allows collaborative coding in Python and is widely used for machine learning tasks.

Prompt for Exploration:

Task: Exploring the Loan Approval Dataset

  1. Access Google Colab:

    • Open Google Colab in your web browser.
  2. Create a New Notebook:

    • Click on "File" -> "New Notebook" to create a new Jupyter notebook.
  3. Import Libraries:

    • In the first cell, import necessary Python libraries such as pandas, matplotlib, seaborn, and scikit-learn.
    python
    import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LogisticRegression from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
  4. Load and Explore the Dataset:

    • Load the loan approval dataset into your Colab environment.
    python
    # Load the dataset (replace 'your_dataset_path' with the actual path) dataset_path = 'your_dataset_path' df = pd.read_csv(dataset_path) # Display the first few rows of the dataset df.head()
  5. Visualize Data Distribution:

    • Use seaborn and matplotlib to create visualizations that depict the distribution of features and the loan approval status.
    python
    # Visualize the distribution of features and loan approval status plt.figure(figsize=(12, 8)) sns.pairplot(df, hue='Loan Approval Status', diag_kind='kde') plt.show()
  6. Preprocess Data:

    • Prepare the data for classification by encoding categorical variables and scaling numerical features.
    python
    # Encode categorical variables df_encoded = pd.get_dummies(df, columns=['Employment Status'], drop_first=True) # Split the data into features and target variable X = df_encoded.drop('Loan Approval Status', axis=1) y = df_encoded['Loan Approval Status'] # Split the data into training and testing sets X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) # Standardize numerical features scaler = StandardScaler() X_train_scaled = scaler.fit_transform(X_train) X_test_scaled = scaler.transform(X_test)
  7. Apply Logistic Regression:

    • Train a logistic regression model on the preprocessed data.
    python
    # Train a logistic regression model model = LogisticRegression() model.fit(X_train_scaled, y_train)
  8. Evaluate the Model:

    • Assess the model's performance using accuracy, precision, recall, and confusion matrix.
    python
    # Make predictions on the test set y_pred = model.predict(X_test_scaled) # Evaluate model performance accuracy = accuracy_score(y_test, y_pred) classification_report_result = classification_report(y_test, y_pred) confusion_matrix_result = confusion_matrix(y_test, y_pred) print(f"Accuracy: {accuracy}") print("Classification Report:\n", classification_report_result) print("Confusion Matrix:\n", confusion_matrix_result)
  9. Visualize Decision Boundaries (Optional):

    • If time permits, use additional code to visualize decision boundaries of the logistic regression model.
    python
    # Visualize decision boundaries (optional) # Note: This step requires additional code for feature extraction and plotting


What insights do you have related to the scenario exercise? What tools did you explore? 

Share specific tools & prompts used, outcomes, insights, and reflections. 300 words minimum. 

Interactive Exploration #2

Scenario: Disease Diagnosis Prediction

Background:

You are part of a healthcare analytics team aiming to improve the early detection of a specific disease. The traditional diagnostic process is time-consuming, and there is a need to leverage AI for accurate and rapid predictions. Your task is to build a classification model that predicts whether a patient is likely to have the disease based on various medical features.

Task:

Develop a classification model to predict the likelihood of the disease based on patient data, enabling early intervention and personalized treatment.

Dataset:

Features:

  1. Age: Age of the patient.
  2. Blood Pressure: Systolic and diastolic blood pressure readings.
  3. Cholesterol Level: Cholesterol level in the patient's blood.
  4. Symptoms: Binary indicators for common symptoms associated with the disease (e.g., fatigue, chest pain).

Target Variable:

  • Disease Status: Binary variable (1 for positive diagnosis, 0 for negative diagnosis).

Data Set (Sample):

AgeBlood Pressure (mmHg)Cholesterol LevelFatigueChest PainDisease Status
45120/80Normal101
60140/90High010
35110/70Normal111
50130/85High000
28115/75Normal101

Instructions:

  1. Explore the Dataset:

    • Use a free AI tool of your choice to load and explore the dataset. Examine the distribution of features and the disease diagnosis status.
  2. Preprocess Data:

    • Handle any missing values, encode categorical variables, and prepare the data for classification.
  3. Apply Classification Algorithms:

    • Implement classification algorithms such as Support Vector Machines (SVM), Random Forest, or K-Nearest Neighbors (KNN) to train a model on the patient data.
  4. Evaluate and Optimize:

    • Evaluate the model's performance using metrics like accuracy, precision, recall, and F1-score. Optimize the model by experimenting with different algorithms and hyperparameters.
  5. Predict Disease Status:

    • Apply the trained model to predict the disease status for new patient data. Analyze the model's predictions and identify potential areas for improvement.

Note:

  • Utilize the interactive features of the chosen AI tool to visualize the decision boundaries and interpret the model's predictions.
  • Engage in the self-paced exercises and simulations provided in the module to enhance your understanding of applying classification algorithms to real-world datasets.

Data Exploration Exemplar

Exemplar Student Response: Data Exploration Reflection

I chose to use Google Colab for exploring and analyzing the disease diagnosis dataset. The seamless integration with Python and the availability of essential libraries made it a suitable choice for this task.

Steps Taken:

  1. Access Google Colab:

    • I opened Google Colab in my browser and created a new notebook.
  2. Import Libraries:

    • In the first cell, I imported the necessary Python libraries, including pandas, matplotlib, seaborn, scikit-learn, and others.
    python
    import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
  3. Load and Explore the Dataset:

    • I loaded the disease diagnosis dataset into the Colab environment and displayed the first few rows.
    python
    # Load the dataset df = pd.read_csv('disease_diagnosis_dataset.csv') # Display the first few rows of the dataset df.head()
  4. Visualize Data Distribution:

    • Using seaborn, I created pair plots to visualize the distribution of features and the disease diagnosis status.
    python
    # Visualize the distribution of features and disease diagnosis status plt.figure(figsize=(12, 8)) sns.pairplot(df, hue='Disease Status', diag_kind='kde') plt.show()
  5. Preprocess Data:

    • I encoded the categorical variable ('Cholesterol Level') using Label Encoding and handled any missing values.
    python
    # Encode categorical variable label_encoder = LabelEncoder() df['Cholesterol Level'] = label_encoder.fit_transform(df['Cholesterol Level'])
  6. Explore Correlations:

    • Utilizing a heatmap, I explored correlations between variables to identify potential relationships.
    python
    # Explore correlations between variables correlation_matrix = df.corr() plt.figure(figsize=(10, 8)) sns.heatmap(correlation_matrix, annot=True, cmap='coolwarm', fmt=".2f") plt.title('Correlation Matrix') plt.show()

Reflection:

  • Insights from Visualization:

    • The pair plots revealed interesting patterns, especially in the relationship between age, blood pressure, and disease status. The visualizations hinted at potential predictive features.
  • Data Preprocessing Observations:

    • Label encoding the 'Cholesterol Level' variable simplified the classification process. Handling missing values was not a significant concern in this dataset.
  • Correlation Analysis:

    • The correlation matrix provided insights into the relationships between variables. Notably, blood pressure and age exhibited moderate correlations.
  • Next Steps:

    • Based on the initial exploration, I plan to experiment with different classification algorithms like Random Forest and fine-tune hyperparameters to optimize the model's performance.
  • Challenges Faced:

    • Understanding the nuances of feature relationships required iterative exploration. However, the visualizations and correlation analysis facilitated a clearer understanding.

What insights do you have related to the scenario exercise? What tools did you explore? 

Share specific tools & prompts used, outcomes, insights, and reflections. 300 words minimum. 


Interactive Exploration #3

Scenario: Customer Review Sentiment Analysis

Background:

You are part of a customer experience team for an e-commerce platform. Understanding customer sentiments is crucial for improving products and services. Your task is to perform sentiment analysis on customer reviews to identify positive, negative, and neutral sentiments. This analysis will guide product development and enhance customer satisfaction.

Task:

Conduct sentiment analysis on a dataset of customer reviews to categorize sentiments as positive, negative, or neutral.

Dataset:

Features:

  1. Review Text: The actual customer review text.
  2. Rating: Numeric rating provided by the customer (on a scale of 1 to 5).

Target Variable:

  • Sentiment Category: Categorized as Positive, Negative, or Neutral based on the review and rating.

Data Set (Sample):

Review TextRatingSentiment Category
"Absolutely love this product! Highly recommended."5Positive
"The quality is disappointing. Not worth the price."2Negative
"Average experience. Nothing special."3Neutral
"Amazing service and quick delivery!"4Positive
"Worst purchase ever. Regret buying it."1Negative

Instructions:

  1. Explore the Dataset:

    • Choose any free AI tool (e.g., Jupyter Notebooks, Google Colab, or Microsoft Azure Notebooks) to load and explore the dataset. Examine the distribution of review sentiments and ratings.
  2. Text Preprocessing:

    • Preprocess the review text by removing stop words, punctuation, and performing tokenization.
  3. Sentiment Analysis:

    • Implement Natural Language Processing (NLP) techniques to perform sentiment analysis. Use pre-trained models or libraries like NLTK or spaCy.
  4. Visualize Sentiment Distribution:

    • Utilize visualization tools within the chosen AI tool to display the distribution of sentiment categories.
  5. Explore Rating Impact:

    • Investigate how the numeric ratings correlate with the assigned sentiment categories. Visualize any patterns or trends.

Note:

  • Choose appropriate visualization techniques to represent sentiment distribution effectively.
  • Engage in the self-paced exercises and simulations provided in the module to enhance your understanding of sentiment analysis using AI tools.

Exemplar Student Reflection

For this sentiment analysis task, I opted to use Jupyter Notebooks due to its flexibility and support for various libraries, including NLTK for Natural Language Processing. The goal was to unravel customer sentiments hidden within the reviews and ratings.

Steps Taken:

  1. Access Jupyter Notebooks:

    • I launched Jupyter Notebooks locally and created a new notebook for this analysis.
  2. Import Libraries:

    • In the first cell, I imported essential Python libraries, including pandas, matplotlib, seaborn, NLTK, and scikit-learn.
    python
    import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import nltk from nltk.corpus import stopwords from sklearn.feature_extraction.text import CountVectorizer from sklearn.model_selection import train_test_split from sklearn.naive_bayes import MultinomialNB from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
  3. Load and Explore the Dataset:

    • I loaded the customer review dataset into the Jupyter environment and displayed initial insights.
    python
    # Load the dataset df = pd.read_csv('customer_review_dataset.csv') # Display the first few rows of the dataset df.head()
  4. Text Preprocessing:

    • Preprocessed the review text by removing stop words, punctuation, and performed tokenization using NLTK.
    python
    # Text preprocessing stop_words = set(stopwords.words('english')) df['Cleaned Review'] = df['Review Text'].apply(lambda x: ' '.join([word.lower() for word in nltk.word_tokenize(x) if word.isalpha() and word.lower() not in stop_words]))
  5. Sentiment Analysis with Naive Bayes:

    • Implemented sentiment analysis using the Naive Bayes classifier with CountVectorizer for text representation.
    python
    # Text representation using CountVectorizer vectorizer = CountVectorizer() X = vectorizer.fit_transform(df['Cleaned Review']) y = df['Sentiment Category'] # Split the data into training and testing sets X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) # Train the Naive Bayes classifier model = MultinomialNB() model.fit(X_train, y_train)
  6. Evaluate Model Performance:

    • Evaluated the model's performance on the test set and visualized the confusion matrix.
    python
    # Make predictions on the test set y_pred = model.predict(X_test) # Evaluate model performance accuracy = accuracy_score(y_test, y_pred) classification_report_result = classification_report(y_test, y_pred) confusion_matrix_result = confusion_matrix(y_test, y_pred) print(f"Accuracy: {accuracy}") print("Classification Report:\n", classification_report_result) print("Confusion Matrix:\n", confusion_matrix_result)

Reflection:

  • Insights from Text Preprocessing:

    • Removing stop words and punctuation helped streamline the text data, making it more suitable for analysis. The cleaned review text revealed essential patterns.
  • Model Performance Observations:

    • The Naive Bayes classifier performed reasonably well, achieving a notable accuracy. The classification report provided insights into precision, recall, and F1-score for each sentiment category.
  • Exploring Sentiment Distribution:

    • Visualization tools in Jupyter Notebooks allowed me to create insightful visualizations of sentiment distribution, providing a clear overview of positive, negative, and neutral sentiments.
  • Rating Impact Analysis:

    • Investigating the correlation between numeric ratings and sentiment categories revealed interesting patterns. Higher ratings tended to align with positive sentiments, validating our expectations.
  • Next Steps:

    • As a next step, I plan to explore more advanced NLP techniques and consider alternative algorithms to enhance sentiment analysis accuracy.
  • Challenges Faced:

    • Balancing the trade-off between model complexity and accuracy was a challenge. Experimenting with different preprocessing techniques and algorithms helped address this challenge.

Jupyter Notebooks proved to be an invaluable tool for exploring and analyzing customer review sentiments, offering a dynamic environment for experimentation and reflection.

What insights do you have related to the scenario exercise? What tools did you explore? 

Share specific tools & prompts used, outcomes, insights, and reflections. 300 words minimum. 


Lesson Summary

Lesson Summary: Unleashing the Power of AI in Data Analysis

Congratulations on completing the AI in Data Analysis lesson! Throughout this journey, you've embarked on a dynamic exploration of artificial intelligence, unraveling its transformative impact on the field of data analysis. 

Next Steps:

Your journey doesn't end here. As you move forward, continue to apply and refine your newfound skills in AI-driven data analysis. Stay curious, explore emerging trends, and embrace the ever-evolving landscape of artificial intelligence.

Best of luck on your continued exploration of AI in data analysis! Keep pushing boundaries, and may your analytical endeavors lead to groundbreaking insights and innovations.

Please complete the forum discussion and lesson assignment(s) when ready. 






 














Comments

Popular posts from this blog

GE5093 Design Thinking All Quizzes

  GE---5093-1D2-FA-2021 - Design Thinking Home My courses 2021-FA GE---5093-1D2-FA-2021 Week 1 Reading Quiz 1 Started on Sunday, October 31, 2021, 2:04 PM State Finished Completed on Sunday, October 31, 2021, 2:30 PM Time taken 25 mins 58 secs Grade 8.00  out of 10.00 ( 80 %) Top of Form Question  1 Correct 1.00 points out of 1.00 Flag question Question text A critical finding of Edward Lorenz related to Design Thinking was: Select one: a. An application of the caterpillar effect b. The idea of deterministic chaos or the "Butterfly Effect" c. Business leaders enjoy chaos d. Statistical modeling of weather was fairly accurate in the long term Feedback Your answer is correct. The correct answer is: The idea of deterministic chaos or the "Butterfly Effect" Question  2 Incorrect 0.00 point...

GE5103-2 Project Management [Aug 23 Syllabus]

    Some of the advantages of using time boxes and cycles in project coordination efforts include creating urgency, measuring progress, and allowing for predictable measurements. A)        True 2.    Even though most project managers are not contract specialists, they need to understand the process well enough to coordinate with the team. For the current assignment, you are looking at a short-term and small effort with a contractor of just a few hours without significant clarity. Which of the following would be the most applicable contract to use in this situation? A)        Time and materials 3. The project you are working on has had modifications to the plan from the start and even how the project is run. Project governance covers all of the 3 following except: A)        Naming The project manager 4. Of the following, which is most likely a trigger condition defined early in t...

IS-5113 Data Mining and Data Visualization [Jan 25 Syllabus]

  Lesson 1 Quiz One of the key differences between business analytics and data science is their primary focus either on business problems or on mathematical algorithms. True Analytics and analysis are essentially the same thing; they both focus on the granular level representation of complex problems through decomposition of the whole into its lower-level parts. False If a data scientist is analyzing historical data to identify problems and root causes, he/she is essentially conducting descriptive analytics. True ERP stands for enterprise resource planning and is used for the integration of company-wide data. True The most important driver behind business analytics popularity is the need for business managers to make experience and intuition driven business decisions. False Business analytics and data science have the same purpose: to convert data into actionable insight through an algorithm-based discovery process. True Major commercial business intelligence products and services...