Detailed Notes on Altair AI Studio, Excel Functions, Sentiment
Analysis, and Pandas
This document explains important processes in Altair AI Studio, Excel functions, lexicon-based
sentiment analysis, and common Pandas functions in Python. All explanations are written in
simple and easy language.
1. Sentiment Analysis Process in Altair AI Studio
1. Retrieve Data: Retrieve Data is the first step in Altair AI Studio. It is used to import or load
the dataset into the software. The data may come from CSV files, Excel files, databases, or
online sources. Without loading data, no analysis can be performed.
2. Nominal to Text: Nominal to Text converts categorical or nominal values into text format.
This is important because text mining operators work only with text data. For example,
product reviews or comments need to be in text form before processing.
3. Process Documents from Data: This operator prepares text data for analysis. It cleans and
organizes the text so the computer can understand it better. Important steps inside this
operator are:
- Tokenize: Splits sentences into individual words.
- Stopwords Removal: Removes common words such as 'is', 'the', and 'and'.
- Transform Cases: Converts all text into lowercase or uppercase.
- Stemming: Converts words into their root form. For example, 'playing', 'played', and 'plays'
become 'play'.
4. Extract Sentiment (VADER): This step identifies the sentiment or emotion of the text.
VADER is a sentiment analysis model mainly used for social media and reviews. It classifies
text into positive, negative, or neutral sentiment. For example, 'The movie was amazing' gives
positive sentiment.
2. K-Means Clustering Process in Altair AI Studio
5. Retrieve Data: The dataset is loaded into Altair AI Studio for clustering analysis.
6. Normalize: Normalization reduces scale differences between attributes. For example, age
values may range from 1–100 while salary values may range from 10,000–100,000. Without
normalization, large values can dominate the clustering result.
7. Find and Use K-Means Clustering: K-Means clustering is an unsupervised machine
learning algorithm. It groups similar data points into clusters. The value of K represents the
number of clusters. For example, customers can be grouped into 3 clusters based on
purchasing behavior.
8. Cluster Distance Performance: This operator measures the quality of clusters. It calculates
distances between data points and cluster centers. Smaller distances mean better clustering
performance.
3. Excel Functions
RANDBETWEEN
Example: =RANDBETWEEN(1,100)
This function generates a random whole number between two numbers. It is useful for
simulations, games, and random sampling.
RAND
Example: =RAND()
This function generates a random decimal number between 0 and 1. It changes automatically
whenever the worksheet recalculates.
VLOOKUP
Example: =VLOOKUP(101,A2:C10,2,FALSE)
VLOOKUP searches for a value in the first column of a table and returns a matching value
from another column. It is commonly used for finding student names, prices, or employee
information.
Remove Duplicates
Example: Data → Remove Duplicates
This feature removes repeated data from a table or dataset. It helps keep only unique values
and improves data accuracy.
4. Lexicon-Based Sentiment Analysis
Lexicon-based sentiment analysis is a method used to identify emotions in text by using a
predefined dictionary of positive and negative words.
How it works:
- Positive words increase the positive score.
- Negative words increase the negative score.
- Final sentiment is decided from the scores.
Example:
Sentence: 'The service was excellent and fast.'
Words like 'excellent' and 'fast' are positive words, so the result becomes positive sentiment.
5. Pandas Functions in Python
Pandas is a Python library used for data analysis and data manipulation. It helps users work with
rows, columns, tables, and datasets easily.
import pandas as pd
# Read dataset
dt = pd.read_csv(r"/content/sample_data/mnist_train_small.csv")
# Number of dimensions
print([Link])
# Memory used by dataset
print([Link])
# Statistical summary
print([Link]())
# Not equal to zero
print([Link](0).head())
# Largest values
print([Link](5, [Link][0]))
# Smallest values
print([Link](5, [Link][0]))
# Check non-null values
print([Link]().head())
# Check non-missing values
print([Link]().head())
9. describe(): describe() provides statistical information about numeric columns such as count,
mean, standard deviation, minimum, and maximum values. It is useful for understanding the
dataset quickly.
10. ndim: ndim returns the number of dimensions of the dataset. A DataFrame usually has 2
dimensions because it contains rows and columns.
11. nbytes: nbytes shows the total memory used by the dataset in bytes. It helps measure
memory consumption.
12. ne(): ne means 'not equal'. It compares values and returns True if values are different.
13. nlargest(): nlargest() returns the rows with the largest values from a column. It is useful for
finding top scores or highest sales.
14. nsmallest(): nsmallest() returns rows with the smallest values from a column. It is useful for
finding lowest scores or minimum prices.
15. notna(): notna() checks whether values are not missing. It returns True for available values.
16. notnull(): notnull() is similar to notna(). It checks whether values are not null.
6. Example Outputs and Meanings
Example Output for ndim:
2
Meaning: The dataset has rows and columns.
Example Output for notnull():
True True True
Meaning: The values exist and are not empty.
Example Output for describe():
count mean min max
Meaning: It shows statistical summaries of the dataset.
7. Why These Functions Are Used
describe() is used for quick statistical analysis.
ndim is used to check dataset structure.
nbytes is used to check memory usage.
ne() is used for comparison operations.
nlargest() is used to find top values.
nsmallest() is used to find lowest values.
notna() and notnull() are used to identify missing data.