Thursday, 1 September 2016

Selfie Mining

Now a days it's common that personal stories are described using social images. We might be thinking the pictures we snapped of ourselves and posted on social media sites are just for our friends on those platforms. But it's high time to correct this misbelief. Only those data we mark as private are actually guarded by the privacy laws. The rest all is public. Marketers are grabbing our images for research. This process is called selfie mining.
When we take a picture of ourselves we do so without promoting a specific product in mind. But that is not the case with marketers. They might be interested in our clothing, products we use, emotions on our face etc. There are companies that mine for selfies. They use APIs to access the images and the most interesting aspect of it is that the owners are unaware of this. Actually intentionally or unintentionally selfies promote whatever we are wearing or are sitting near or using. Many digital marketing companies have built technology to scan and process photos, to identify particular interests or hobbies. This in turn helps to better target advertisers.
Two of these companies are Ditto Labs and Piqora.
Ditto Labs: It scans photos on different sites like Instagram to generate insights for customers. Ditto Labs places users into categories, such as “sports fans” and “foodies” based on the context of their images. Advertisers such as Kraft Foods Group Inc. pay Ditto Labs to find their products’ logos in photos on social media.The following aspects are taken into consideration:

  • Products- Users who post images of food items and beverages are flagged for these interests.
  • Clothing- Ditto classifies objects. It also detects fabrics or patterns in clothing.
  • Faces- The emotions in the face help advertisers to understand sentiment.
  • Logos- Advertisers can search for photos featuring brands to steal customers.
  • Scenes- Analysing the background of images helps the advertisers to find where and how customers use their products.

Piqora: They store images for months on their own servers to show marketers what is trending in popularity. Piqora mainly analyses images in Pinterest. It was recently acquired by Olapic which analyses images on Instagram.
Well, these indicates that some of the best digital marketing trends are all on the way. Let's hope that the best is yet to come in near future.

Source:
http://programmaticadvertising.org/2014/10/20/selfie-mining-whats-really-going-on/
http://www.wsj.com/articles/smile-marketing-firms-are-mining-your-selfies-1412882222
We anyways have to think, why not think big?

Saturday, 23 April 2016

The Buzz word Big Data..

Hello friends,

Sorry for the late post. I was busy in completing a significant milestone in my life. So let me start, as I promised, we will see some facts about Big Data. Today's world can be best described as "we are drowning in data but are starving for information". The data from web, social media sites, sensors, logs etc. is so large so that we cannot handle it by traditional data processing methods. Trillions of status updates are posted to Facebook daily. We see large data, but have we thought of how to store it. It's high time to think of such data storage techniques. Here comes the importance of big data. Let me go back to my good old school days.

What is Big Data?

  According to Wikipedia: Big data is a term used to describe large and complex data sets that cannot be handles by other traditional data processing applications. It also includes capture, storage, search, analysis and visualization of the data.

Why Big Data?

Organisations can gain significant advantages by managing data effectively. Some of them include:

  • Better decision making: With the speed of data processing techniques like hadoop and applying in memory analytics we could combine data from multiple sources which would yield better decision making.
  • More business opportunities: We can mine the data and can find the customer needs and their satisfaction. This in turn can help us to develop the products that the customers want.
  • Cost reduction: Majority of the data processing techniques are open source. This reduces the cost of analysis of large data sets.

How is Big data?

Big Data can be best described by its characteristics. They are:

  • Volume: It describes the quantity of the data
  • Velocity: It is the speed at which the data is generated
  • Variety: It is the nature of the data
  • Veracity: It describes the quality of the data
  • Variability: The inconsistency in the data set is described by variability

When is Big Data?

The data stored in traditional databases cannot be regarded as big data. When we are dealing with terabytes and petabytes of information coming from diverse sources within short span of time, then it can be regarded as big data. In other words it can also be described as those data that satisfies the 5V's of big data or the characteristics of big data. 

Too much of theory for the day. We can look at the tools and techniques used in Big Data Analytics in the next post. So just wait and see. Catch you all soon..



No Dream is too High!


Thursday, 7 January 2016

Tips and Tricks- 8

1. Tomcat Server not starting with in 45 seconds
Delete the server from eclipse and reconfigure it or add it again to Eclipse.


2. Accessing Apache tomcat 7 built in Host Manager GUI

Change the Tomcat\conf\tomcat-users.xml file as follows:
<role rolename="manager-gui"/> <user username="admin" password="password" roles="manager-gui"/>

Start tomcat and access: http://localhost:8080/manager/html with the provided username and password


