0% found this document useful (0 votes)
9 views8 pages

Assignment 02 Application of ICT

Uploaded by

gokuultraincnt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views8 pages

Assignment 02 Application of ICT

Uploaded by

gokuultraincnt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Department of Computer Science

Application of Information Communication Technology

CS-100

Assignment # 2
Due Date: Monday 26-Nov-2024 @ 12:00 pm

Student Details:
Name: Muhammad Taha
NUST ID: 518133
Semester: Fall 2024 Batch: CS-24

Obtained Marks:
Total Marks: 20

Important Instruction
Fill in your information on the cover page.
Make your work clear and well-presented.
LATE submission will result in marks-deduction.
Copying from other students or resources will result in ZERO mark.
Number all the subsequent pages properly.

1
Department of Computer Science

All Questions carry equal marks:


Question 1:
SQL vs. NoSQL for E-Commerce Scalability:
 Compare and contrast the use of SQL and NoSQL databases for managing an e-
commerce site during peak shopping periods. Which type would you recommend for
handling high traffic and large-scale transactions, and why?
Answer

SQL:
“SQL Database is Relational Database which is structured database and use predefined schemas.”
Examples: MySQL, PostgreSQL, Oracle.

Advantages for E-Commerce:


SQL is based on relational database which consist of tables including rows and columns
which makes them suitable for handling complex queries and various transaction techniques.
1. Data Consistency and Integrity:
 SQL maintain strict ACID compliance which is essential for E-Commerce application
where financial transactions require high reliability.
2. Structured Data:
 SQL are beneficial for structure, uniform data like inventory management and
customer record.
3. Complex Queries:
 SQL is used for complex, multi joint tables often needed in e-commerce for analytics,
reporting and scaling.

Challenges:
1. Vertical Scaling:
 As SQL scales vertically which can be limited and expensive at high scale.
2. Complexity with Distributed System:
 Some SQL Database support horizontal scaling, achieving horizontal scaling with
SQL Database is more complex than NoSQL database options.

NoSQL:
“NoSQL database are schema-less and can handle unstructured or semi-structured data offering flexible
data models.”

Example:

2
Department of Computer Science

Advantages for E-Commerce:


NoSQL is also preferred for application requiring high scalability and handling large amount
of varied data.
1. Horizontal Scalability :
 NoSQL database are designed for distributed architecture which makes it easy to
scale horizontally across multiple servers.
2. Flexible Data Modeling :
 NoSQL is beneficial for application dealing with various data formats, like product
details or customer personalization.
3. Speed and Performance :
 For heavy application NoSQL can handle work load very efficiently. That’s why it
used mainly used for applications having high input and high output.

Challenges:
1. Eventual Consistency:
 NoSQL may not be ideal for transactions requiring immediate accuracy. Because in
longer terms NoSQL database may not remain consistent and accurate.
2. Complex Query Limitation:
 NoSQL databases may struggle with complex queries as they lack the accurate
querying capabilities found in SQL.

Consideration for E-Commerce:


In an e-commerce context, choosing between SQL and NoSQL for scalability depends on specific needs
such as data structure, transaction requirements, and scalability flexibility.

1. Scalability:
 For handling large-scale traffic and data across distributed systems, NoSQL is often
preferred due to its flexibility with horizontal scaling.
2. Transaction Requirement:
 If the e-commerce application needs strong consistency for transactions, SQL
databases are generally more reliable.
3. Data Structure:
 SQL is optimal for structured data, while NoSQL works well with semi-structured or
unstructured data, useful for product recommendations or user-generated content.
4. Speed and Real-Time Processing:
 For applications needing fast reads and writes with less focus on consistency, like
real-time inventory updates, NoSQL can provide better performance.

Question 2:
Describe the following AI-Algorithms along with examples.
1) linear regression, 2) decision trees, 3) clustering

3
Department of Computer Science

Answers:

1) Linear Regression:
“Linear Regression is supervised learning. It forms the relation between Dependent variable and
an independent variable.”
Regression: “The term regression is used when you try to find the relationship between
variables.”
 It is commonly used to predict outcome based on the input.
Example: A business can use linear regression to predict the growth of their business
based on the sales and products. Business can also use the previous data to determine
their marketing through linear regression.
 In ML a special Python library is used for Linear Regression as given below:
import matplotlib.pyplot as plt
 Linear regression make it a good start to predict various things in health and finance.
 The relation between dependent and independent variables in linear regression is shown
in given figure:

And that model can be used to predict the further outcome


2) Decision Tree:
“A Decision Tree is a Flow Chart which can help us to make decisions based on previous
experiences.”
 Decision trees are versatile models used for both classification and regression tasks.
 A decision tree splits data into branches based on feature to reach a decision.
 The model is intuitive because it mimics human decision-making ability by breaking
