Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ease
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
ease
Commits
e6dddf72
Commit
e6dddf72
authored
Jun 13, 2014
by
gradyward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small bug fix: good pos ngrams in feature_estractor was being called before instantiation.
parent
4047b1a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
ease/create.py
+2
-2
ease/feature_extractor.py
+5
-4
No files found.
ease/create.py
View file @
e6dddf72
...
...
@@ -168,7 +168,7 @@ def _extract_features_and_generate_model(essay_set):
predict_classifier
,
cv_error_classifier
=
_instantiate_algorithms
(
algorithm
)
cv_error_results
=
get_cv_error
(
cv_error_classifier
,
features
,
essay_set
.
_scores
)
cv_error_results
=
_
get_cv_error
(
cv_error_classifier
,
features
,
essay_set
.
_scores
)
try
:
predict_classifier
.
fit
(
features
,
set_scores
)
...
...
@@ -213,7 +213,7 @@ def _instantiate_algorithms(algorithm):
return
clf
,
clf2
def
get_cv_error
(
classifier
,
features
,
scores
):
def
_
get_cv_error
(
classifier
,
features
,
scores
):
"""
Gets cross validated error for a given classifier, set of features, and scores
...
...
ease/feature_extractor.py
View file @
e6dddf72
...
...
@@ -47,6 +47,11 @@ class FeatureExtractor(object):
max_features_pass_2: The maximum number of features we consider on the second pass of vocabulary grooming
"""
self
.
_good_pos_ngrams
=
self
.
_get_good_pos_ngrams
()
self
.
_spell_errors_per_character
=
0
self
.
_grammar_errors_per_character
=
0
if
hasattr
(
essay_set
,
'_type'
):
if
essay_set
.
_type
==
"train"
:
# Finds vocabulary which differentiates good/high scoring essays from bad/low scoring essays.
...
...
@@ -99,10 +104,6 @@ class FeatureExtractor(object):
else
:
raise
util_functions
.
InputError
(
essay_set
,
"wrong input. need an essay set object."
)
self
.
_good_pos_ngrams
=
self
.
_get_good_pos_ngrams
()
self
.
_spell_errors_per_character
=
0
self
.
_grammar_errors_per_character
=
0
def
generate_features
(
self
,
essay_set
):
"""
Generates bag of words, length, and prompt features from an essay set object
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment