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
import pywikibot | |
from pywikibot import pagegenerators as pg | |
site = pywikibot.Site(fam="commons") | |
cat = pywikibot.Category(site, 'Category:Media_from_the_National_Museums_of_World_Culture') | |
gen = pg.CategorizedPageGenerator(cat) | |
for page in gen: | |
filePage = pywikibot.FilePage(page) | |
try: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Author: **Mattias Östmar**\n", | |
"\n", | |
"Date: **2019-03-14**\n", | |
"\n", |
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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Author: **Mattias Östmar**\n", | |
"\n", | |
"Date: **2019-03-15**\n", | |
"\n", |
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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Author: **Mattias Östmar**\n", | |
"\n", | |
"Date: **2019-03-15**\n", | |
"\n", |
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
[in:] | |
tot_accuracy = sum(test['func'] == test['predicted']) / len(test) | |
print("Accuracy all 8 classes together: {}".format(tot_accuracy)) | |
# Total Cohens Kappa | |
tot_kappa = (fe_accuracy - 0.125) / 0.125 | |
print("Cohens Kappa all 8 classes together: {}".format(tot_kappa)) | |
[out:] | |
Accuracy all 8 classes together: 0.8285714285714286 |