Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
91793c63
Commit
91793c63
authored
Apr 24, 2015
by
panos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A comment corrected in the object
parent
dd71db89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
dream/KnowledgeExtraction/ReplaceMissingValues.py
dream/KnowledgeExtraction/ReplaceMissingValues.py
+1
-3
No files found.
dream/KnowledgeExtraction/ReplaceMissingValues.py
View file @
91793c63
...
...
@@ -24,7 +24,7 @@ Created on 19 Feb 2014
'''
from
StatisticalMeasures
import
StatisticalMeasures
#The
Handl
eMissingValues object
#The
Replac
eMissingValues object
class
ReplaceMissingValues
(
StatisticalMeasures
):
#Three different approaches to handle missing values are included in this object
def
ReplaceWithZero
(
self
,
mylist
):
#Replace in the given list the missing values with zero
...
...
@@ -46,7 +46,6 @@ class ReplaceMissingValues(StatisticalMeasures):
def
ReplaceWithMean
(
self
,
mylist
):
#Replace in the given list the missing values with the mean value
list1
=
self
.
DeleteMissingValue
(
mylist
)
#Create a new list, which is the given list deleting the missing values (calling the DeleteMissingValue method)
# mean=sum(list1)/float(len(list1)) #Calculate the mean value of the new list
mean
=
self
.
mean
(
list1
)
i
=
0
for
value
in
mylist
:
...
...
@@ -57,7 +56,6 @@ class ReplaceMissingValues(StatisticalMeasures):
def
ReplaceWithMedian
(
self
,
mylist
):
#Replace in the given list the missing values with the median value
list1
=
self
.
DeleteMissingValue
(
mylist
)
#Create a new list, which is the given list deleting the missing values (calling the DeleteMissingValue method)
# A=BasicStatisticalMeasures() #Call the BasicStatisticalMeasures to calculate the median value
median
=
self
.
median
(
list1
)
#Calculate the median value of the new list
i
=
0
for
value
in
mylist
:
...
...
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