down complex questions into smaller modules until it reaches an outcome .
 Here also a special Python library is used for Decision Tree as given below:
import pandas
from sklearn import tree
from sklearn.tree import DecisionTreeClassifier

3) Clustering:
“Clustering is an unsupervised learning technique that groups data points into clusters based on similarity. ”
Cluster: “In machine learning clusters refer to groups of data points that share similar characteristics. ”
 Here is graph example for clustering:

4
Department of Computer Science

 Here also a special Python library is used for Clustering as given below:
from sklearn.cluster import KMeans
 There are different types of Clustering Models and Algorithms given below:
i. K means Clustering:
“This popular algorithm assigns each data point to one of K
clusters by minimizing the distance between points and their
cluster centroid”
ii. Hierarchical Clustering:
“This method creates a hierarchy of clusters, either by
starting with individual points and merging them or by
splitting one large cluster into smaller clusters.”
iii. DBSCAN:
“DBSCAN groups points that are closely packed and marks
points that fall outside these dense clusters.”

Question 3:
Discuss all cloud based services in detail and explain each service with respect to provision of
services in education.
1) IaaS 2) PaaS 3) SaaS
Answers:
Cloud-based services like IaaS (Infrastructure as a Service), PaaS (Platform as a Service), and
SaaS (Software as a Service) are widely used in educational setting for unique purposes to
support institutions, educators, and students.

1) IaaS:
“Infrastructure as a service (IaaS) is a type of cloud computing service that offers essential
compute, storage, and networking resources on demand, on a pay-as-you-go basis. IaaS is one of
the four types of cloud services.”
 Schools and universities can manage their operating systems, applications, and data while
outsourcing the hardware layer. This enables institutions to expand or contract their
infrastructure based on demand, such as during exam periods or online admissions.

5
Department of Computer Science

 IaaS also supports research by providing high-performance computing for data-intensive


projects without purchasing specialized hardware.
 IaaS lets you bypass the cost and complexity of buying and managing physical servers
and datacenter. Each resource is offered as a separate service component. And you only
pay for a particular resource for as long as you need it.

2) PaaS:
“Platform as a service (PaaS) is a complete development and deployment environment in the
cloud with resources that enable you to deliver everything from simple cloud-based apps to
sophisticated and cloud enabled applications.”
 PaaS supports quicker and cost effective application development and reduces
administrative problems allowing schools to focus on educational content.
Example: Universities also can use PaaS to develop and deploy educational tools,
student portals, or learning management systems (LMS). Like NUST is using Qalam
which is created on Odoo an example of PaaS.
 Google App Engine and Microsoft Azure App Service are common PaaS solutions in
education.
3) SaaS:
“Software as a service (SaaS) is a software distribution model in which a cloud provider hosts
applications and makes them available to end users over the internet.”
 SaaS provides ready to use applications over the internet through subscription models
which make it a perfect solution for many educational needs.
 SaaS is especially beneficial in education because it allows seamless access from
anywhere, reduces the need for software updates or maintenance, and is cost-effective.

Question 4: Discuss the application of following AI libraries/framework in image processing


domain.
1) Tensor Flow, 2) Keras, 3) Scikit-learn.
Answers:

1. Tensor Flow:
6
Department of Computer Science

“Tensor Flow is a powerful library for image classification, object detection, and
image segmentation.”
 In image classification, Tensor Flow enables building neural networks

 Tensor Flow can load and preprocess datasets of images and then apply
transformations for training deep learning models on these datasets.
 It provides tools for handling large amounts of data, making it efficient for
real-time image processing task.
2. Keras:
“Keras simplifies deep learning model creation, particularly for image processing.”
 It’s commonly used for tasks like recognizing handwritten digits or animals
in images.
 Using Keras with Tensor Flow allows models to be fine-tuned for specific
image tasks, such as object detection in medical imaging.
 Keras 3 is a deep learning framework works with Tensor Flow, JAX, and
PyTorch interchangeably.
 Here also a special Python library is used for Keras as given below:
Import keras

3. Scikit-Learn:
“Scikit-learn is a powerful and widely used open source Python library for machine
learning.”
 Scikit-learn provides simple and efficient tools for data analysis and
modeling.
 Scikit-learn is especially popular due to its ease of use and broad range of machine
learning algorithms and utilities.
 Special Python library in is used for as given below:
from sklearn.ensemble import RandomForestClassifier

7
Department of Computer Science

Advantages:
 Easy to learn and implement.
 Extensive documentation and community support.
 Integrates well with real world data processing pipelines.

You might also like