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 scala.math.pow | |
| import scala.util.Random | |
| // KEMALEMRECOLAK CHECK! DONE! | |
| @annotation.tailrec | |
| def digitXorerFunc(xorer:List[Int]) : Option[Int] = xorer match{ | |
| case Nil => None | |
| case xs::Nil => Some(xs) | |
| case xs::ys::Nil => Some(xs^ys) | |
| case xs::ys::zs => digitXorerFunc((xs^ys)::zs) |
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
| # 4,202,105 | |
| import matplotlib.pyplot as plt | |
| import pandas as pd | |
| import numpy as np | |
| import time | |
| from collections import Counter, deque, namedtuple | |
| from dataclasses import dataclass | |
| from pprint import pprint | |
| np.random.seed(105) |
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
| % Students, Optional Lessons, Required Lessons and Student Grades | |
| student(01, emre, comp). | |
| student(02, merve, com). | |
| student(03, eylul, elec). | |
| oLesson(03, logicprog, 5). | |
| oLesson(04, softengine, 6). | |
| rLesson(01, programming, 3). | |
| sLesson(01, 01, 40). | |
| sLesson(01, 02, 10). | |
| sLesson(03,02,0). |
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
| def balance(chars: List[Char], tst: Int, tst1:Int) : Boolean= { | |
| val pht = Array('(',')') | |
| if ((chars==List()) && tst == tst1) true | |
| else if(chars==List() && tst!= tst1)false | |
| else balance(chars.tail, tst + bool2int(chars.head==pht(0)) | |
| ,tst1+bool2int(chars.head==pht(1))) | |
| } |
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 time | |
| import numpy as np | |
| import collections | |
| import math | |
| from collections import namedtuple | |
| from itertools import chain | |
| from functools import wraps | |
| def bit_producer(mx): | |
| """ |
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 time | |
| import numpy as np | |
| import collections | |
| from collections import namedtuple | |
| from itertools import chain | |
| from functools import wraps | |
| def bit_producer(mx): | |
| """ | |
| DOCSTRING |
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 collection.mutable.{Map => MM} | |
| import scala.math.pow | |
| import scala.collection.mutable.ListBuffer | |
| import scala.collection.mutable.{ArrayBuffer} | |
| //Lookup array described. | |
| val lookupArr = Array(0xE, 0x4, 0xD, 0x1, 0x2, 0xF, 0xB, 0x8, 0x3, 0xA, 0x6, 0xC, 0x5, 0x9, 0x0, 0x7) | |
| //There is an logical it is being applied to a 4-digit by logical XOR. | |
| def xorerFunc(vl1 : String) = { | |
| var holderStr = 1 | |
| for(vlr<-0.to(3)) |
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
| def forward_selection(dataframe, predictors, response, max_features=8): | |
| def process_linear_model(predictors_): | |
| print(predictors_, "predictors") | |
| X = dataframe[predictors_].values | |
| y = dataframe[response] | |
| model = LinearRegression() | |
| model = model.fit(X,y) | |
| y_pred = model.predict(X) | |
| RSS = mean_squared_error(y, y_pred) * len(y) | |
| return (model, RSS, predictors_) |