Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
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
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
Leipzig Machine Learning Group
conML
python
Commits
0ee66d4d
Commit
0ee66d4d
authored
5 years ago
by
dmt
Browse files
Options
Downloads
Patches
Plain Diff
Provide property for checking if the data block has labels or not.
parent
bbb66be9
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
cml/ports/source_adapters.py
+13
-0
13 additions, 0 deletions
cml/ports/source_adapters.py
with
13 additions
and
0 deletions
cml/ports/source_adapters.py
+
13
−
0
View file @
0ee66d4d
from
typing
import
List
from
abc
import
abstractmethod
,
ABC
from
abc
import
abstractmethod
,
ABC
import
pandas
as
pd
import
pandas
as
pd
...
@@ -59,6 +60,18 @@ class PandasBlock:
...
@@ -59,6 +60,18 @@ class PandasBlock:
def
__len__
(
self
):
def
__len__
(
self
):
return
self
.
__data_block
.
shape
[
0
]
return
self
.
__data_block
.
shape
[
0
]
@property
def
labeled
(
self
):
return
not
self
.
__data_block
.
Z
.
nunique
()
==
1
@property
def
columns
(
self
):
return
list
(
self
.
__data_block
.
columns
)
@property
def
n_features
(
self
):
return
self
.
__data_block
.
shape
[
1
]
-
self
.
_LAST_THREE_COLUMNS
def
as_numpy_array
(
self
):
def
as_numpy_array
(
self
):
return
self
.
__data_block
[
return
self
.
__data_block
[
self
.
__data_block
.
columns
[
self
.
__data_block
.
columns
[
...
...
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