Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.

Minor bugfixes, including #86 #88

Merged
merged 12 commits into from
Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions examples/qmlearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ def models():
energies = np.loadtxt("../test/data/hof_qm7.txt", usecols=1)
model = qmlearn.representations.CoulombMatrix(data)
# Create 1000 random indices
indices = np.arange(1000)
np.random.shuffle(indices)
indices = np.random.choice(np.arange(len(energies)), size=1000, replace=False)

representations = model.generate(indices)
model = qmlearn.kernels.GaussianKernel(sigma='auto')
Expand Down Expand Up @@ -184,8 +183,7 @@ def pipelines():
)

# Create 1000 random indices
indices = np.arange(1000)
np.random.shuffle(indices)
indices = np.random.choice(np.arange(len(energies)), size=1000, replace=False)

model.fit(indices[:800])
scores = model.score(indices[800:])
Expand All @@ -203,8 +201,7 @@ def pipelines():
)

# Create 1000 random indices
indices = np.arange(1000)
np.random.shuffle(indices)
indices = np.random.choice(np.arange(len(energies)), size=1000, replace=False)

model.fit(indices[:800])
scores = model.score(indices[800:])
Expand Down Expand Up @@ -293,8 +290,7 @@ def cross_validation():
)

# Create 1000 random indices
indices = np.arange(1000)
np.random.shuffle(indices)
indices = np.random.choice(np.arange(len(energies)), size=1000, replace=False)

# 3-fold CV of a given model can easily be done
scores = sklearn.model_selection.cross_validate(model, indices, cv=3)
Expand Down Expand Up @@ -344,4 +340,4 @@ def cross_validation():
pipelines()
cross_validation()
pipelines_2()
pipelines_3()
pipelines_3()
Loading