Professional Documents
Culture Documents
COMPUTERAPPLICATIONS ]
[BATCH:2019-2022]
PROJECTWORK-I
“COVID-19CASES PREDICTION WITH PYTHON”
[SEMESTER-5]
SUBMITTED BY :- SUBMITTED TO :-
Parneet kaur-1928452 DR. KIRTI
Gurwinder kaur-1928406
Index
S. No. Content Page No. Remarks
1 Declaration 3
2 Abstract 4
3 Acknowledgemnt 5
4 Chapter 1 1.1 Introduction Of Project 6
1.2 Aim & Purpose 6
1.3 Introduction of 6-10
technology
5. Chapter 2 2.1 Project Overview
11
2.1.1 Objectives 11
2.1.2 SRS 12
2.1.3 Hardware 12
Specifications
2.1.4 Software 12
Specifications
6. Chapter 3 3.1 Introduction to Front 13-15
End
7. Chapter 4 4.1 ER Diagram 16-17
8. Chapter 5 5.1 Testing 18
2
DECLARATION
Theprojectsubmittedherewithisaresultofmyowneffortsintotalityandineve
ry aspects of the project works. All information that has been
obtainedfromothersourceshad beenfullyacknowledged.
TheprojectissubmittedtothecollegeCGCTechnicalcampusJhanjeri.Forthep
artial fulfilment oftheBachelorof ComputerApplication.
Ialsodeclarethatthisprojectreporthasnotbeenpreviouslysubmittedtoanyot
herUniversity.
TeamName&Roll.No.
1. Parneet kaur-1928452
2. Gurwinder kaur-1928406
3. Mandeep kaur-1928433
4. Simranjeet kaur-1928483
3
ABSTRACT
Tic-tac-toe is a fun game played by two players. Before starting the game, a 3x3 square grid is formed
using two vertical and two horizontal lines. The player who succeeds in placing three of their marks in a
horizontal, vertical, or diagonal row is the winner. In this study, we develop a computer program where a
player can challenge artificial intelligent heuristic approach (opponent) to win the game. We want to
prove that artificial intelligent heuristic approach enables in giving a great performance for development
of tic-tac-toe game.
TeamName&Roll.No.
Parneet kaur-1928452
Gurwinder kaur-1928406
Mandeep kaur-1928433
Simranjeet kaur-1928486
4
ACKNOWLEDGEMENT
TeamName&Roll.No.
Parneet kaur-1928452
Gurwinder kaur-1928406
Mandeep kaur-1928433
Simranjeet kaur-1928486
5
INTRODUCTION
Our project name is Tic-Tac-Toe game. This game is very popular and is fairlysimplebyitself.It
isactuallyatwoplayer game.Inthis game,thereis a board with n x n squares. In our game, it is 3 x 3
squares.The goal of Tic-Tac-Toe is to be one of the players to get three same symbolsinarow-
horizontally, vertically ordiagonally-ona3x3 grid.
Why Python?
Python is a general-purpose, and high-level programming language which is best known for its efficiency
and powerful functions. Python is loved by data scientists because of its ease of use, which makes it more
accessible. Python provides data scientists with an extensive number of tools and packages to build
6
machine learning models. One of its special features is that we can build various machine learning with
less-code.
Steps Involved
First, let’s check the steps to build Tic Tac Toe program in Python:
Create the display window for our game.
Draw the grid on the canvas where we will play Tic Tac Toe.
Draw the status bar below the canvas to show which player’s turn is it and who wins the game.
When someone wins the game or the game is a draw then we reset the game.
We need to run our game inside an infinite loop. It will continuously look for events and when a user
presses the mouse button on the grid we will first get the X and Y coordinates of the mouse. Then we
will check which square the user has clicked. Then we will draw the appropriate ‘X’ or ‘O’ image on
the canvas. So that is basically what we will do in this Python project idea
Tkinter
Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides a fast and
easy way to create GUI applications. Tkinter provides a powerful object-oriented interface to the Tk
GUI toolkit.
Creating a GUI application using Tkinter is an easy task. All you need to do is perform the following
steps −
Import the Tkinter module.
Create the GUI application main window.
Add one or more of the above-mentioned widgets to the GUI application.
Enter the main event loop to take action against each event triggered by the user.
NUMPY:-
BasicIntro:
NumPy(NumericalPython)isanopen-sourcePythonlibrarythat’susedinalmosteveryfieldofscience
andengineering.
UniversalstandardforworkingwithnumericaldatainPython
NumPy API is used extensively in Pandas, SciPy, Matplotlib, scikit-learn, scikit-image
andmostotherdatascience andscientificPythonpackages.
TheNumPylibrarycontainsmultidimensionalarrayandmatrixdatastructures
Itprovidesn-darray,ahomogeneousn-dimensionalarrayobject,withmethodstoefficientlyoperateon it.
It is usedtoperformawidevarietyofmathematical operationsonarrays.
DifferencebetweenaPythonListandaNumPyArray:
Pythonlistcancontaindifferentdatatypeswithinasinglelist
ElementsinaNumPyarrayshouldbehomogeneous.
NumPyarraysarefasterandmorecompactthanPythonlists.
7
Anarrayconsumeslessmemoryandisconvenienttouse.
NumPyarrayusesmuchlessmemory tostoredata.
DataTypesinNumPy: -
NumPyhassomeextradatatypes,andrefertodatatypeswithonecharacter,likeiforintegers,uforunsignedinte
gersetc.
BelowisalistofalldatatypesinNumPy andthe charactersused to representthem.
i – integer
b - Boolean
u - unsigned integer
f - float
c - complex float
m - time delta
M - datetime
O - object
S - string
U - Unicode string
MATPLOTLIB:-
DataVisualizationusingMatplotlib
Matplotlib is one of the most popular Python packages used for data visualization. It is a cross-
platformlibraryformaking2Dplotsfromdatainarrays.MatplotlibiswritteninPythonandmakesuse of NumPy,
the numerical mathematics extension of Python. It provides an object-oriented APIthat helps in
embedding plots in applications using Python GUI toolkits such as PyQt,WxPythonotTkinter.
It can be used in Python and IPython shells, Jupyter notebook and web application servers also.Matplotlib
has a procedural interface named the Pylab, which is designed to resemble MATLAB,
aproprietaryprogramminglanguagedevelopedbyMathWorks.MatplotlibalongwithNumPycanbeconsidered
astheopensourceequivalentofMATLAB.
Matplotlibwasoriginallywrittenby JohnD.Hunterin2003.Thecurrentstableversionis2.2.0
PANDAS:-
KeyFeatures ofPandas –
FastandefficientDataFrameobjectwithdefaultandcustomizedindexing.
Toolsforloadingdataintoin-memorydataobjectsfromdifferentfileformats.
8
Dataalignmentandintegratedhandlingofmissingdata.
Reshapingandpivotingofdatesets.
Label-basedslicing,indexingandsubsettingoflargedatasets.
Columnsfromadatastructurecanbedeletedorinserted.
Groupbydataforaggregationandtransformations.
Highperformancemergingandjoiningofdata.
TimeSeriesfunctionality.
Series–
Pandas Series structure is a one-dimensional labeled array and capable of holding data of
anytype(integer,string,float, python objects,etc.)
Syntax:
pandas.Series(data=None,index=None,dtype=None,name=None)
Parameters:
data: array- Contains data stored in Series.index: array-likeor Index (1d)
dtype:str,numpy.dtype,orExtensionDtype,optionalname: str,optional
REGRESSION:-
Regressionisatechniqueusedtomodelandanalyzetherelationshipsbetweenvariablesandoftentimeshowt
heycontributeandarerelatedtoproducing aparticularoutcometogether.
Regression models are used to predict a continuous value. Predicting prices of a house given the features
of house like size, price etc is one of the common examples of Regression. It is a supervised technique.
KEYFEATURESOFREGRESSION:
9
and error. If the variance is high, it leads to overfitting and when the biasishigh,itleads
tounderfitting.
Based on the number of input features and output labels, regression is classified
aslinear,multipleandmultivariate.
Linearregressionallowsustoplotalinearequation,i.e.,a straightline.Weneedtotune coefficient and
bias of the linear equation over the training data for accuratepredictions.
Thetuningofcoefficientandbiasisachievedthroughgradientdescentoracostfunction —
leastsquaresmethod.
Polynomialregressionisusedwhenthedataisnon-linear.Inthis,themodelismoreflexible
asitplotsacurve between thedata.
Regularizationtendstoavoidoverfittingbyaddingapenaltytermtothecost/lossfunction.
RidgeandlassoregressionarethetechniqueswhichuseL2&L1regularizations.
TYPESOFREGRESSIONINMACHINE LEARNING:-
10
Project Undertaken
2.1.1. Objectives
Our project name is Tic-Tac-Toe game. This game is very popular and is fairlysimplebyitself.It
isactuallyatwoplayer game.Inthis game,thereis a board with n x n squares. In our game, it is 3 x 3
squares.The goal of Tic-Tac-Toe is to be one of the players to get three same symbolsinarow-
horizontally, vertically ordiagonally-ona3x3 grid.
11
2.1.2 SRS Software requirement Specification
Version 1.0
Tic Tac Toe Game
12
3. Development Environments
A development environment is a combination of a text editor and a Python runtime implementation. The
text editor allows you to write code for your applications. The runtime implementation, such
as CPython or PyPy, provides the method for executing your code.
A text editor can be as simple as Notepad running on Windows or a more complicated integrated
development environment (IDE) with syntax checking, integrated test runner and code highlighting. A
couple of common IDEs for Python development are PyCharm and VSCode, both of which runs on any
major operating system.
That's a common set up but you can certainly write great code with a much less expensive set up or a
cloud-based development environment.
My Python development environment has a setup with Sublime Text, Anaconda, PyCharm and
the author's workflow for how to use the different editors for different purposes.
My Python Development Environment, 2018 Edition explains Jacob Kaplan-Moss' (one of the
original creators of the Django web framework) local setup.
The definitive guide to setup my Python workspace is geared towards using Python for data
science but the guide remains useful for configuring your system for any type of Python work. There is
some solid advice in the post about not adulterating your global Python installation as well as how to split
out many virtual environments for Python 2 & 3.
13
General development environment resources:-
Development environments are unique to each programmer because Python is used for many different
purposes. The following guides range from web development to DevOps and from getting started to data
science. Even though your environment requirements are unique, you should be able to find someone
who has set up something similar to what you need. Use that configuration as a starting point and
customize it from there.
The Python subreddit had a nice thread with developers giving the specifications to their Python
development environments in this post on What is in your Python Development Environment?.
Real Python has an awesome, detailed post on setting up your Sublime Text 3 environment as a full-
fledged IDE.
How to bootstrap a Python project covers using a virulent, where to store your files, which version of
Python to use and adding code metrics libraries for checking syntax.
PyCharm: The Good Parts shows you how to be more efficient and productive with that IDE if it's
your choice for writing Python code.
JetBrains' PyCharm Blog is required reading if you're using the IDE or considering trying it. One of
the core developers also has an interview on the Talk Python to Me podcast that's worth listening to.
The Joy of Linux Desktop Environments talks about desktop environments, not specifically
development environments, but provides an explanation for why the core Linux operating system is
awesome for being unbundled from the desktop environment itself. You can change your desktop
environment from just a command line without a windowing system to a full windowed system
provided by Gnome, KDE or Unity for using the system and getting your programming work done.
Setting up a Python Development Environment with and without Docker explains the reasoning
behind why and when to use various tools in your local environment.
14
3.1 Front End Development Environment:-
Anaconda Navigator:
Jupyter Notebook:
15
4. System Design
4.1Flowcharts / DFDs:-
The existing system as we seen includes the use of classifier were they train dataset and perform
operations on the dataset and then user get output value. The presented System Architecture is using
classifier and datasets:
This system works on classifier and its repetitive output since predicting accurate house price is not
possible with this architecture. Proposed System Architecture As discussed above, architecture does not
have the accurate price prediction to overcome this we designed architecture where accuracy can be
achieved
16
17
IMPLEMENTATION & TESTING
5.1 Testing:-
Testing your code is very important.Getting used to writing testing code and running this code in parallel
is now considered a good habit. Used wisely, this method helps to define your code’s intent more
precisely and have a more decoupled architecture.
A testing unit should focus on one tiny bit of functionality and prove it correct.
Each test unit must be fully independent. Each test must be able to run alone, and also within the
test suite, regardless of the order that they are called. The implication of this rule is that each test
must be loaded with a fresh dataset and may have to do some cleanup afterwards. This is usually
handled by setUp() and tearDown() methods.
Try hard to make tests that run fast. If one single test needs more than a few milliseconds to run,
development will be slowed down or the tests will not be run as often as is desirable. In some cases,
tests can’t be fast because they need a complex data structure to work on, and this data structure
must be loaded every time the test runs. Keep these heavier tests in a separate test suite that is run by
some scheduled task, and run all other tests as often as needed.
Learn your tools and learn how to run a single test or a test case. Then, when developing a
function inside a module, run this function’s tests frequently, ideally automatically when you save
the code.
Always run the full test suite before a coding session, and run it again after. This will give you
more confidence that you did not break anything in the rest of the code.
It is a good idea to implement a hook that runs all tests before pushing code to a shared repository.
If you are in the middle of a development session and have to interrupt your work, it is a good
idea to write a broken unit test about what you want to develop next. When coming back to work,
you will have a pointer to where you were and get back on track faster.
The first step when you are debugging your code is to write a new test pinpointing the bug. While
it is not always possible to do, those bug catching tests are among the most valuable pieces of code
in your project.
Use long and descriptive names for testing functions. The style guide here is slightly different
than that of running code, where short names are often preferred. The reason is testing functions are
never called explicitly. square() or even sqr() is ok in running code, but in testing code you would
have names such as test_square_of_number_2(), test_square_negative_number(). These function
names are displayed when a test fails, and should be as descriptive as possible.
When something goes wrong or has to be changed, and if your code has a good set of tests, you or
other maintainers will rely largely on the testing suite to fix the problem or modify a given behavior.
Therefore the testing code will be read as much as or even more than the running code. A unit test
whose purpose is unclear is not very helpful in this case.
Another use of the testing code is as an introduction to new developers. When someone will have
to work on the code base, running and reading the related testing code is often the best thing that
18
they can do to start. They will or should discover the hot spots, where most difficulties arise, and the
corner cases. If they have to add some functionality, the first step should be to add a test to ensure
that the new functionality is not already a working path that has not been plugged into the interface.
5.2 IMPLEMENTATION:-
19
20
Conclusion
With the basis of minimax algorithm for mathematical analysis alongside speeding up thecomputation by
alpha beta pruning concept and optimizing the utility function using heuristicfunction, the 4x4 tic tac toe
game was developed. We explored that a 4x4 tic tac toe, an adversarysearch technique game in artificial
intelligence, can be developed using these techniques.Increasing the size of this game would create a
huge time complexity issue with the same algorithmand techniques, for which other logics must be
further researched.
21
Refrences:
22