Skip to content

Instantly share code, notes, and snippets.

@vincenttzc
vincenttzc / trainer_train_predict.py
Last active April 26, 2024 08:29
Huggingface Trainer train and predict
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, recall_score, precision_score, f1_score
import torch
from transformers import TrainingArguments, Trainer
from transformers import BertTokenizer, BertForSequenceClassification
from transformers import EarlyStoppingCallback
@vincenttzc
vincenttzc / gist:f427d8282e3f1684260c31e798cdf20c
Created November 11, 2017 10:01
RE Proj - Polyclinic with Age Dummy
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
@vincenttzc
vincenttzc / gist:418fc5f35f936b51793f461d331d0cca
Created November 11, 2017 10:00
RE Project - Hospital with Age Dummy
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
@vincenttzc
vincenttzc / gist:add4d9059034dddd498e16b8d61ad1bd
Created November 4, 2017 08:24
Real Estate Project - Polyclinic
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
@vincenttzc
vincenttzc / gist:12364c1e4a8bc1cfe6128e0ac8c654b5
Last active October 26, 2017 15:12
Real Estate Project Regressions
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
@vincenttzc
vincenttzc / gist:7b8d03095a3c0439cd7e7661f9593984
Created October 25, 2017 01:33
ECON207 HW 3 & 4 Tan Zhi Chong
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
@vincenttzc
vincenttzc / ECON207 Assignment 2
Created October 1, 2017 03:17
ECON207 Assignment 2
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
@vincenttzc
vincenttzc / ECON207 Assignment 1 (Part2)
Created September 15, 2017 00:58
ECON207 Assignment 1 (Part2)
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [