Beispiel #1
0
int main()
{
    config_parse_remote_servers("servers.txt");

    trainingdata_t* data = trainingdata_new();

    int t;
    for(t=0;t<256;t++) {
        example_t*e = example_new(16);
        int s;
        for(s=0;s<16;s++) {
            e->inputs[s] = variable_new_continuous((lrand48()%256)/256.0);
        }
        e->desired_response = variable_new_categorical(t%2);
        trainingdata_add_example(data, e);
    }

    trainingdata_save(data, "/tmp/data.data");
    trainingdata_destroy(data);

    data = trainingdata_load("/tmp/data.data");

    model_t*m = model_select(data);

    char*code = model_generate_code(m, "python");
    printf("%s\n", code);
    free(code);

    model_destroy(m);

    trainingdata_destroy(data);
}
Beispiel #2
0
//---------------------------------------------------------------------
static void dataset_dealloc(PyObject* _self) {
    DataSetObject* self = (DataSetObject*)_self;
    trainingdata_destroy(self->data);
    PyObject_Del(self);
}