-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from JeremyBrent/jb/fsa_exp_refactor
FSA Experiment refactor
- Loading branch information
Showing
5 changed files
with
171 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import os | ||
|
||
PROJECT_ROOT_PATH = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir)) | ||
|
||
CPU_COUNT: int = 8 | ||
PARALLEL_CHUNK_SIZE: int = 5 | ||
DATE_FORMAT: str = '%Y-%m-%d %H:%M:%S' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import unittest | ||
from src.experiment import Experiment | ||
|
||
|
||
class TestUtils(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
cls.experiment = Experiment() | ||
|
||
def test_convert_datetime(self): | ||
test_data = { | ||
0.0: "neutral", | ||
.92348: "positive", | ||
-.92348: "negative", | ||
0.043: "neutral", | ||
-0.043: "neutral", | ||
.051: "positive", | ||
-.051: "negative" | ||
} | ||
|
||
for input, expected_data in test_data.items(): | ||
actual_output = self.experiment._categorize_sentiment_range(input) | ||
self.assertEqual(actual_output, expected_data) |