Skip to content

Commit

Permalink
added some more samples for testing and fixed deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
elhaj committed Jun 9, 2016
1 parent 64d49c0 commit 095f1c0
Show file tree
Hide file tree
Showing 10 changed files with 1,454 additions and 9 deletions.
Binary file modified MachineLearning/model/myModel.dat
Binary file not shown.
17 changes: 10 additions & 7 deletions MachineLearning/src/classifier/MyFilteredClassifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void load(String fileName) {
}
System.out.println("===== Loaded text data: " + fileName + " =====");
reader.close();
System.out.println(text);
//System.out.println(text);
}
catch (IOException e) {
System.out.println("Problem found when reading: " + fileName);
Expand All @@ -73,7 +73,7 @@ public void loadModel(String fileName) {
Object tmp = in.readObject();
classifier = (FilteredClassifier) tmp;
in.close();
System.out.println("===== Loaded model: " + fileName + " =====");
//System.out.println("===== Loaded model: " + fileName + " =====");
}
catch (Exception e) {
// Given the cast, a ClassNotFoundException must be caught along with the IOException
Expand Down Expand Up @@ -104,8 +104,8 @@ public void makeInstance() {
// Another way to do it:
// instance.setValue((Attribute)fvWekaAttributes.elementAt(1), text);
instances.add(instance);
System.out.println("===== Instance created with reference dataset =====");
System.out.println(instances);
//System.out.println("===== Instance created with reference dataset =====");
//System.out.println(instances);
}

/**
Expand All @@ -115,7 +115,7 @@ public void makeInstance() {
public void classify() {
try {
double pred = classifier.classifyInstance(instances.instance(0));
System.out.println("===== Classified instance =====");
//System.out.println("===== Classified instance =====");
System.out.println("Class predicted: " + instances.classAttribute().value((int) pred));
}
catch (Exception e) {
Expand All @@ -130,10 +130,13 @@ public void classify() {
public static void main (String[] args) {

MyFilteredClassifier classifier;
classifier = new MyFilteredClassifier();
classifier.load("test/Chair_4.txt");

for(int i=1 ; i<9; i++){
classifier = new MyFilteredClassifier();
classifier.load("test/Gov_"+i+".txt");
classifier.loadModel("model/myModel.dat");
classifier.makeInstance();
classifier.classify();
}
}
}
5 changes: 3 additions & 2 deletions MachineLearning/src/classifier/MyFilteredLearner.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.SortedSet;
import java.util.TreeSet;
import weka.classifiers.bayes.NaiveBayes;
import weka.classifiers.functions.SMO;
import weka.classifiers.meta.FilteredClassifier;
import weka.core.converters.ArffLoader.ArffReader;
import java.io.*;
Expand Down Expand Up @@ -80,7 +81,7 @@ public void evaluate() {
filter.setAttributeIndices("last");
classifier = new FilteredClassifier();
classifier.setFilter(filter);
classifier.setClassifier(new NaiveBayes());//SMO
classifier.setClassifier(new SMO());//SMO
Evaluation eval = new Evaluation(trainData);
eval.crossValidateModel(classifier, trainData, 4, new Random(1));
System.out.println(eval.toSummaryString());
Expand All @@ -104,7 +105,7 @@ public void learn() {
filter.setAttributeIndices("last");
classifier = new FilteredClassifier();
classifier.setFilter(filter);
classifier.setClassifier(new NaiveBayes());
classifier.setClassifier(new SMO());
classifier.buildClassifier(trainData);
// Uncomment to see the classifier
//System.out.println("---------> "+classifier);
Expand Down
146 changes: 146 additions & 0 deletions MachineLearning/test/Chair_5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
ECO ANIMAL HEALTH GROUP PLC
DIRECTORS' REPORT (CONTINUED)
FOR THE YEAR ENDED 31 MARCH 2010
Financial instruments
The Group's accounting policies for financial instruments and strategy for management of those financial
instruments are given in notes 2 and 33 to the financial statements respectively.
Employees
Application for employment by disabled persons are given full and fair consideration. When existing
employees become disabled every effort is made to provide continuing employment wherever possible.
Donations
2010 2009

Charitable donations - 100
Restatement of comparative figures
As more fully disclosed in note 11 to the accounts, the Group's comparative figures have been restated to
take account of the reclass'rfication of an amount of 1,034,860 from goodwill to distribution rights and the
related effects on previous amortisation charges, to eliminate dividends shown in payables prior to their
approval in General Meeting and to satisfy the IFRS requirements that results from discontinued activities be
shown In one line on the income statement. The directors are confident that these adjustments, when taken
together, would not affect the user's view of the Group's financial position and results for the prior periods
concerned.
Final dividend for the year ending 31 March 2009
As more fully explained in note 10 to the accounts, an administrative oversight rendered this dividend
technically unlawful. The directors Intend to have this dividend ratified by shareholders at the next General
Meeting of the Company on the 28 September 2010.
Creditor payment policy
The Company agrees terms and conditions for its business transactions with its suppliers and payments are
made on these terms, subject to the terms and conditions being mel by the suppliers. The Parent Company
has no supplies of goods.Trade payables for the Parent and its UK subsidiary at the year end amounted to
84 days (2009: 75 days) of average supplies for the year.
Internal financial control
The board of directors is responsible for the Group's system of internal financial control. Internal control
systems are designed to meet the particular needs of the companies concerned and the risks to which they
are exposed. This provides reasonable, but not absolute, assurance against material misstatement or loss.
Strict financial and other controls are exercised by the Group over its subsidiary companies by day to day
supervision of the businesses by the directors.
Stockbrokers
Cenkos Securities pic are the Company's nominated advisor and stockbrokers. The closing share price on
31 March 2010 was 161p per share (2009:160p). During the year the average share price was 167p
(2009:113.59p).
Auditors
The directors having been notified of the cessation of the partnership known as F. W. Stephens, have
resolved that Reeves + Neylan LLP be appointed successor auditor in accordance with the provisions of the
Companies Act 2006, s.489. Reeves + Neylan LLP has indicated Its willingness to continue in office. ECO ANIMAL HEALTH GROUP PLC
DIRECTORS' REPORT (CONTINUED)
FOR THE YEAR ENDED 31 MARCH 2010
Statement of directors' responsibilities
The directors are responsible for preparing the Annual Report and the financial statements in accordance
with applicable law and regulations.
Company law requires the directors to prepare financial statements for each financial year. Under that law
the directors have prepared the Group and Parent Company financial statements in accordance with
International Financial Reporting Standards (IFRSs) as adopted by the European Union. Under company law
the directors must not approve the financial statements unless they are satisfied that they give a true and
fair view of the state of affairs of the Group and the Company and of the profit or loss of the Group for thai
period. In preparing these financial statements, the directors are required to:
- select suitable accounting policies and then apply them consistently;
- make judgements and accounting estimates that are reasonable and prudent;
-slate whether applicable IFRSs as adopted by the European Union have been followed, subject to any
material departures disclosed and explained in the financial statements;
-prepare the financial statements on the going concern basis unless it is inappropriate to presume that the
Group will continue in business.
The directors are responsible for keeping adequate accounting records that are sufficient to show and
explain the Company's transactions and disclose with reasonable accuracy at any time the financial position
of the Company and the Group and enable them lo ensure that the financial statements comply with the
Companies Act 2006. They are also responsible for safeguarding the assets of the Company and the Group
and hence for taking reasonable steps for the prevention and detection of fraud and other irregularities.
The directors are responsible for the maintenance and integrity of the Company's website. Legislation in the
United Kingdom governing the preparation and dissemination of financial statements may differ from
legislation In other jurisdictions.
Statement of disclosure to auditors
So far as each of the directors are aware;
(a) there is no relevant audit information of which the Company's auditors are unaware,
and
(b) they have taken all the steps that they ought to have taken as directors In order to make themselves
aware of any relevant audit information and to establish that the Company's auditors are aware of that
information.
On behalf of the board
Mr Peter Lawrence
Director
9 August 2010
-10- ECO ANIMAL HEALTH GROUP PLC
INDEPENDENT AUDITORS' REPORT
TO THE SHAREHOLDERS OF ECO ANIMAL HEALTH GROUP PLC
We have audited the financial statements (the financial statements) of Eco Animal Health Group pic for
the year ended 31 March 2010 which comprise the Consolidated income statement, the Consolidated
statement of comprehensive income, the Consolidated and company statements of financial position, the
Consolidated and company statement of changes in equity, the Consolidated and company statements
of cashflows, and the related notes. The financial reporting framework that has been applied in their
preparation is applicable law and International Financial Reporting Standards (IFRSs) as adopted by the
European Union and, as regards the Parent Company financial statements, as applied in accordance
with the provisions of the Companies Act 2006.
This report, including the opinions, has been prepared for and only for the Company's members as a
body in accordance with Chapter 3 of Part 16 of the Companies Act 2006 and for no other purpose. We
do not, in giving these opinions, accept or assume responsibility for any other purpose or to any other
person to whom this report is shown or into whose hands it may come save where expressly agreed by
our prior consent in writing.
Respective responsibilities of directors and auditors
As explained more fully in the Directors' Responsibilities Statement set out on page 10, the directors are
responsible for the preparation of the financial statements and for being satisfied that they give a true
and fair view.
Our responsibility is to audit the financial statements in accordance with applicable law and International
Standards on Auditing (UK and Ireland). Those standards require us to comply with the Auditing
Practices Board's Ethical Standards for Auditors.
Scope of the audit of the financial statements
An audit involves obtaining evidence about the amounts and disclosures in the financial statements
sufficient to give reasonable assurance that the financial statements are free from material misstatemenl,
whether caused by fraud or error. This includes an assessment of: whether the accounting policies are
appropriate to the Group's and Parent Company's circumstances and have been consistently applied and
adequately disclosed; the reasonableness of significant accounting estimates made by the directors; and
the overall presentation of the financial statements.
Opinion on financial statements
In our opinion:
the financial statements give a true and fair view of the state of the Group's and of the Parent
Company's affairs as at 31 March 2010 and of the Group's profit and Group's and Parent
Company's cash flows for the year then ended;
the Group financial statements have been properly prepared in accordance with IFRSs as adopted
by the European Union;
the Parent Company financial statements have been properly prepared in accordance with IFRSs as
adopted by the European Union and as applied in accordance with the provisions of the Companies
Act 2006; and
the financial statements have been prepared In accordance with the requirements of the Companies
Act 2006.
Opinion on other matters prescribed by the Companies Act 2006
In our opinion the information given in the Directors' Report for the financial year for which the financial
statements are prepared Is consistent with the financial statements.
-11- ECO ANIMAL HEALTH GROUP PLC
INDEPENDENT AUDITORS' REPORT (CONTINUED)
TO THE SHAREHOLDERS OF ECO ANIMAL HEALTH GROUP PLC
Matters on which we are required to report by exception
We have nothing lo report in respecl of Ihe following matters where the Companies Act 2006 requires us
to report to you if, in our opinion:
adequate accounting records have not been kept by the Parent company, or returns adequate for
our audit have not been received from branches not visited by us; or
the Parent company financial statements are not in agreement with the accounting records and
relurns; or
certain disclosures of directors' remuneration specified by law are not made; or
we have not received all in the information and explanations we require for our audit
Stephen Tanner BSc(Econ) FCA
Senior Statutory Auditor
For and on behalf of:
Reeves and Neylan LLP
Statutory Auditors
Chartered Accountants
London
Date: 9 August 2010
-12-
Loading

0 comments on commit 095f1c0

Please sign in to comment.