-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
some shape fixing stuff for lang -> info plane measurement
- Loading branch information
Showing
4 changed files
with
16 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
import pandas as pd | ||
import pickle | ||
|
||
from ultk.language.semantics import Universe | ||
|
||
|
||
if __name__ == "__main__": | ||
referents = pd.read_csv("colors/data/cnum-vhcm-lab-new.txt", delimiter="\t") | ||
referents.sort_values(by="#cnum", inplace=True) | ||
# add a name column, as required by ULTK | ||
referents["name"] = referents["#cnum"] | ||
# rename columns for access as python properties | ||
referents.rename(columns={"L*": "L", "a*": "a", "b*": "b"}, inplace=True) | ||
referents.to_csv("colors/outputs/color_universe.csv", index=False) | ||
""" | ||
color_universe = Universe.from_dataframe(referents) | ||
with open("colors/outputs/color_universe.pkl", "wb") as f: | ||
pickle.dump(color_universe, f) | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters