https://github.com/openml/openml-keras
Keras extension for openml-python
https://github.com/openml/openml-keras
hacktoberfest keras openml python
Last synced: about 2 months ago
JSON representation
Keras extension for openml-python
- Host: GitHub
- URL: https://github.com/openml/openml-keras
- Owner: openml
- License: bsd-3-clause
- Created: 2019-11-25T14:09:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-24T23:15:15.000Z (about 3 years ago)
- Last Synced: 2026-03-16T01:51:27.018Z (3 months ago)
- Topics: hacktoberfest, keras, openml, python
- Language: Python
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Keras extension for OpenML python
Keras extension for [openml-python API](https://github.com/openml/openml-python).
#### Installation Instructions:
`pip install openml-keras`
PyPi link https://pypi.org/project/openml-keras/
#### Usage
Import openML libraries
```python
import openml
import openml_keras
```
Create and compile a keras model
```python
model = keras.models.Sequential([
keras.layers.BatchNormalization(),
keras.layers.Dense(units=1024, activation=keras.activations.relu),
keras.layers.Dropout(rate=0.4),
keras.layers.Dense(units=2, activation=keras.activations.softmax),
])
# We will compile using the Adam optimizer while targeting accuracy.
model.compile(optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
```
Download the task from openML and run the model on task.
```python
task = openml.tasks.get_task(3573)
run = openml.runs.run_model_on_task(model, task, avoid_duplicate_runs=False)
run.publish()
print('URL for run: %s/run/%d' % (openml.config.server, run.run_id))
```
Note: The input layer of the network should be compatible with OpenML data output shape. Please check examples for more information.