09.10.2023 Views

Advanced Data Analytics Using Python_ With Machine Learning, Deep Learning and NLP Examples ( 2023)

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1

Introduction

else:

print "Usage is"

print sys.argv[0], '<airline/retail>',

"<Config File Path>"

The configuration for the previous code is shown here:

base_url = http://www.airlinequality.com/Forum/

#base_url = http://www.mouthshut.com/product-reviews/Mega-Mart-

Bangalore-reviews-925103466

#base_url = http://www.mouthshut.com/product-reviews/Megamart-

Chennai- reviews-925104102

air_lines = emrts,brit_awys,ual,biman,flydubai

limits = 10

I’ll now discuss the previous code in brief. It has a root class that is an

abstract class. It contains essential attributes such as a base URL and a

page limit; these are essential for all child classes. It also contains common

logic in class method functions such as the download URL, print output,

and read configuration. It also has an abstract method collectThoughts,

which must be implemented in child classes. This abstract method is

passing on a common behavior to every child class that all of them must

collect thoughts from the Web. Implementations of this thought collection

are child specific.

Calling Other Languages in Python

Now I will describe how to use other languages’ code in Python. There are

two examples here; one is calling R code from Python. R code is required

for some use cases. For example, if you want a ready-made function for the

Holt-Winter method in a time series, it is difficult to do in Python. But it is

12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!