This file contains hidden or 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
""" | |
Existing builtin decorators in panderas are ok, but they will raise an exception once a check fails. | |
If that is not the expected behavior, we can create our own decorators, to filter out corrupted rows to analyse them later without | |
creating a failure on the whole dataset. | |
In the following, we will create our own decorator which will filter out rows that did not pass our checks. | |
""" | |
import inspect |
This file contains hidden or 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
""" | |
The MIT License (MIT) | |
Copyright (c) 2018 David Mugisha | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
""" | |
My proposal to the exercise in the tutorial about Deep Learning for NLP with Pytorch | |
This is one is about Word Embeddings that encodes Lexical Semantics. | |
Continuous Bag-of-Words model (CBOW) is model that tries to predict a word given the context | |
of a few words before and after the target. | |
.. _Source: | |
http://pytorch.org/tutorials/beginner/nlp/word_embeddings_tutorial.html#exercise-computing-word-embeddings-continuous-bag-of-words | |
""" |
This file contains hidden or 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
""" | |
The MIT License (MIT) | |
Copyright (c) 2017 David Mugisha | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains hidden or 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
""" | |
Small example of function to reorder a data set. | |
""" | |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
def extract_k(labels, k): | |
"""Extract k percent of the dataset. |
This file contains hidden or 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 java.awt.geom.Point2D; | |
public class Sinus{ | |
/** | |
* Computes the sine of the angle between three points. | |
* Use the properties of the cross product between two vectors in a 2D euclidean space. | |
* The positive angles are counter-clockwise. | |
* @param pt1 Point defined by a location in a coordinate space | |
* @param pt2 Point defined by a location in a coordinate space | |
* @param pt3 Point defined by a location in a coordinate space |
This file contains hidden or 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
#!usr/bin/python | |
from random import randint | |
from math import pow | |
_lag1 = 55 | |
_lag2 = 24 | |
_modulus = 31 | |
#_firstterms = [randint(0,pow(2,_modulus)) for x in range(0,_lag1)] | |
_firstterms = [773, 744, 844, 228, 13, 1011, 691, 1, 1106, 730, 438, 102, 498, 1004, 111, 1230, 217, 1133, 703, 686, 78, 551, 60, 1009, 772, 922, 1223, 1205, 511, 876, 992, 162, 85, 296, 837, 755, 579, 268, 64, 194, 811, 645, 626, 140, 395, 1162, 322, 64, 97, 477, 117, 803, 1233, 288, 117, 594] |