\section{Case-Based Reasoning (CBR)}
Case based reasoning is a method of machine learning that seeks to
emulate human recollection and adaptation of past experiences in
order to find solutions to current problems. That is, as humans we
tend to base our decisions not on complex reductive analysis, but
on an instantaneous survey of past experiences \cite{schank83};
i.e. we don't think, we remember. CBR is purely based on this direct
adaptation of previous cases based on the similarity of those cases
with the current situation. Having said that, a CBR based system
has no dedicated world model logic, rather that model is expressed
through the available past cases in the case cache. This cache is
continuously updated and appended with additional cases. 
%It is this
%B
%appending that provides the intelligence, or rather the experience,
%of a CBR system. For example one need not consider the actuarial
%ramifications of a kitchen grease fire, our past experiences tells
%us without hesitance: Fire hot, fire bad. While the power of
%simulating and modeling the world has allowed for our success as a
%species, our abilities fall apart without historical knowledge of
%the world.

%The research field of CBR has grown rapidly in the past decade and
%this is evident from the increased number of research papers at
%major conferences and artificial intelligence journals. The main
%focus of CBR related study has been on the reuse of past case, a
%pattern mapping problem, this is to finding a way to transfer the
%solution of an identified source analogous (from cases) to the
%current problem (target case).
%
Aamodt \& Plaza \cite{aamod94} describe a 4-step general CBR cycle, which consists of:
\be
\item \textit{Retrieve}: Find the most similar cases to the target problem. 
\item \textit{Reuse}: Adapt our actions conducted for the past cases to solve the new problem.
\item \textit{Revise}: Revise the proposed solution for the new problem and verify it against the case base.
\item \textit{Retain}: Retain the parts of current experience in the case base for future problem solving.
\ee


Having verified the results from our chosen adapted action on the new case, the new case is added to the available case base. The last step allows CBR to effectively learn from new experiences. In this manner, a CBR system  is able to automatically maintain itself.
As discussed below, {\W} supports $retreive$, $reuse$, and $revise$ (as well as $retain$ if the user collecting data so decides).