3. HTTP Status 405 – HTTP method GET is not supported by this URL
The reasons are:
1) You do not have a valid doGet() method, when you type the servlet’s path in address bar directly, the web container like Tomcat will try to invoke the doGet() method.
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException{

}

2) You made a HTTP post request from a HTML form, but you do not have a doPost() method to handle it. The doGet() can not handle the “Post” request.
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException{

}

4. Tomcat Server is not starting and there are no output logs.
Check whether the JAVA_HOME is properly set.


Every Time we are being redirected to something better!

Sunday, 20 December 2015

More about Weka

Getting Started

1 Weka Installation

Weka requires Java. We may already have Java installed and if not, there are versions of Weka listed on the download page that include Java. The latest version of Weka can be downloaded from http://www.cs.waikato.ac.nz/ml/weka/

2 User Interfaces

The GUI chooser in Weka consist of four options:
• Explorer: It is an environment for exploring data with WEKA. 
• Experimenter: It is used for performing experiments and conducting statistical tests between learning schemes.
• Knowledge Flow: It supports same functions as the Explorer but with a drag and drop interface. 
• Simple CLI: This is a simple command-line interface that allows direct execution of WEKA commands for operating systems that do not provide their own command line interface.

3 Package Installation

Choose Tools -> Package Manager from Weka GUI Chooser. The package manager’s window is split horizontally into two parts: at thetop is a list of packages and at the bottom is a mini browser that can be usedto display information on the currently selected package.

4 Data Sets

Each entry in a dataset is an instance of the java class: weka.core.Instance. 
4.1 ARFF
An ARFF (Attribute-Relation File Format) file is an ASCII text file thatdescribes a list of instances sharing a set of attributes. It consist of:
• header section is prefixed by @RELATION
• each attribute is indicated by @ATTRIBUTE
• data section is prefixed by  @DATA 
• data is comma separated, with the class as the last attribute
 4.2 XRFF
The XRFF (Xml attribute Relation File Format) is a representing the data ina format that can store comments, attribute and instance weights.The following file extensions are recognized as XRFF files:
• .xrff: The default extension of XRFF files
• .xrff.gz: The extension for gzip compressed XRFF files 
4.3 Converters
Weka contains converters for the following data sources:
• ARFF files (ArffLoader, ArffSaver)
• C4.5 files (C45Loader, C45Saver)
• CSV files (CSVLoader, CSVSaver)
• Files containing serialized instances (SerializedInstancesLoader, SerializedInstancesSaver)
• JDBC databases (DatabaseLoader, DatabaseSaver)
• libsvm files (LibSVMLoader, LibSVMSaver)
• XRFF files (XRFFLoader, XRFFSaver)
• Text directories for text mining (TextDirectoryLoader)
4.4 Databases
Weka comes with example files for the following databases:
• DatabaseUtils.props.hsql - HSQLDB (>= 3.4.1)
• DatabaseUtils.props.msaccess - MS Access (> 3.4.14, > 3.5.8, > 3.6.0)
• DatabaseUtils.props.mssqlserver- MS SQL Server 2000 (>= 3.4.9, >= 3.5.4)
• DatabaseUtils.props.mssqlserver2005 - MS SQL Server 2005 (>= 3.4.11, >= 3.5.6)
• DatabaseUtils.props.mysql - MySQL (>= 3.4.9, >= 3.5.4)
• DatabaseUtils.props.odbc - ODBC access via Sun’s ODBC/JDBC drivers
• DatabaseUtils.props.oracle - Oracle 10g (>= 3.4.9, >= 3.5.4)
• DatabaseUtils.props.postgresql - PostgreSQL 7.4 (>= 3.4.9, >= 3.5.4)
• DatabaseUtils.props.sqlite3 - sqlite 3.x (> 3.4.12, > 3.5.7)

5 Using the API

Weka provides an API that can be directly invoked from Java code. It can be used to embed machine learning algorithms in Java programs. The following are the steps required to embed a classifier:
Step 1: Express the problem with features
Step 2: Train a Classifier
Step 3: Test the classifier
Step 4: use the classifier

6 Weka Integration to Pentaho Data Integration

Weka can be easily integrated with the ETL tool Spoon using the Weka Scoring Plugin. The following steps are to be followed for the plugin installation:
1. The Weka scoring plugin can be downloaded from: http://wiki.pentaho.com/display/EAI/List+of+Available+Pentaho+Data+Integration+Plug-In 
2. Unpack the plugin archive and copy all files in the WekaScoringDeploy directory to a sub-directory in the plugins/steps directory of the Kettle installation. 
3. Copy the "weka.jar" file from the Weka installation folderto the same sub-directory in plugins/steps as before.

