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
1f693f8d
Commit
1f693f8d
authored
Feb 13, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in count to train on
parent
e13aafa3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
tests/test_cv_full.py
+11
-2
No files found.
tests/test_cv_full.py
View file @
1f693f8d
...
...
@@ -64,7 +64,8 @@ def run_single_worker(args):
cv_preds
=
score1s
else
:
try
:
random_nums
=
list
(
numpy
.
random
.
random_integers
(
0
,
train_feats
.
shape
[
0
],
100
))
count_to_train_on
=
100
random_nums
=
list
(
numpy
.
random
.
random_integers
(
0
,
train_feats
.
shape
[
0
],
count_to_train_on
))
out_group_rows
=
[
row
for
row
in
xrange
(
0
,
train_feats
.
shape
[
0
])
if
row
not
in
random_nums
]
in_group_scores
=
list
(
numpy
.
array
(
score1s
)[
random_nums
])
out_group_scores
=
list
(
numpy
.
array
(
score1s
)[
out_group_rows
])
...
...
@@ -74,7 +75,15 @@ def run_single_worker(args):
model
=
util_functions
.
gen_model
(
clf
,
train_feats
[
random_nums
,:],
in_group_scores
)
cv_preds
=
util_functions
.
gen_preds
(
model
,
train_feats
[
out_group_rows
,:])
except
:
cv_preds
=
score1s
[
100
:]
print
"Error with generating cv preds"
random_nums
=
list
(
numpy
.
random
.
random_integers
(
0
,
train_feats
.
shape
[
0
],
count_to_train_on
))
out_group_rows
=
[
row
for
row
in
xrange
(
0
,
train_feats
.
shape
[
0
])
if
row
not
in
random_nums
]
in_group_scores
=
list
(
numpy
.
array
(
score1s
)[
random_nums
])
out_group_scores
=
list
(
numpy
.
array
(
score1s
)[
out_group_rows
])
out_group_score2s
=
list
(
numpy
.
array
(
score2s
)[
out_group_rows
])
score1s
=
out_group_scores
score2s
=
out_group_score2s
cv_preds
=
score1s
rounded_cv
=
[
int
(
round
(
cv
))
for
cv
in
list
(
cv_preds
)]
added_score1
=
[
s1
+
1
for
s1
in
score1s
]
...
...
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