-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf09ab7
commit 245ab4c
Showing
12 changed files
with
6,327 additions
and
22 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,189 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
const StyledSwaggerUI = styled.div` | ||
[id^="model-"][id*="_"] { | ||
display: none; | ||
} | ||
[id^="model-"][id*="List"] { | ||
display: none; | ||
} | ||
[id^="model-"][id*="Unprocessed"] { | ||
display: none; | ||
} | ||
[id^="model-"][id*="Request"] { | ||
display: none; | ||
} | ||
[id^="model-"][id*="Trace"] { | ||
display: none; | ||
} | ||
.swagger-ui, | ||
.swagger-ui *, | ||
.swagger-ui .info .title, | ||
.swagger-ui .info p, | ||
.swagger-ui .info li, | ||
.swagger-ui select, | ||
.swagger-ui .opblock *, | ||
.swagger-ui .opblock .opblock-section-header * { | ||
color: ${(props) => props.theme.palette.text.primary}; | ||
} | ||
.swagger-ui .info a { | ||
color: ${(props) => props.theme.palette.text.secondary}; | ||
} | ||
.swagger-ui select, | ||
.swagger-ui .opblock, | ||
.swagger-ui .opblock-tag, | ||
.swagger-ui section.models .model-container, | ||
.swagger-ui .opblock .opblock-section-header { | ||
background-color: ${(props) => props.theme.palette.background.paper}; | ||
} | ||
.swagger-ui .model, | ||
.swagger-ui table.model tr.property-row td { | ||
font-size: 10pt !important; | ||
} | ||
.swagger-ui .model-title { | ||
font-size: 12pt !important; | ||
} | ||
.swagger-ui .model-toggle:after { | ||
background: ${(props) => | ||
`url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='${encodeURIComponent( | ||
props.theme.name == "DARK" | ||
? props.theme.palette.primary.contrastText | ||
: "#000", | ||
)}' d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E") 50% no-repeat`}; | ||
} | ||
.swagger-ui .expand-methods svg, | ||
.swagger-ui .opblock svg, | ||
.swagger-ui .expand-operation svg { | ||
fill: ${(props) => | ||
props.theme.name == "DARK" | ||
? props.theme.palette.primary.contrastText | ||
: "#000"}; | ||
} | ||
.swagger-ui .scheme-container { | ||
background: inherit; | ||
box-shadow: none; | ||
} | ||
.swagger-ui .wrapper:nth-of-type(2n):before { | ||
content: "Actions"; | ||
font-size: 18pt; | ||
font-weight: 600; | ||
} | ||
#operations-tag-data { | ||
margin-top: 20px; | ||
} | ||
.swagger-ui .scheme-container { | ||
direction: rtl; | ||
display: flex; | ||
justify-content: flex-end; | ||
padding: 0; | ||
} | ||
.swagger-ui section.schemes { | ||
margin-left: auto; | ||
} | ||
.swagger-ui .servers { | ||
width: 320px; | ||
} | ||
.swagger-ui .servers > label { | ||
margin: 0; | ||
} | ||
.swagger-ui section.models .model-container { | ||
margin: 0; | ||
border-bottom: 1px solid rgba(59, 65, 81, 0.3); | ||
border-radius: 0px; | ||
box-shadow: | ||
0 2px 2px 0 rgba(0, 0, 0, 0.14), | ||
0 3px 1px -2px rgba(0, 0, 0, 0.2), | ||
0 1px 5px 0 rgba(0, 0, 0, 0.12); | ||
} | ||
.swagger-ui section.models .model-container:last-of-type { | ||
margin: 0; | ||
} | ||
.swagger-ui section.models.is-open { | ||
padding: 0px; | ||
} | ||
.swagger-ui section.models { | ||
border: none; | ||
} | ||
.swagger-ui section.models h4 { | ||
margin-bottom: 10px; | ||
font-size: 18pt; | ||
font-weight: 600; | ||
} | ||
.swagger-ui section.models.is-open h4 { | ||
margin-top: 20px; | ||
margin-bottom: 0px; | ||
border-bottom: 0px; | ||
} | ||
.swagger-ui .info { | ||
margin-bottom: 0px; | ||
} | ||
.swagger-ui .servers > label select { | ||
height: 40px; | ||
} | ||
.swagger-ui table.model tr.property-row td { | ||
padding: 0.6em; | ||
font-size: 12pt; | ||
} | ||
.swagger-ui td .model .pointer .model-title { | ||
display: none; | ||
} | ||
.swagger-ui .model-box { | ||
padding-top: 7px; | ||
padding-left: 5px; | ||
padding-bottom: 7px; | ||
} | ||
.swagger-ui .model, | ||
.model-title { | ||
font-size: 12pt; | ||
text-transform: lowercase; | ||
} | ||
.swagger-ui .model-title__text { | ||
padding-left: 10px; | ||
} | ||
.swagger-ui td .model-toggle { | ||
font-size: 20px; | ||
top: 2px; | ||
margin-left: 0px; | ||
} | ||
.swagger-ui td .brace-open { | ||
font-size: 16px; | ||
} | ||
.renderedMarkdown { | ||
} | ||
.swagger-ui .opblock-tag { | ||
margin: 0px; | ||
box-shadow: | ||
0 2px 2px 0 rgba(0, 0, 0, 0.14), | ||
0 3px 1px -2px rgba(0, 0, 0, 0.2), | ||
0 1px 5px 0 rgba(0, 0, 0, 0.12); | ||
} | ||
.no-margin { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
.swagger-ui .opblock-tag-section h4 { | ||
padding-left: 20px; | ||
font-size: 12pt; | ||
height: 50px; | ||
} | ||
.swagger-ui .opblock-get { | ||
padding-left: 5px; | ||
margin-bottom: 1px; | ||
} | ||
.swagger-ui .opblock-post { | ||
padding-left: 5px; | ||
margin-bottom: 1px; | ||
order: 2; | ||
} | ||
.swagger-ui .opblock-delete { | ||
padding-left: 5px; | ||
margin-bottom: 1px; | ||
order: 3; | ||
} | ||
.swagger-ui .opblock-summary { | ||
height: 50px; | ||
} | ||
`; | ||
|
||
export default StyledSwaggerUI; |
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,34 @@ | ||
// Installation | ||
export const InstallationExample = `// Download the jar file, or install via Maven. See the full docs.`; | ||
|
||
// Query and download data | ||
export const DataExample = `// Create a client. Your API key can be found in your account. | ||
OpenmlConnector openml = new OpenmlConnector("api_key"); | ||
// List all datasets and their properties | ||
DataSet[] datasets = openml.dataList(); | ||
// Get dataset by ID | ||
DataSetDescription data = openml.dataGet(40996); | ||
String file_url = data.getUrl();`; | ||
|
||
// Run and publish models | ||
export const RunExample = `// Build any model you like | ||
Classifier model = new RandomForest(); | ||
// Download any OpenML task | ||
Task t = openml.taskGet(3954); | ||
// Load the data as WEKA Instances (optional) | ||
Instances d = InstancesHelper.getDatasetFromTask(openml, t); | ||
// Run and evaluate your model on the task, and upload to OpenML | ||
Pair<Integer, Run> result = RunOpenmlJob.executeTask(openml, new WekaConfig(), 3954, model);`; | ||
|
||
// Using Benchmarks | ||
export const BenchmarkExample = `// List all tasks in a benchmark | ||
Study benchmark = openml.studyGet("OpenML-CC18", "tasks"); | ||
Task[] tasks = benchmark.getTasks() | ||
// Return benchmark results | ||
EvaluationList el = openml.evaluationList(tasks, null, "area_under_roc_curve", 1000);`; |
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,17 @@ | ||
// Installation | ||
export const InstallationExample = `using Pkg | ||
Pkg.add("OpenML")`; | ||
|
||
// Query and download data | ||
export const DataExample = `using OpenML | ||
using DataFrames | ||
# List all datasets and their properties | ||
ds = OpenML.list_datasets(output_format = DataFrame) | ||
# Get dataset by ID | ||
OpenML.describe_dataset(40996) | ||
# Get the data itself as a dataframe (or otherwise) | ||
table = OpenML.load(40996) | ||
df = DataFrame(table)`; |
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,46 @@ | ||
// Installation | ||
export const InstallationExample = `pip install openml`; | ||
|
||
// Query and download data | ||
export const DataExample = `import openml | ||
# List all datasets and their properties | ||
openml.datasets.list_datasets(output_format="dataframe") | ||
# Get dataset by ID | ||
dataset = openml.datasets.get_dataset(61) | ||
# Get dataset by name | ||
dataset = openml.datasets.get_dataset('Fashion-MNIST') | ||
# Get the data itself as a dataframe (or otherwise) | ||
X, y, _, _ = dataset.get_data(dataset_format="dataframe")`; | ||
|
||
// Run and publish models | ||
export const RunExample = `from sklearn import ensemble | ||
from openml import tasks, runs | ||
# Build any model you like | ||
clf = ensemble.RandomForestClassifier() | ||
# Download any OpenML task | ||
task = tasks.get_task(3954) | ||
# Run and evaluate your model on the task | ||
run = runs.run_model_on_task(clf, task) | ||
# Share the results on OpenML. Your API key can be found in your account. | ||
# openml.config.apikey = 'YOUR_KEY' | ||
run.publish()`; | ||
|
||
// Using Benchmarks | ||
export const BenchmarkExample = `# List all tasks in a benchmark | ||
benchmark = openml.study.get_suite('OpenML-CC18') | ||
tasks.list_tasks(output_format="dataframe", task_id=benchmark.tasks) | ||
# Return benchmark results | ||
openml.evaluations.list_evaluations( | ||
function="area_under_roc_curve", | ||
tasks=benchmark.tasks, | ||
output_format="dataframe" | ||
)`; |
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,44 @@ | ||
// Installation | ||
export const InstallationExample = `# Note: The old OpenML package is superseded by the mlr3oml package. | ||
# The documentation of the OpenML package can be found here: http://openml.github.io/openml-r/. | ||
install.packages("mlr3oml")`; | ||
|
||
// Query and download data | ||
export const DataExample = `library(mlr3oml) | ||
library(mlr3) | ||
# Search for specific datasets | ||
odatasets = list_oml_data( | ||
number_features = c(10, 20), | ||
number_instances = c(45000, 50000), | ||
number_classes = 2 | ||
) | ||
# Get dataset | ||
odata = odt(id = 1590) | ||
# Access the actual data | ||
odata$data | ||
# Convert to an mlr3::Task | ||
tsk_adult = as_task(odata, target = "class")`; | ||
|
||
// Run and publish models | ||
export const RunExample = `# create an mlr3 Learner and Resampling and run a resample experiment | ||
rr = resample( | ||
task = tsk_adult, | ||
learner = lrn("classif.rpart"), | ||
resampling = rsmp("cv", folds = 10) | ||
)`; | ||
|
||
// Using Benchmarks | ||
export const BenchmarkExample = `# Access a Benchmark Suite | ||
ocollection = ocl(353) | ||
# The IDs | ||
ocollection$task_ids | ||
id = ocollection$task_ids[1L] | ||
# Create mlr3 Task and Resampling from the OpenML Task | ||
task = tsk("oml", task_id = id) | ||
resampling = rsmp("oml", task_id = id)`; |
Oops, something went wrong.