7 Pros and Cons of Weka

7.1 Advantages
• Open source
• Extensible
• Portable
• Relatively easier to use 
• Large collection of Data Mining algorithms
7.2 Disadvantages
• Sequence modelling is not covered by the algorithms included in the Weka distribution 
• Not capable of multi-relational data mining 
• Memory bound

8 Projects based on Weka

There are many projects that extend or wrap WEKA. Some of these include:
• Systems for natural language processing: GATE is an NLP tool that uses Weka for natural language processing.
• Knowledge discovery in biology: BioWEKA is anextension to WEKA for tasks in biology
• Distributed and parallel data mining: There are a number of applications that use Weka for distributed data mining. Some of them include Weka- Parallel, Grid Weka, FAEHIM and Weka4WS. 
• Open-source data mining systems: Many data mining systems provide plugins to access Weka’s algorithms. The R statistical computing environment provides an interface to Weka using RWeka package. 
• Scientific workflow environment: The Kepler open- source scientific workflow platform is developed based on Weka.

9 Alternatives to Weka

The following are the main alternatives to Weka:

  • R is a powerful statistical programming language. It is derived from the S language which was developed by Bell Labs.
  • ELKI is a similar project to Weka with a focus on cluster analysis 
  • KNIME is a machine learning and data mining software implemented in Java.
  • MOA is an open-source project for large scale mining of data streams, also developed at the University of Waikato in New Zealand.
  • Neural Designer is a data mining software based on deep learning techniques written in C++.
  • Orange is a similar open-source project for data mining, machine learning and visualization written in Python and C++.
  • RapidMiner is a commercial machine learning framework implemented in Java which integrates Weka.


One of the most challenging aspects of open source software is to decide what to include in the software. So the contributions to the software are controlled. This limits the community involvement. It can be managed by using packages. The package management system of Weka is the best example for this. The mailing list of open source software are easier to maintain if the users are researchers. Weka is developed and maintained by a team of researchers at Waikato University. One of the main advantage of using Weka is that it has been incorporated into many open source projects. Hence for a beginner in data mining, among the available open source projects Weka forms the best choice.


Head Up, Stay Strong, Fake a Smile, Move on.....

Sunday, 13 December 2015

Weka

With the advent of Search Engines and Social Media Sites, there is an explosion of data. Today’s age can be regarded as “We are drowning in data, but starving for knowledge”. Companies are spending millions to build data warehouses for storing the data. But most of the companies fail in getting the expected ROI from this data. Here comes the importance of data mining. Data mining is the process of gaining knowledge by analyzing the patterns and trends in the data. Different data mining tools such as R, Rapid Miner and Weka are used for this purpose. Weka stands for Waikato Environment for Knowledge Analysis. It is a statistical and data analysis tool written in Java. Weka was developed by a team of researchers at Waikato University in New Zealand. Weka is a collection of visualization tools and algorithms for data analysis. It supports most of the standard data mining tasks such as data preprocessing, clustering, classification, regression, visualization and feature selection. Weka is an open source data mining software and is available under GNU General Public License agreement. It was originally written in C and later was rewritten to Java. Hence it is compatible with all computing platforms. It also provides a GUI for ease of use. Weka works on the assumption that the data is available as flat file where the different attributes in the data set is fixed. The most stable version of Weka is 3.6.13 which was released on September 11, 2015. 

Features of Weka

The following are the important features of Weka:
2.1.1 Open Source software
          Weka is freely available under the GNU GPL. The source code of Weka is written in Java.
2.1.2 Designed for data analysis
          It consists of a vast collection of algorithms for data mining and machine learning. Weka is kept up-to-date with new algorithms being added.
2.1.3 Ease of use
             It is easily useable by people who are not data mining specialists 
2.1.4 Platform independence
           Weka is platform independent.

Functionalities provided by Weka

The following are the basic functionalities provided by Weka:
  • Data Preprocessing: Weka supports various data formats including the database connectivity using JDBC.
  • Classification:Weka includes more than 100 classification algorithms. Classifiers are divided into Bayesian methods(Naïve Bayes, Bayesian nets etc), lazy methods(nearest neighbor and variants), rule based methods(decision tables, OneR, RIPPER etc), tree learners(C4.5, Naïve Bayes, M5), function based learners(Linear Regression, SVM, Gaussian Process) and other miscellaneous methods.
  • Clustering: The various clustering algorithms implemented in Weka includes K-means, EM and other hierarchical methods.
  • Attribute selection: The classifier performance depends on the attributes selected. Various search methods and selection criteria are available for attribute selection.
  • Data visualization: Various visualization options include Tree viewer, Dendrogram viewer and Bayes Network Viewer.


