BADM 211 Exam 2 – Questions With
Comprehensive Solutions
Save
Terms in this set (105)
- Pattern or relationship between a set of variables,
where all of them have equal status
- Goal: Segment data into meaningful segments;
Unsupervised learning detect patterns- - There is no target (outcome)
variable to predict or classify
- uses machine learning algorithms to analyze and
cluster unlabeled datasets
Pattern or relationship between an outcome (target)
variable and a set of predictor variables.
Features:
- Goal: predict a single "target" or "outcome"
Supervised learning
variable
- Training data, where value is known
- Test data, where value is unknown
- Methods: classification and regression
Reinforcement learning An agent learns in an environment
- Goal: predict numerical target (outcome) variable
- Examples: sales, revenue, performance
Supervised: Regression
- Each row is a case (customer, tax return, applicant)
- Each column is a variable
- Goal: predict categorical target (outcome) variable
- Examples: purchase/no purchase, fraud/no fraud
- Each row is a case (customer, tax return, applicant)
Supervised: Classification - Each column is a variable
- Target variable is often binary (yes/no)
- Classification and regression constitute "predictive
analysis"
, - Goal: Segment data into meaningful segments;
detect patterns
- There is no target (outcome) variable to predict or
Unsupervised learning
classify
- Methods: association rules, collaborative filters,
and data reduction, exploration, visualization
Display # of samples and variables/rows and
data.df.shape
columns
data_df.head(10) Display the first 10 rows of df
data_df.tail(10) Display the last 10 rows of the df
data_df.columns Display variable names
data_df.dtypes Display the variable data types
Display variable sequence numbers, names, missing
data_df.info()
values, and datatypes
Strip leading and trailing data_df.columns = [s.strip().replace(' ', '_') for s in
spaces and replace any data_df.columns]
remaining spaces with an
underscore _
d = {'animal type ': ['dog', 'cat', 'bird'],'age in years': [1,
2, 3],'size':['6', '8', '10'],'city of residence': ['miami',
Create a dummy
'chicago', 'london']}
dataframe
df = pd.DataFrame(data = d)
df
iloc = only integer numbers, second index is
exclusive
Iloc v. loc
loc = label-based (can be integer labels), second
index is inclusive
- use categorical variables as independent
What is dummy coding variables/predictors while modeling. only uses ones
and zeros.
Predictor and outcome X = predictors
variables y = outcome
, Train: fit the model
Train v. test data Test: test model prediction and accuracy
train_X, train_y, test_X, test_y
1. load linear regression algorithm into "model_1m"
Creating a linear 2. Use "fit" method to fit linear regression
regression model 3. Print coefficients
4. Check performance results
df = pd.DataFrame({"animal type ": animal_type,
"age in years": age,
Turning lists to columns
"size": size,
"city of residence": city})
data.df.iloc[0:4] Display the first four rows
data_df['Personal_Income' All display first 10 rows of the variable
].iloc[0:10]
data_df.iloc[0:10]
['Personal_Income']
data_df.iloc[0:10].Personal
_income
data_df["personal_income Display the first 5 rows of data
"].head()
What are the various Business understanding > data understanding > data
steps of the Crisp DM preparation > modeling > evaluation > deployment
model?
What is the difference Supervised learning problems have an outcome
between Supervised and variable, while unsupervised ones don't
Unsupervised learning?
Which unsupervised Clustering (KMeans)
learning algorithm have
we learned so far in this
course?
Which supervised Classification and regression
learning algorithm do we
cover in this course?
Comprehensive Solutions
Save
Terms in this set (105)
- Pattern or relationship between a set of variables,
where all of them have equal status
- Goal: Segment data into meaningful segments;
Unsupervised learning detect patterns- - There is no target (outcome)
variable to predict or classify
- uses machine learning algorithms to analyze and
cluster unlabeled datasets
Pattern or relationship between an outcome (target)
variable and a set of predictor variables.
Features:
- Goal: predict a single "target" or "outcome"
Supervised learning
variable
- Training data, where value is known
- Test data, where value is unknown
- Methods: classification and regression
Reinforcement learning An agent learns in an environment
- Goal: predict numerical target (outcome) variable
- Examples: sales, revenue, performance
Supervised: Regression
- Each row is a case (customer, tax return, applicant)
- Each column is a variable
- Goal: predict categorical target (outcome) variable
- Examples: purchase/no purchase, fraud/no fraud
- Each row is a case (customer, tax return, applicant)
Supervised: Classification - Each column is a variable
- Target variable is often binary (yes/no)
- Classification and regression constitute "predictive
analysis"
, - Goal: Segment data into meaningful segments;
detect patterns
- There is no target (outcome) variable to predict or
Unsupervised learning
classify
- Methods: association rules, collaborative filters,
and data reduction, exploration, visualization
Display # of samples and variables/rows and
data.df.shape
columns
data_df.head(10) Display the first 10 rows of df
data_df.tail(10) Display the last 10 rows of the df
data_df.columns Display variable names
data_df.dtypes Display the variable data types
Display variable sequence numbers, names, missing
data_df.info()
values, and datatypes
Strip leading and trailing data_df.columns = [s.strip().replace(' ', '_') for s in
spaces and replace any data_df.columns]
remaining spaces with an
underscore _
d = {'animal type ': ['dog', 'cat', 'bird'],'age in years': [1,
2, 3],'size':['6', '8', '10'],'city of residence': ['miami',
Create a dummy
'chicago', 'london']}
dataframe
df = pd.DataFrame(data = d)
df
iloc = only integer numbers, second index is
exclusive
Iloc v. loc
loc = label-based (can be integer labels), second
index is inclusive
- use categorical variables as independent
What is dummy coding variables/predictors while modeling. only uses ones
and zeros.
Predictor and outcome X = predictors
variables y = outcome
, Train: fit the model
Train v. test data Test: test model prediction and accuracy
train_X, train_y, test_X, test_y
1. load linear regression algorithm into "model_1m"
Creating a linear 2. Use "fit" method to fit linear regression
regression model 3. Print coefficients
4. Check performance results
df = pd.DataFrame({"animal type ": animal_type,
"age in years": age,
Turning lists to columns
"size": size,
"city of residence": city})
data.df.iloc[0:4] Display the first four rows
data_df['Personal_Income' All display first 10 rows of the variable
].iloc[0:10]
data_df.iloc[0:10]
['Personal_Income']
data_df.iloc[0:10].Personal
_income
data_df["personal_income Display the first 5 rows of data
"].head()
What are the various Business understanding > data understanding > data
steps of the Crisp DM preparation > modeling > evaluation > deployment
model?
What is the difference Supervised learning problems have an outcome
between Supervised and variable, while unsupervised ones don't
Unsupervised learning?
Which unsupervised Clustering (KMeans)
learning algorithm have
we learned so far in this
course?
Which supervised Classification and regression
learning algorithm do we
cover in this course?