\begin{figure}[!h]
\begin{center}
         \includegraphics[scale=0.4]{cbrcycle1.png}
         \caption{figure}{A diagram describing the steps of CBR (source: http://www.peerscience.com/Assets/cbrcycle1.gif).}
         \label{fig:cbr}
 \end{center}
\end{figure}

This 4-stage cyclical CBR process is sometimes referred to as the R4 model \cite{She02}.
Shepperd \cite{She02} considered the new problem as a case that comprises two parts.
There is a description part and a solution part forming the basic data structure of the system.
The description part is normally a vector of features that describe the case state at the point at which the problem is posed.The solution part describes the solution for the specific problem (the problem description part).

The similarity between the target case and each case in the case base is determined by a similarity measure.
Different methods of measuring similarity have been proposed for different measurement contexts.
A similarity measure is measuring the closeness or the distance between two objects in an n-dimensional Euclidean space,
the result is usually presented in a distance matrix (similarity matrix) identifying the similarity among all cases in the dataset.
Although there are other different distance metrics available for different purposes, the Euclidean distance metric is probably the most commonly 
used in CBR for its distance measures.

Irrespective of the similarity measure used, the objective is to
rank similar cases from case-base to the target case and utilize
the known solution of the nearest $k$-cases. The value of $k$ in
this case has been the subject of debate \cite{kadoda00,shepperd97}:
Shepperd~\cite{shepperd97},
Mendes~\cite{Mendes2003} argue for $k=3$ while
Li~\cite{Li2009} propose $k=5$. 

Once the actual value of the
target case is available it can be reviewed and retained in the
case-base for future reference. Stored cases must be maintained
over time
 to prevent information irrelevancy and inconsistency. This is a
 typical case of incremental learning in an organization utilizing
 the techniques of CBR.

Observe that these 4 general CBR application steps (retreive, reuse, revise, retain)
do not include any explicit model based
calculations; rather we are relying on our past experience, expressed
through the case base, to estimate any model calculations based on the
similarity to the cases being used. 
This has two advantages:
\be
\item
It allows us to operate independently of the models being used. 
For example, our prior report to this
conference~\cite{me09i}  ran over two data sets. This 
this study, based on CBR, uses twice as many data sets.
\item
This improves our performance,
since data retrieval can be  more efficient than calculation,
especially given that many thousands of iterations of calculation
were needed with our traditional modeling based tool. 
As evidence of this, despite the use of a slower language, {\W}'s AWK code
 runs faster than the C++/LISP used in STAR/NOVA.
 It takes just minutes to conduct 20 trials over 13 data sets with
{\W}. A similar trial, conducted with NOVA or STAR, can take hours to run.
\ee

%Next we will present the datasets case bases that \textit{W} is using so far.

%\section{Case bases}
%\begin{figure*}[!t]
%	\includegraphics[scale=0.5]{datasets.png}
%	\captionof{figure}{The above figure shows the characteristics of the case bases in use\cite{kocaguneli10}.}
%	\label{fig:datasets}
%\end{figure*}

%Before proceeding to explaining \textit{W}, we will briefly present the case bases that are being used. \fig{datasets} shows the characteristics of each of the case bases. Note that, with the exception of ISBSG-Banking and SDR, all the data used is available at \begin{verbatim}http://promisedata.org/?cat=14\end{verbatim}

%As shown in \fig{datasets}, our data includes:

%\bi
%\item Data from the International Software Benchmarking Standards Group (ISBSG).
%\item The Desharnais and Albrecht data sets : Albrect consists of 24 completed software project cases carried out in IBM in the 1970's \cite{keung08}, while the Desharnais set consists of 81 projects characterized by function points rather than lines of code (LOC) \cite{desharnais89}.
%\item SDR, which is data from projects of various software companies from Turkey. SDR is collected from Softlab, the Bogazici University Software Engineering Research Laboratory repository \cite{bakir10}.
%\item And the standard COCOMO data sets (Cocomo*, Nasa*).
%\ei

%In addition to above case bases, we also use the Maxwell set \cite{maxwell02}. The Maxwell set is data collected from one of the biggest commercial banks in Finland, and therefore belongs to the financial domain. This set contains 62 projects cases, with effort measured in hours.

%Projects in ISBSG dataset can be grouped according to their business domains. In previous studies, breakdown of ISBSG according to business domain has also been used \cite{bakir08}. Such business domains included in our datasets include the standalone and client-server domains.

%Note that two of the data sets (Nasa93c2, Nasa93c5) come from different development centers around the United States. Another two of these data sets (Cocomo81e, Cocomo81o) represent different kinds of projects: 

%\bi
%\item The Cocomo81e ``embedded projects'' are those developed within tight constraints (hard-ware, software, operational, ...);
%\item.The Cocomo81o ``organic projects'' come from small teams with good experience working with less than rigid requirements.
%\ei
%    
%Note also in \fig{datasets}, the skewness of our effort values (2.0 to 4.4): our datasets are extremely heterogeneous with as much as 40-fold variation. There is also some divergence in the features used to describe our data:

%\bi
%\item While our data includes some effort value (measured in terms of person months or hours), no other feature is shared by all data sets.
%\item The Cocomo* and NASA* data sets all use the features defined by Boehm \cite{boehm81}.
%\item The other data sets use a wide variety of features including, number of entities in the data model, number of basic logical transactions, query count and number of distinct business units serviced, among others.
%\ei   


%\begin{figure}[h]
%\begin{center}
%\begin{scriptsize}
%\begin{tabular}{|p{.46\linewidth}|p{.46\linewidth}|}
%\multicolumn{1}{l}{``W'' Historical Cases}\\\hline
%@relation NASA93\newline 
%@attribute rely 1 2 3 4 5\newline 
%@attribute data 2 3 4 5\newline 
%@attribute cplx 1 2 3 4 5 6\newline 
%@attribute time 3 4 5 6 \newline 
%@attribute stor 3 4 5 6\newline 
%@attribute virt 2 3 4 5\newline 
%@attribute turn 2 3 4 5\newline 
%@attribute acap 1 2 3 4 5 \newline 
%@attribute aexp 1 2 3 4 5\newline 
%@attribute pcap 1 2 3 4 5\newline 
%@attribute vexp 1 2 3 4\newline 
%@attribute lexp 1 2 3 4\newline 
%@attribute modp 1 2 3 4 5\newline 
%@attribute tool 1 2 3 4 5\newline 
%@attribute sced 1 2 3 4 5\newline
%@attribute ksloc 8.4 10.8 24 25.2 31.2 36 72 117.6 360\newline
%@data\newline 
%4 2 4 3 3 2 2 3 3 3 3 4 4 3 2 24.6 117.6\newline 
%4 2 4 3 3 2 2 3 3 3 3 4 4 3 2 7.7 31.2\newline 
%4 2 4 3 3 2 2 3 3 3 3 4 4 3 2 8.2 36\newline 
%4 2 4 3 3 2 2 3 3 3 3 4 4 3 2 9.7 25.2\newline 
%4 2 4 3 3 2 2 3 3 3 3 4 4 3 2 2.2 8.4\newline 
%4 2 4 3 3 2 2 3 3 3 3 4 4 3 2 3.5 10.8\newline 
%4 2 4 3 3 2 2 3 3 3 3 4 4 3 2 66.6 352.8\newline 
%3 2 4 3 3 2 2 4 5 5 3 4 3 3 3 20 72\newline 
%3 2 4 3 3 2 2 4 5 4 3 4 3 3 3 6 24\newline 
%3 2 4 3 3 2 2 4 5 5 3 4 3 3 3 100 360
%\\\hline
%\end{tabular}
%\end{scriptsize}
%\end{center}
%\caption{Example datafile for ``\textit{W}'' consisting of a sample of NASA93 data}
%\label{fig:nasadata}
%\end{figure}

%All the above case bases are stored in *.dat files that are named to indicate the case base. These files are located in the ``datasets'' folder under the root directory were \textit{W} is located, and are stored in arff format \cite{arff}. \fig{nasadata} is one example of a case base defined in arff format: 

%\bi
%\item Up to ``@data'', we have attribute and range definitions.
%\item Following ``@data'', we have a listing of all the cases in this case base.
%\ei

%Note that the ISBSG case bases are separated by their domain, which is indicated by the later part of the name (ex: isbsg-clientserver.dat indicates the client-server branch of that case base).

%Having briefly presented the datasets, it is important to note that some of the case bases has been discretized into smaller bins for use with \textit{W}. The amount of bins is indicated as a suffix to the *.dat file name. The reason for this will become clearer once we explain the operation of \textit{W}. Suffice it to say at this point that this is due to the use of CBR, since when attempting to find the similar cases (i.e. cases that are a super set of our current case), it is possible to get back a case set that contains no cases given the specificity of some of the numeric fields within the case base. 

%Next we will briefly present the example projects being used within \textit{W} for experimental runs.


%tal runs.


 %for experimental runs.