More updates about Weka in the next post.

Nothing is softer than water, But its force can break the hardest rock.

Sunday, 11 October 2015

Data Visualization

Information in an unorganized form is called data. Data can come from diverse sources such as social media, sensors, transaction logs etc. Tables or text files are used to store the data. But it is not possible to understand the data in these different formats. It is proven that human brain understands visuals rather than facts and figures. The data visualization tools are used to understand the data. Wide variety of visualization tools are available in the market. Some of them include Actuate, QlikView, Spotfire, Google Chart API, Flot, Raphael etc. Besides the common functionalities each tool provides its own features. So the choice of a tool depends on the context in which it is used. Data consist of raw facts and figures. Data visualization is the process of representing the data in the form of charts, maps or any other graphical means which makes the content easier to understand. The first data visualization was created by Rene Descartes using the Cartesian co-ordinate system in the 17th century. With the advent of the Social media sites like Facebook and Twitter the amount of data collected, stored and analyzed have increased significantly. Hence data analysis has gained importance. Friend maps and Twitter Vision are the data visualizations familiar to such users. Graphical representations are more helpful than the Excel files or tables containing the data since they help to think about the data by revealing the underlying patterns and connections between different elements. Data Visualization tools enable users to quickly create complex visualizations using data from diverse data sources. Some of the leading data visualization tools include Tableau, QlikView and Actuate.

Functions of Data Visualization Tools

The following are the main functions of data visualization tools:

  • Minimization of effort: The data can be analyzed quickly by connecting it to different sources using the Drag and Drop   functionality. This reduces the Lines of Code written by the developers.
  • Framing Questions: Data visualizations help in identifying outliers in the data. This leads to identifying the problems in the data.
  • Answering Questions: The findings in the visualization can be used identify the trends. These can be used to predict the future observations.

Requirements for data visualization

The requirements of Data visualization can be classified into following:

  • Functional Requirements


Functional requirements includes the set of activities that the system should do. It includes the following:
  1. Support real time creation of dynamic and interactive charts
  2. Allow interaction of multiple users with the data across diverse platforms
  3. Ability to visualize data from different data sources
  4. Provide secure access of data by end users


  • Non Functional Requirements


Non functional requirements are those requirements that are not part of the functional requirements. They are mainly used to judge the performance of the system. The set of non functional requirements consist of Performance, Scalability, data Integrity etc.

Stages of Data Visualization

Benjamin Fry is an American expert in Data visualization. He has proposed seven stages in data visualization. Each of the stages can be briefly explained as follows:

  1. AcquireThe data must be retrieved from a data source.
  2. ParseIt is not necessary that the data obtained will be in a format suitable for visualization. Hence the data must be structured into categories.
  3. FilterThe unimportant data must be removed to prevent information overload.
  4. MineDifferent statistical methods can be applied to identify the trends and patterns in the data.
  5. RepresentDifferent views and representations of the data leads to better decision making.
  6. RefineThe basic visual model chosen will be further refined to make the representation clearer and visually intuitive.
  7. InteractAdd different methods of interaction to allow users to decide what they see and how they see.

Data Visualization Tools

Some of the leading data visualization tools are the following:

Actuate

The Actuate Data Visualization Suite consist of the BIRT Analytics, BIRT Designer and BIRT iHub Runtime and Viewer.

  • BIRT Analytics: It is a visual data mining and predictive analytics tool. The main features include:
Social- It can connect to both social and web data sources including Facebook, Twitter              and Google Analytics.
Predictive- It incorporates both predictive analysis and visual data mining in a single                    product.
Quick Big Data- It can analyze huge volume of data within short span of time.
  • BIRT Designer: It is an open source reporting software based on the Eclipse IDE. BIRT Designer is used by developers to create visualizations based on the data from different data sources. It has the following characteristics:
          - Data Integration from diverse data sources
          - Consist of tools to secure, filter, format and present dynamic reports to end user
          - BIRT Designer includes a set of component libraries
  • BIRT iHub Runtime and Viewer: It is the deployment platform for all the BIRT content. It includes the following functionalities:
        - It consist of data drivers to data sources such as Hadoop and Oracle
        - Publishes BIRT content to web, mobile and other print media
        - Controls the access to the BIRT content

QlikView

