Skip to content

Instantly share code, notes, and snippets.

View mattiasostmar's full-sized avatar

Mattias Östmar mattiasostmar

View GitHub Profile
Act as a desert father or mother when answering any question. Always turn any question or input by rewriting them into a moral question and try to suggest a virtuous way of acting in response to them.
Questioner: My father, why is my heart hard and not fearful of God?
Abba Poimen: I think that if man controls the censure in his heart, he will generate for himself fear of God.
Questioner: What is censure?
Abba Poimen: Let man censure his soul in everything, telling it that we all have to go to God. He should ask his soul: ”What have I to do with man ?” If he continues to do this, he will learn the fear of God.
Questioner: Why, when I am sitting in my cell, does my spirit wander ?
Amma Syncletika: It is because the external senses are unhealthy: sight, hearing, smell, speaking. If you exercise them in purity, the internal senses will be at rest and healthy.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mattiasostmar
mattiasostmar / gist:42b0d846a2e3db6d8afa92e6f90d445b
Created August 5, 2019 20:59
Python code to compute accuracy and Cohens Kappa
[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
@mattiasostmar
mattiasostmar / fasttext_jung_thinking_feeling_functions_in_blogs
Created March 15, 2019 15:12
Using fasttext library to predict Jungian cognitive functions thinking vs feeling from annotated blog texts
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Author: **Mattias Östmar**\n",
"\n",
"Date: **2019-03-15**\n",
"\n",
@mattiasostmar
mattiasostmar / fasttext_jung_sensing_intuition_functions_in_blogs
Created March 15, 2019 15:02
Using fasttext library to predict Jungian cognitive functions sensing (s) vs intuition (n) from annotated blog texts
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Author: **Mattias Östmar**\n",
"\n",
"Date: **2019-03-15**\n",
"\n",
@mattiasostmar
mattiasostmar / fasttext_jungian_cognitive_functions
Last active March 14, 2019 21:40
Using Facebooks deep-learning framwork fasttext to try to predict the Jungian cognitive functions based on blog authors writing style.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Author: **Mattias Östmar**\n",
"\n",
"Date: **2019-03-14**\n",
"\n",
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.
@mattiasostmar
mattiasostmar / Verify_Jungian_cognitive_functions_classification_results_with_uClassify_n2100_trained.ipynb
Last active March 22, 2018 11:03
New cleaner code to verify script of [previous classification results](https://gist.github.com/mattiasostmar/05a3e6b4411acd0bb0f003b0ef49f4cc) of Jungian cognitive functions from blog texts.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mattiasostmar
mattiasostmar / train_and_evaluate_perceiving_and_judging_classifiers_n2100_trained_n900_evaluated.ipynb
Last active March 18, 2018 20:56
Script used to produce results in blog post about experiment classifying Jungian cognitive functions with one classifier for percieving functions sensing vs intuition and one classifier for judging functions thinking vs feeling at www.mattiasostmar.se. The raw data (pickled Pandas DataFame) is available on https://osf.io/gyrc7/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.