Skip to content

Commit

Permalink
v0.4.3
Browse files Browse the repository at this point in the history
changelog:
- added BatesGranger method in TimeSeries module
  • Loading branch information
bdiptesh committed Feb 15, 2024
1 parent 81ad04b commit b0b4226
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions bin/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ printf "=%.0s" {1..70}
# Run unit tests
if [[ $module == "-a" || $module == "-u" ]]
then
printf "\nRunning unit & integration tests ...\n\n"
coverage run -m unittest discover -v -s $test_dir -p "test_*.py"
printf "=%.0s" {1..70}
printf "\n"
printf "\nComputing test coverage ...\n\n"
coverage report -m --omit="*/tests/test_*,*/opt/spark-*" 2>&1 | tee "$proj_dir/logs/cov.out"
COV_SCORE=`grep "TOTAL" $proj_dir/logs/cov.out | tail -1 | awk '{ printf("%d", $4) }'`
Expand All @@ -41,10 +45,6 @@ then
fi
sed -i "3s/.*/\[\!\[Coverage score\]\(\https\:\/\/img\.shields\.io\/badge\/coverage\-$COV_SCORE\%25\-$COV_COLOR.svg\)\]\(\.\/logs\/cov\.out\)/" "$proj_dir/README.md"
printf "=%.0s" {1..70}
printf "\n"
printf "\nRunning unit & integration tests ...\n\n"
coverage run -m unittest discover -v -s $test_dir -p "test_*.py"
printf "=%.0s" {1..70}
fi

# Rate coding styles for all python scripts
Expand Down
4 changes: 2 additions & 2 deletions logs/cov.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mllib/lib/cluster.py 103 0 100%
mllib/lib/knn.py 70 0 100%
mllib/lib/model.py 45 0 100%
mllib/lib/opt.py 147 0 100%
mllib/lib/timeseries.py 60 0 100%
mllib/lib/timeseries.py 89 0 100%
mllib/lib/tree.py 158 0 100%
-------------------------------------------------------
TOTAL 583 0 100%
TOTAL 612 0 100%
4 changes: 2 additions & 2 deletions logs/pylint/lib-timeseries-py.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ timeseries.py:202:41: I1101: Module 'metrics' has no 'mae' member, but source is
timeseries.py:203:42: I1101: Module 'metrics' has no 'mape' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
timeseries.py:204:42: I1101: Module 'metrics' has no 'rmse' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 9.89/10, +0.11)

4 changes: 2 additions & 2 deletions mllib/lib/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def __init__(self,
y: str,
y_hat: List[str],
lag: int = 1
):
):
"""Initialize variables."""
self.df = df
self.y = y
Expand All @@ -320,7 +320,7 @@ def predict(self):
"""
for i in self.y_hat:
self.df["sq_error_" + i] = (abs(self.df[i] - self.df[self.y])
* 100 / self.df[self.y] ) ** 2
* 100 / self.df[self.y]) ** 2
for epoch in range(len(self.fcst)-self.lag):
df_tmp = self.df.iloc[epoch:self.lag+epoch]
mse_val = [np.mean(df_tmp["sq_error_" + i]) for i in self.y_hat]
Expand Down

0 comments on commit b0b4226

Please sign in to comment.