QlikView is a software that helps users to retrieve and analyze data easily from any source. It offers wide variety of charts, tables etc. for representing the data. The QlikView stack of products include QlikView Personal Edition, QlikView Server and QlikView Publisher.

  • QlikView Personal Edition: It provides full QlikView functionality, but it is not possible to open documents created by other users. To do this we need a QlikView license. QlikView Personal edition can be downloaded as a standalone application.
  • QlikView Server: QlikView information can be shared and hosted using the QlikView Server platform.
  • QlikView Publisher: It manages the content and access. QlikView Publisher distributes data stored in QlikView documents to end users.

Tableau

Tableau helps to drag and drop data to visualize it. It consist of Tableau Desktop, Tableau Server, Tableau Online, Tableau Public and Tableau Reader.

  • Tableau Desktop is a standalone desktop application
  • Tableau Server is a browser based business intelligence solution.
  • Tableau Online is a hosted version of tableau server.
  • Tableau Public is a service used for interactive data visualization.
  • Tableau Reader is a free desktop application used to view the visualizations built in tableau desktop.

With the advent of Social media sites and search engines, large amount of data is produced daily. The urge for data analysis is increasing. So it is high time to analyze raw data and present the information to the end user in an intuitive way. Besides the wide variety of tools available, the evaluation of the nonfunctional requirements is done for Actuate, QlikView and Tableau. The most important feature of the Actuate is its Live Excel functionality which helps the data to be exported as pivot tables. QlikView has an intuitive user interface but the implementation time is high compared to Tableau. Clearly each tool has its own USP and many of their NFR attributes complement each other.


Choose a job you love, and you will never have to work a day in your life.


Monday, 31 August 2015

More about Sentiment Analysis


Method of Study

A corpus is a collection of documents for analysis. The current evaluation was done on the mail corpus. A set of E-mails expressing different sentiments were used for this purpose. The main feature of these emails is that most of them express negative opinions. The analysis was carried out by the following steps:

Document Splitting

A mail corpus may contain a single mail or a chain of emails. So the initial step is to identify the characteristic of the mail corpus. The chain of emails is split into individual mails for analysis.

Sentence splitting

Document is a collection of sentences. So in order to find the opinion of the speaker all the sentences in a document is analyzed. Hence the given mail is splitted into sentences and each sentence is fed to the sentiment analysis API for analysis.

Data transfer to API

Appropriate JAR files or sentiment analysis lexicons are downloaded and installed for the evaluating the open source tools. Apart from the open source APIs all the commercial APIs are available as REST services. It is required to register for free API keys for their evaluation. So in the case of the commercial APIs the appropriately formatted text is fed as input to the web based service.

JSON parsing

All APIs provide the result of sentiment analysis in either XML or JSON format. So appropriate JSON parsers are required to extract the type of sentiment and score from these responses. The Jackson JSON parsing API was used to parse the responses.

Extracting the score and type of sentiment

The JSON response from the API is extracted and the sentiment type and score is displayed as output.

Platform used for study

The analysis was done based on the Java based APIs of the different tools.

Key Findings

Longer texts are hard to classify

The lexical base classification does not work well in the case of lengthy sentences. This is because of the fact that subjective words may not be present in such texts but they may be expressing strong opinions.

Results depend on the training set used in the API

Most of the sentiment analysis tools will be formulated based on specific training corpuses. For example the Sentiwordnet sentiment lexicon was formulated based on the movie reviews dataset. Hence it performs best on the movie reviews.

Future Works

The above approach of evaluation can be further refined by incorporating the following features:

Real time Sentiment Analysis

Current approach used consist of analysing all the mails stored in a folder in the machine. This can be modified so that the sentiment analysis is done on real time basis. Hence as soon as a mail enters the inbox, its sentiment is analysed on the fly.

Culture based sentiment analysis

This approach extracts semantically hidden concepts from mails and incorporates them into supervised classifier training by interpolation. The interpolation method works by interpolating the original unigram language model in Naive Bayes classifier with the generative model of words given semantic concept. Cultural features can be incorporated in similar way where the unigram language model will also be interpolated by the generative model of users given cultural features.

This comparison study focused on detecting the polarity of content, like positive and negative effects and does not consider other types of sentiments such as anger or calmness. Only a few of the methods are able to reach somewhat high level of accuracy. Each of the evaluated tools are trained on specific corpuses. Hence the results of analysis depends on the training set used for model formulation in the tool used for sentiment analysis. Thus, the sentiment analysis tools still have a long way to go before reaching the confidence level demanded by practical applications.





Action without knowledge is wastage and Knowledge without action is futile!!