# Determine attribute importance for survival in the sinking of the Titanic
# based on pasenger's sex, age, class, etc.
## Not run:
# DB <- RODM_open_dbms_connection(dsn="orcl11g", uid="rodm", pwd="rodm")
#
# data(titanic3, package="PASWR")
# db_titanic <- titanic3[,c("pclass", "survived", "sex", "age", "fare", "embarked")]
# db_titanic[,"survived"] <- ifelse(db_titanic[,"survived"] == 1, "Yes", "No")
# RODM_create_dbms_table(DB, "db_titanic") # Push the table to the database
#
# # Create the Oracle Data Mining Attribute Importance model
# ai <- RODM_create_ai_model(
# database = DB, # Database ODBC connection
# data_table_name = "db_titanic", # Database table containing the input dataset
# target_column_name = "survived", # Target column name in data_table_name
# model_name = "TITANIC_AI_MODEL") # Oracle Data Mining model name to create
#
# attribute.importance <- ai$ai.importance
# ai.vals <- as.vector(attribute.importance[,3])
# names(ai.vals) <- as.vector(attribute.importance[,1])
#
# #windows(height=8, width=12)
# barplot(ai.vals, main="Relative survival importance of Titanic dataset attributes",
# ylab = "Relative Importance", xlab = "Attribute", cex.names=0.7)
#
# ai # look at the model details
#
# RODM_drop_model(DB, "TITANIC_AI_MODEL") # Drop the model
# RODM_drop_dbms_table(DB, "db_titanic") # Drop the database table
#
# RODM_close_dbms_connection(DB)
# ## End(Not run)
Run the code above in your browser using DataLab