Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Topological_Machine_Learning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Colbry, Dirk
Topological_Machine_Learning
Commits
423c9507
Commit
423c9507
authored
5 years ago
by
shawk masboob
Browse files
Options
Downloads
Patches
Plain Diff
deleted unnecessary tests
parent
233b81cb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_Prediction.py
+27
-21
27 additions, 21 deletions
test/test_Prediction.py
with
27 additions
and
21 deletions
test/test_Prediction.py
+
27
−
21
View file @
423c9507
import
TDA_Prediction
as
tdap
from
Topological_ML
import
TDA_Prediction
as
tdap
from
sklearn.datasets
import
fetch_california_housing
from
sklearn.model_selection
import
train_test_split
from
sklearn.linear_model
import
LinearRegression
import
kmapper
as
km
import
pandas
as
pd
from
unittest.mock
import
patch
,
Mock
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
sklearn
from
sklearn
import
ensemble
def
test_numpy_to_pandas
():
from
sklearn.datasets
import
fetch_california_housing
cal_housing
=
fetch_california_housing
()
value
=
tdap
.
numpy_to_pandas
(
cal_housing
)
assert
value
==
df
def
test_data_summary
():
data
=
pd
.
DataFrame
({
"
A
"
:
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
]})
correct_response
=
{
"
head
"
:
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
],
"
shape
"
:
[
10
,
1
],
"
describe
"
:
0
}
values
=
tdap
.
data_summary
(
data
,
5
)
assert
values
==
correct_response
return
def
test_accuracy_metrics1
():
values
=
tdap
.
accuracy_metrics
(
None
,
None
)
assert
values
==
None
return
def
test_linear_regression
():
a
=
pd
.
DataFrame
({
"
A
"
:
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
]})
b
=
pd
.
DataFrame
({
"
B
"
:
[
2
,
4
,
6
,
8
,
10
,
12
,
14
,
16
,
18
,
20
]})
correct_response
=
1
values
=
tdap
.
linear_regression
(
a
,
b
)
assert
values
==
correct_response
return
def
test_accuracy_metrics2
():
values
=
tdap
.
accuracy_metrics
({},
None
)
assert
values
==
None
return
def
test_lens_1d
():
a
=
pd
.
DataFrame
({
"
A
"
:
[
0
,
0
]})
correct_response
=
np
.
array
([[
0.
,
0.
],[
0.
,
0.
]])
values
=
tdap
.
lens_1d
(
a
,
123
,
1
)
assert
values
==
correct_response
return
def
test_descriptive_statistic
():
data
=
pd
.
DataFrame
({
'
a
'
:[
1
,
2
,
3
,
4
,
5
]})
values
=
tdap
.
descriptive_statistic
(
data
,
5
)
assert
values
==
5
return
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment