Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create base configuration files loadable from the command line #1

Closed
lucventurini opened this issue Sep 10, 2015 · 2 comments
Closed

Comments

@lucventurini
Copy link
Collaborator

At the moment, creating the configuration files is still a patchy process, by copying them manually from the sample_data location.

Mikado need to be able to do a "mikado.py configure" as a first step to create the necessary files.

Ideally, it would have two options:

  • copying the YAML from a predefined folder
  • configuring it on the fly using raw_input

Possible inspiration: sklearn.datasets.load_iris(); here is the code:

def load_iris():
module_path = dirname(file)
with open(join(module_path, 'data', 'iris.csv')) as csv_file:
data_file = csv.reader(csv_file)
temp = next(data_file)
n_samples = int(temp[0])
n_features = int(temp[1])
target_names = np.array(temp[2:])
data = np.empty((n_samples, n_features))
target = np.empty((n_samples,), dtype=np.int)

      for i, ir in enumerate(data_file):
          data[i] = np.asarray(ir[:-1], dtype=np.float)
          target[i] = np.asarray(ir[-1], dtype=np.int)

  with open(join(module_path, 'descr', 'iris.rst')) as rst_file:
      fdescr = rst_file.read()

  return Bunch(data=data, target=target,
               target_names=target_names,
               DESCR=fdescr,
               feature_names=['sepal length (cm)', 'sepal width (cm)',
                              'petal length (cm)', 'petal width (cm)'])
@lucventurini
Copy link
Collaborator Author

Progress in 0c2c04b. Switched to JSON schema, progress on the migration is good but still ongoing.

lucventurini pushed a commit that referenced this issue Oct 14, 2015
@lucventurini
Copy link
Collaborator Author

Solved in 5b972be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant