Skip to content

Instantly share code, notes, and snippets.

View JasonShin's full-sized avatar
🦀
Composing Software

Jason Shin JasonShin

🦀
Composing Software
  • Sydney, Australia
View GitHub Profile

과외

과외 내용 여기에 정리해서 각종 시험이랑 앞으로 필요할때 보실수 있게 공유합니다


  1. 변수 (Variable): 변수는 데이터를 저장하는 데 사용되는 이름이 붙은 메모리 공간입니다. 변수를 선언하고 값을 할당할 수 있습니다. 파이썬에서는 변수를 선언할 때 데이터의 타입을 명시할 필요가 없습니다. 예를 들어, 다음과 같이 변수를 선언하고 값을 할당할 수 있습니다:
my_variable = 10
@JasonShin
JasonShin / train.ts
Created October 17, 2018 04:36
Training script for Kalimdor Titanic
const trainData = preprocess(titanicTrain);
const testData = preprocess(titanicTest);
const cls = new RandomForestClassifier({
nEstimator: 100,
});
cls.fit({ X: trainData.X, y: trainData.y });
const yPred = cls.predict(testData.X);
@JasonShin
JasonShin / preprocess.ts
Last active October 30, 2019 08:16
Kalimdor dataset preprocess
function getTitle(name) {
// example of name: "Braund, Mr. Owen Harris"
const rawTitle = name.split(' ')[1];
// TODO: fillna?
if (rawTitle.indexOf('Mr') !== -1) {
return 1;
} else if (rawTitle.indexOf('Miss') !== -1) {
return 2;
} else if (rawTitle.indexOf('Mrs') !== -1) {
return 3;
@JasonShin
JasonShin / import.ts
Created October 17, 2018 04:24
kalimdor medium intro import libs
import { RandomForestClassifier } from 'kalimdor/ensemble'; // model to train
import { accuracyScore } from 'kalimdor/metrics'; // measuring the training accuracy
import titanicTrain from './train.json'; // train data
import titanicTest from './test.json'; // test data
import titanicYtrue from './ytrue.json'; // y true from test data
@JasonShin
JasonShin / ytrue.json
Last active October 17, 2018 02:48
Kalimdor Titanic problem ytrue.json
[
{
"Survived": 0
},
{
"Survived": 1
},
{
"Survived": 0
},
@JasonShin
JasonShin / test.json
Created October 17, 2018 02:44
Kalimdor Titanic problem test.json
[
{
"PassengerId": 892,
"Pclass": 3,
"Name": "Kelly, Mr. James",
"Sex": "male",
"Age": 34.5,
"SibSp": 0,
"Parch": 0,
"Ticket": 330911,
@JasonShin
JasonShin / train.json
Created October 17, 2018 02:43
Kalimdor demo Titanic problem train.json
[
{
"PassengerId": 1,
"Survived": 0,
"Pclass": 3,
"Name": "Braund, Mr. Owen Harris",
"Sex": "male",
"Age": 22,
"SibSp": 1,
"Parch": 0,
import scala.io.StdIn.{readLine, readInt}
import scala.math._
import scala.collection.mutable.ArrayBuffer
import java.io.PrintWriter
import scala.io.Source
object ScalaTutorial {
def main(args: Array[String]) {
var i = 0
do {
const workshopsList = this.props.store.filteredWorkshops.map( (workshop) => {
let formattedRangeDate = getFormattedRangeDate(workshop.StartDate, workshop.EndDate, this.rageDateDelimeter);
let maxSeats = workshop.maximum;
let availables = workshop.maximum - workshop.BookingCount;
let monthDate = getMonthDate(workshop.StartDate);
});
const workshopsList = this.props.store.filteredWorkshops.map( (workshop) => {
let formattedRangeDate = getFormattedRangeDate(workshop.StartDate, workshop.EndDate, this.rageDateDelimeter);
let maxSeats = workshop.maximum;
let availables = workshop.maximum - workshop.BookingCount;
let monthDate = getMonthDate(workshop.StartDate);
});