Skip to content

Commit e3c4579

Browse files
gustavocidornelaswhoseoyster
authored andcommitted
Fixes OPEN-3929 Sphinx errors and warnings while generating Python API documentation
1 parent 60041ae commit e3c4579

File tree

5 files changed

+59
-40
lines changed

5 files changed

+59
-40
lines changed

docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
66
.. module:: openlayer
77

8-
*******************
8+
***********************
99
Openlayer Documentation
10-
*******************
10+
***********************
1111

1212
**Date**: |today| **Version**: |version|
1313

docs/source/reference/upload.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ Version control flow
4545
OpenlayerClient.status
4646
OpenlayerClient.restore
4747

48-
Dataset / Task types
49-
--------------------
48+
Task types
49+
----------
5050
.. autosummary::
5151
:toctree: api/
5252

53-
DatasetType
5453
TaskType
5554

openlayer/__init__.py

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -516,46 +516,51 @@ def add_dataset(
516516
517517
The YAML file with the dataset config must have the following fields:
518518
519-
- ``columnNames`` : List[str]
519+
columnNames : List[str]
520520
List of the dataset's column names.
521-
- ``classNames`` : List[str]
521+
classNames : List[str]
522522
List of class names indexed by label integer in the dataset.
523523
E.g. ``[negative, positive]`` when ``[0, 1]`` are in your label column.
524-
- ``labelColumnName`` : str
524+
labelColumnName : str
525525
Column header in the csv containing the labels.
526526
527527
.. important::
528528
The labels in this column must be zero-indexed integer values.
529-
- ``label`` : str
529+
label : str
530530
Type of dataset. E.g. ``'training'`` or
531531
``'validation'``.
532-
- ``featureNames`` : List[str], default []
532+
featureNames : List[str], default []
533533
List of input feature names. Only applicable if your ``task_type`` is
534534
:obj:`TaskType.TabularClassification` or :obj:`TaskType.TabularRegression`.
535-
- ``textColumnName`` : str, default None
535+
textColumnName : str, default None
536536
Column header in the csv containing the input text. Only applicable if
537537
your ``task_type`` is :obj:`TaskType.TextClassification`.
538-
- ``predictionsColumnName`` : str, default None
538+
predictionsColumnName : str, default None
539539
Column header in the csv containing the predictions. Only applicable if you
540540
are uploading a model as well with the :obj:`add_model` method.
541541
542542
.. important::
543543
Each cell in this column must contain a list of
544544
class probabilities. For example, for a binary classification
545-
task, the cell values should look like this:
546-
.. csv-table::
547-
:header: ..., predictions
548-
..., "[0.6650292861587155, 0.3349707138412845]"
549-
..., "[0.8145561636482788, 0.18544383635172124]"
545+
task, the column with the predictions should look like this:
550546
551-
- ``categoricalFeatureNames`` : List[str], default []
547+
**predictions**
548+
549+
``[0.1, 0.9]``
550+
551+
``[0.8, 0.2]``
552+
553+
``...``
554+
555+
categoricalFeatureNames : List[str], default []
552556
A list containing the names of all categorical features in the dataset.
553557
E.g. ``["Gender", "Geography"]``. Only applicable if your ``task_type`` is
554558
:obj:`TaskType.TabularClassification` or :obj:`TaskType.TabularRegression`.
555-
- ``language`` : str, default 'en'
559+
language : str, default 'en'
556560
The language of the dataset in ISO 639-1 (alpha-2 code) format.
557-
- ``sep`` : str, default ','
561+
sep : str, default ','
558562
Delimiter to use. E.g. `'\\t'`.
563+
559564
force : bool
560565
If :obj:`add_dataset` is called when there is already a dataset of the same type
561566
in the staging area, when ``force=True``, the existing staged dataset will be
@@ -727,46 +732,51 @@ def add_dataframe(
727732
728733
The YAML file with the dataset config must have the following fields:
729734
730-
- ``columnNames`` : List[str]
735+
columnNames : List[str]
731736
List of the dataset's column names.
732-
- ``classNames`` : List[str]
737+
classNames : List[str]
733738
List of class names indexed by label integer in the dataset.
734739
E.g. ``[negative, positive]`` when ``[0, 1]`` are in your label column.
735-
- ``labelColumnName`` : str
736-
Column header in the csv containing the labels.
740+
labelColumnName : str
741+
Column header in the dataframe containing the labels.
737742
738743
.. important::
739744
The labels in this column must be zero-indexed integer values.
740-
- ``label`` : str
745+
label : str
741746
Type of dataset. E.g. ``'training'`` or
742747
``'validation'``.
743-
- ``featureNames`` : List[str], default []
748+
featureNames : List[str], default []
744749
List of input feature names. Only applicable if your ``task_type`` is
745750
:obj:`TaskType.TabularClassification` or :obj:`TaskType.TabularRegression`.
746-
- ``textColumnName`` : str, default None
747-
Column header in the csv containing the input text. Only applicable if your
748-
``task_type`` is :obj:`TaskType.TextClassification`.
749-
- ``predictionsColumnName`` : str, default None
750-
Column header in the csv containing the predictions. Only applicable if you
751+
textColumnName : str, default None
752+
Column header in the dataframe containing the input text. Only applicable if
753+
your ``task_type`` is :obj:`TaskType.TextClassification`.
754+
predictionsColumnName : str, default None
755+
Column header in the dataframe containing the predictions. Only applicable if you
751756
are uploading a model as well with the :obj:`add_model` method.
752757
753758
.. important::
754759
Each cell in this column must contain a list of
755760
class probabilities. For example, for a binary classification
756-
task, the cell values should look like this:
757-
.. csv-table::
758-
:header: ..., predictions
759-
..., "[0.6650292861587155, 0.3349707138412845]"
760-
..., "[0.8145561636482788, 0.18544383635172124]"
761+
task, the column with the predictions should look like this:
761762
762-
- ``categoricalFeatureNames`` : List[str], default []
763+
**predictions**
764+
765+
``[0.1, 0.9]``
766+
767+
``[0.8, 0.2]``
768+
769+
``...``
770+
771+
categoricalFeatureNames : List[str], default []
763772
A list containing the names of all categorical features in the dataset.
764773
E.g. ``["Gender", "Geography"]``. Only applicable if your ``task_type`` is
765774
:obj:`TaskType.TabularClassification` or :obj:`TaskType.TabularRegression`.
766-
- ``language`` : str, default 'en'
775+
language : str, default 'en'
767776
The language of the dataset in ISO 639-1 (alpha-2 code) format.
768-
- ``sep`` : str, default ','
777+
sep : str, default ','
769778
Delimiter to use. E.g. `'\\t'`.
779+
770780
force : bool
771781
If :obj:`add_dataframe` is called when there is already a dataset of the same
772782
type in the staging area, when ``force=True``, the existing staged dataset will
@@ -993,7 +1003,7 @@ def push(self, project_id: int):
9931003
Notes
9941004
-----
9951005
- To use this method, you must first have committed your changes with the :obj:`commit`
996-
method.
1006+
method.
9971007
9981008
Examples
9991009
--------

openlayer/validators.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,11 @@ class DatasetValidator:
617617
dataset_df : pd.DataFrame, optional
618618
The dataset to validate.
619619
620+
Methods
621+
-------
622+
validate:
623+
Runs all dataset validations.
624+
620625
Examples
621626
--------
622627
@@ -1070,6 +1075,11 @@ class ModelValidator:
10701075
sample_data : pd.DataFrame
10711076
Sample data to be used for the model validation.
10721077
1078+
Methods
1079+
-------
1080+
validate:
1081+
Runs all model validations.
1082+
10731083
Examples
10741084
--------
10751085

0 commit comments

Comments
 (0)