Skip to content

Commit ae07c16

Browse files
committed
done
0 parents  commit ae07c16

File tree

185 files changed

+271278
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+271278
-0
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Image-Classification

Diff for: answers.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# answers.py
2+
# ----------
3+
# Licensing Information: Please do not distribute or publish solutions to this
4+
# project. You are free to use and extend these projects for educational
5+
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
6+
# John DeNero ([email protected]) and Dan Klein ([email protected]).
7+
# For more info, see http://inst.eecs.berkeley.edu/~cs188/sp09/pacman.html
8+
9+
def q2():
10+
"*** YOUR CODE HERE ***"
11+
12+
def q4():
13+
"*** YOUR CODE HERE ***"

Diff for: classification.html

+803
Large diffs are not rendered by default.

Diff for: classificationMethod.py

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# classificationMethod.py
2+
# -----------------------
3+
# Licensing Information: Please do not distribute or publish solutions to this
4+
# project. You are free to use and extend these projects for educational
5+
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
6+
# John DeNero ([email protected]) and Dan Klein ([email protected]).
7+
# For more info, see http://inst.eecs.berkeley.edu/~cs188/sp09/pacman.html
8+
9+
# This file contains the abstract class ClassificationMethod
10+
11+
class ClassificationMethod:
12+
"""
13+
ClassificationMethod is the abstract superclass of
14+
- MostFrequentClassifier
15+
- NaiveBayesClassifier
16+
- PerceptronClassifier
17+
- MiraClassifier
18+
19+
As such, you need not add any code to this file. You can write
20+
all of your implementation code in the files for the individual
21+
classification methods listed above.
22+
"""
23+
def __init__(self, legalLabels):
24+
"""
25+
For digits dataset, the set of legal labels will be 0,1,..,9
26+
For faces dataset, the set of legal labels will be 0 (non-face) or 1 (face)
27+
"""
28+
self.legalLabels = legalLabels
29+
30+
31+
def train(self, trainingData, trainingLabels, validationData, validationLabels):
32+
"""
33+
This is the supervised training function for the classifier. Two sets of
34+
labeled data are passed in: a large training set and a small validation set.
35+
36+
Many types of classifiers have a common training structure in practice: using
37+
training data for the main supervised training loop but tuning certain parameters
38+
with a small held-out validation set.
39+
40+
For some classifiers (naive Bayes, MIRA), you will need to return the parameters'
41+
values after traning and tuning step.
42+
43+
To make the classifier generic to multiple problems, the data should be represented
44+
as lists of Counters containing feature descriptions and their counts.
45+
"""
46+
abstract
47+
48+
def classify(self, data):
49+
"""
50+
This function returns a list of labels, each drawn from the set of legal labels
51+
provided to the classifier upon construction.
52+
53+
To make the classifier generic to multiple problems, the data should be represented
54+
as lists of Counters containing feature descriptions and their counts.
55+
"""
56+
abstract
57+

Diff for: classificationMethod.pyc

2.38 KB
Binary file not shown.

Diff for: commands.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
python dataClassifier.py
2+
python dataClassifier.py -h
3+
python dataClassifier.py -c naiveBayes --autotune
4+
python dataClassifier.py -a -d digits -c naiveBayes -o -1 3 -2 6
5+
python dataClassifier.py -c perceptron
6+
python dataClassifier.py -c perceptron -w
7+
python dataClassifier.py -c mira --autotune
8+
python dataClassifier.py -d digits -c naiveBayes -f -a -t 1000
9+
python dataClassifier.py -d digits -c minicontest
10+
python runMinicontest.py

Diff for: data.zip

802 KB
Binary file not shown.

0 commit comments

Comments
 (0)