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
# To be reminded | |
# 1) Classifying a single point can result in a true positive (truth = 1, guess = 1), a true negative (truth = 0, guess = 0), a false positive (truth = 0, guess = 1), or a false negative (truth = 1, guess = 0). | |
# 2) Accuracy measures how many classifications your algorithm got correct out of every classification it made. | |
# 3) Recall measures the percentage of the relevant items your classifier was able to successfully find. | |
# 4) Precision measures the percentage of items your classifier found that were actually relevant. | |
# 5) Precision and recall are tied to each other. As one goes up, the other will go down. | |
# 6) F1 score is a combination of precision and recall. | |
# 7) F1 score will be low if either precision or recall is low. | |
from sklearn.metrics import accuracy_score, recall_score, precision_score, f1_score |
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
/* Write a function solution(A); that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A. | |
For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5. | |
Given A = [1, 2, 3], the function should return 4. | |
Given A = [−1, −3], the function should return 1. | |
Write an efficient algorithm for the following assumptions: | |
N is an integer within the range [1..100,000]; | |
each element of array A is an integer within the range [−1,000,000..1,000,000]. */ | |
const A = [-1, -4]; |
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
# Wordpress php.ini configuration | |
upload_max_filesize = 32M | |
post_max_size = 32M | |
memory_limit = 128M | |
max_execution_time = 60 | |
max_input_vars = 10000 | |
max_input_time = 30 |
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
<?php /** | |
* Single Product Thumbnails | |
* | |
* @param array $args | |
* @param int $attachment_id | |
* @param string $image_size | |
* @param bool $main_image | |
* @return array | |
*/ | |
function bones_gallery_image_html_attachment_image_params ( $args, $attachment_id, $image_size, $main_image ) |
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 datasets and libraries | |
from sklearn.datasets import fetch_20newsgroups | |
from sklearn.naive_bayes import MultinomialNB | |
from sklearn.feature_extraction.text import CountVectorizer | |
#Category selection to compare different datasets of emails and evaluate how hard is to distinguish those. | |
the_categories = ['comp.sys.ibm.pc.hardware', 'rec.sport.hockey'] | |
train_emails = fetch_20newsgroups(categories = the_categories, subset = 'train', shuffle = True, random_state = 108) | |
test_emails = fetch_20newsgroups(categories = the_categories, subset = 'test', shuffle = True, random_state = 108) |
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
#include <cs50.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int get_card_length(long card) | |
{ | |
int length = 0; | |
while (card > 0) | |
{ |
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
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ } | |
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ } | |
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ } | |
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ } | |
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ } | |
@media (min-width:1281px) { /* hi-res laptops and desktops */ } |
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
CREATE TABLE friends ( | |
id INTEGER, | |
name TEXT, | |
birthday DATE | |
); | |
INSERT INTO friends (id, name, birthday) | |
VALUES | |
(1, 'Jane Doe', '1990-05-30'), | |
(2, 'Richard Stallman', '1953-03-16'), |
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
// Define a rooster | |
Rooster = {}; | |
// Return a morning rooster call | |
Rooster.announceDawn = () => { | |
return 'moo!'; | |
} | |
// Return hour as string | |
// Throws Error if hour is not between 0 and 23 inclusive |
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
const Calculate = { | |
factorial(number) { | |
if(number === 0) { | |
return 1; | |
} | |
for(let i = number - 1; i >= 1; i--) { | |
number *= i; | |
} | |
return number; | |
} |
NewerOlder