Open In App

Data Mining Query Language

Data Mining is a process is in which user data are extracted and processed from a heap of unprocessed raw data. By aggregating these datasets into a summarized format, many problems arising in finance, marketing, and many other fields can be solved. In the modern world with enormous data, Data Mining is one of the growing fields of technology that acts as an application in many industries we depend on in our life. Many developments and researches have been held in this field and many systems are also been disclosed. Since there are numerous processes and functions to be done in Data Mining, a very well developed user interface is needed. Even though there are many well-developed user interfaces for the relational systems, Han, Fu, Wang, et al. proposed the Data Mining Query Language(DMQL) to further build more developmental systems and innovate many kinds of research in this field. Though we can’t consider DMQL as a standard language. It is a derived language that stands as a general query language to perform data mining techniques. DMQL is executed in DB miner systems for collecting data from several layers of databases.

Ideas in designing DMQL:

DMQL is designed based on Structured Query Language(SQL) which in turn is a relational query language.



The four parameters of data mining:

Basic syntax in DMQL:

DMQL acquires syntax like the relational query language, SQL. It is designed with the help of Backus Naur Form (BNF) notation/ grammar. In this notation, “[ ]” or “{ }” denotes 0 or other possibilities. 

 To retrieve relevant dataset:

Syntax:



use database (database_name)
{use hierarchy (hierarchy_name) for (attribute)}
(rule_specified)
related to(attribute_or_aggreagate_list)
from(relation(s)) [where(condition)]
[order by(order_list)]
{with [(type_of)] threshold = (threshold_value) [for(attribute(s))]}

In the above data-mining query, the first line retrieves the required database (database_name). The second line uses the hierarchy one has chosen(hierarchy_name) with the given attribute. (rule_specified) denotes the types of rules to be specified. To find out the various specified rules, one must find the related set based on the attribute or aggregation which helps in generalization. The from and where clauses make sure of the given condition being satisfied. Then they are ordered using “order by” for a designated threshold value with respect to attributes.

 For the rules in DMQL:

Syntax:

Generalization:

generalize data [into (relation_name)]

Association:

find association rules [as (rule_name)]

Classification:

find classification rules [as (rule_name) ] according to [(attribute)]

Characterization:

find characteristic rules [as (rule_name)]

Discrimination:

find discriminant rules [as (rule_name)]
for (class_1) with (condition_1)
from (relation(s)_1)
in contrast to (class_2) with (condition_2)
from (relation(s)_2)
{ in contrast to (class_i) with (condition_i)
from (relation(s)_i)}

Kinds of thresholds in rule mining:

In the process of data mining, maintaining a set of threshold values is very important in extracting useful and engaging datasets from a heap of data. This threshold value also helps in measuring the relevance of the data and it helps in a driving search for interesting datasets.

The types of thresholds in rule mining can be categorized into three classes.

Syntax: 

with (threshold_name) threshold = value_of_threshold

Example: 

with confidence threshold = 0.9
with redundancy threshold = 0.04

Representation of concept hierarchies:

Concept hierarchies help in the precise data mining process. This works based on the relationships and the grouping of data. This concept hierarchy must be flexible to make changes dynamically when new datasets are encountered.

Using the relationships between the attributes of a dataset, the conceptual hierarchy can be specified at the schema level. 

Query:

define hierarchy student_result_hierarchy on marks as [year, department, class, section]

In the above example, the attribute department is more general than the student’s year but less general than the class and section in which the student studies. Now take an example of built-in hierarchy at schema level:

Query:

define hierarchy period_hierarchy on date as [day, month, year]

In this, the hierarchy is specified based on concept grouping techniques which provide the obvious appearance of lower and higher levels.

define hierarchy age_hierarchy for book on audience as
level1: {children, young_adult, adult} < level0: all
level2:{8, ..., 12} <level1: children
level3:{13, ..., 18} <level1: young_adult
level4:{19, ..., 100} <level1: adult

In the above example, the category of a book is grouped with age sets or ranges.

In this hierarchy, the data is in form of numerical attributes. It can be done by comparing ranges or even by clustering using data algorithms.

define hierarchy age_hierarchy for book on audience as
{age_group(1), ..., age_group(3)}  
:= cluster(default, age, 3) < all(age)

In this hierarchy, the specification is done based on rules. There will be a small number of rules at the lower level and increases in higher levels.

define hierarchy book_royalty_hierarchy on book as
level1: low_royalty < level0: all

if ( maximum_selling_price)< Rs. 300
 level_1:  moderate-royalty < level_0:  all
 
if ((maximum_selling_price) > Rs. 300)  and ((maximum_selling_price) ≤ Rs. 275))  
  level_1:  high_royalty < level_0:  all

In the above example, the royalty that the author gets for his book based on the range of Maximum Selling Price (MRP) is explained using a rule-based hierarchy.

For the presentation of pattern:

To enhance the experience of the user, the user can request a specified dataset or pattern to see in a specified format.

Syntax:

display as (result_format)

Example:

display as graph

Specification of DMQL in a book database:

Consider a book database with the below schema.

Query:

book( book_name, book_id, book_category,genre, book_type)
author(author_name,phone_no,address)
publishing(publisher_name, publishing_id,cost)
buyer(buyer_name,buyer_id,buyer_address)

As the marketing manager of a national publishing house, Joel wants to characterize the purchasing trends of buyers of a book that is priced at no less than Rs.300 concerning the book category, type of book (e-book/paperback), and the genre in which the buyers purchased. The aim is to find the percentage of buyers with the given characteristic trend. Joel is only interested in purchases made as an e-book. He wants to display the resulting data in form of a table.

Query:

use database national_publisher
use hierarchy age_hierarchy for B.category
mine characteristics as buyerPurchasing
analyze sell%
related to B.category,B.type,B.genre
from buyer X, Book B, purchase P, books_sold S, book_category C
where B.ID = S.book_ID and P.buyer_ID = X.buyer_ID and
B.type = "ebook" and B.price ≥ 300
with noise threshold = 0.7%
display as table 

In the field of data mining, efficient Graphic User Interfaces(GUI) are required to perform efficient functions. In GUI, relational database languages like SQL play a major role in creating many developmental systems. But we can consider DMQL as a core query language to perform any applications specifically based on data mining which helps in building a more effective GUI. The collection, manipulation, and presentation of data in data mining become easy if one standardizes the use of DMQL as the core query langue for data mining processes. DMQL has many advantages in Data Mining. But, it still has limitations. When it comes to developed GUI’s where graph or improved presenting structure is used, it becomes difficult to locate places. So, only after severe experimenting DMQL can replace SQL as a core query language in data mining.


Article Tags :