Skip to content

Instantly share code, notes, and snippets.

AttributeRepresentation rep = new JSONAttributeRepresentation(Reader jsonReader);
List<Attributes> attributes = rep.newAttributeList();
Map<Attribute, String> roles = new HashMap<Attribute, String>();
Attribute id = attributes.get(0);
roles.put(id, Attributes.ID_NAME);
final class JSONAttributeRepresentation implements AttributeRepresentation {
private final List<Attribute> attributes;
public JSONAttributeRepresentation(Reader JSONReader) {
// Read in json however you want
// Get name, type, and role for each
// for each create attribute with the name and type
// Attribute att = AttributeFactory.createAttribute(name, type)
// atributes.add(att);
@dacamo76
dacamo76 / attributes.json
Last active October 28, 2019 04:56
RapidMiner Attributes snippet
[
{
"teamID": {
"type": "nominal",
"role": "id"
}
},
{
"size": {
"type": "integer"
@dacamo76
dacamo76 / AttributeRepresentation.java
Created October 28, 2019 04:54
Medium blog article
interface AttributeRepresentation {
List<Attribute> newAttributeList();
}
@dacamo76
dacamo76 / README.md
Last active September 26, 2017 21:49
Installing scikit-learn on Amazon Linux AMI on EC2

To install scikit-learn easily run the following command.

curl https://gist.githubusercontent.com/dacamo76/4780765/raw/c3779996d8f6b13caaaa48d33aa1585684c7f8e6/scikit-learn-install.sh | sh

Please look over the shell file being run to make sure no evil is done to your machine.

@dacamo76
dacamo76 / DataRowFactory2.java
Last active July 8, 2017 20:22
Working example how to create an ExampleSet in RapidMiner 5.1
package com.dacamo76.librapidminer;
import com.rapidminer.example.Attribute;
import com.rapidminer.example.table.DataRow;
import com.rapidminer.example.table.DataRowFactory;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Iterables.toArray;
public abstract class DataRowFactory2 {
@dacamo76
dacamo76 / git-update.sh
Created December 13, 2013 17:08
Updates Git. Always stay on master branch. Install Git from source. Clone git/git repository from GitHub. Install Git from cloned repo. Remove old version of Git.
#!/usr/bin/env bash
prefix=~/opt
function compile {
make clean
make prefix=${prefix}
make prefix=${prefix} install
}
@dacamo76
dacamo76 / Gemfile
Last active December 12, 2015 01:38 — forked from wjlroe/Gemfile
Example running webmachine-ruby on Heroku
source :rubygems
gem 'webmachine'
gem 'unicorn'
@dacamo76
dacamo76 / s3get.py
Created December 7, 2012 19:39
Get keys recursively from S3
#!/usr/bin/env python
import boto
import os
import sys
bucket_name = str(sys.argv[1])
dirname = str(sys.argv[2])
def files(keys):
@dacamo76
dacamo76 / ant-simulator-modules.lisp
Created March 27, 2012 04:23
Jess wiki ant simulator using modules
;; Module Ant Simulator
;; Modified slightly by Daniel Alberto Cañas
;; Based on Salient Ant Simulator
;; by Jason Morris
;; found at http://www.jessrules.com/jesswiki/view?SalientAntSimulator
(clear)
;; An ant's priorities in order of importance
;; Threat (Enemy attacking)