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
def text_wrap(text, font, max_width): | |
"""Wrap text base on specified width. | |
This is to enable text of width more than the image width to be display | |
nicely. | |
@params: | |
text: str | |
text to wrap | |
font: obj | |
font of the text |
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<iostream> | |
void swap(int& a, int& b){ | |
// Swap 2 numbers using a temporary variable. | |
int temp; | |
temp = a; | |
a = b; | |
b = temp; | |
} | |
int* sort(int a[]){ |
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
pragma solidity ^0.4.24; | |
import {count} from './libraryF.sol'; | |
contract Math{ | |
using count for count.hold; | |
using count for uint; | |
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
pragma solidity ^0.4.24; | |
library count{ | |
struct hold{ | |
uint a; | |
} | |
function subUint(hold storage s, uint b) public returns(uint){ | |
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
0x6fC70d74Da267f7b551809993A45c9CF487955e5 |
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
let articleData={ | |
'logo':'public/images/medium.png', | |
article :[ | |
{ | |
id: 1, | |
author: 'eyong kevin', | |
title: 'Linear Regression: How to overcome underfitting with locally Weight Linear Regression(LWLR)', | |
description: 'Here, we will look at a technique for locally smoothing our estimates to better fit data', | |
url: 'https://itnext.io/linear-regression-how-to-overcome-underfitting-with-locally-weight-linear-regression-lwlr-e867f0cde4a4', | |
clapps: 39, |
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 React, { Component } from 'react'; | |
export default class Article extends Component { | |
render() { | |
return ( | |
<div className='item'> | |
<div className='image'> | |
<img src='public/images/articles/LWLR.jpg' /> | |
</div> | |
<div className='middle aligned content'> |
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
def lwlr(testPoint, xArr, yArr, k=0.1): | |
""" | |
Generate an estimate for any point in the x space | |
Parameters | |
---------- | |
testPoint: float | |
point in the x space | |
xArr : List | |
Our data |
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
def standRegres(xArr, yArr): | |
""" | |
Find weight given the data and the predicted value | |
Parameters | |
---------- | |
xArr : List | |
Our data | |
yArr: List |
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
# Load data | |
def loadDataSet(filename): | |
""" | |
load dataset into data-matrix and label-matrix | |
Parameters | |
---------- | |
filename : String | |
File path containing the data | |
NewerOlder