Covid Isolation Week 2 Day 7 – Palm Sunday

It’s been another quiet day – hardly any surprise there.

And rather than the usual Palm Sunday routine it’s been a day of chilling and catching up on a few internet projects.

Finally finally finally I worked out the issue with the front page of this site.
When ever I was changing the ‘page’ it stubbornly remained exactly the same. I spent ages looking at caching issues and even thought it might be an ISP issue to help lower internet traffic…. but Occam’s razor – it was me not remembering how I’d configured the template. That took a good few hours running through all the possibilities – and to help my memory in the future I’ve added it as a note to the home page in the edit suite. I’m bound to forget again.

The other success of the weekend has been setting up Skype on the TV – now we don’t have to all huddle around a phone or laptop.

So Palm Sunday always feels a strange start to holly week – Jesus riding into Jerusalem with rejoicing crowds celebrating his triumphal arrival. From the Old Testament, Zechariah described how the King of the Jews would come onto the scene as the triumphant, victorious leader.

Rejoice greatly, Daughter Zion!
Shout, Daughter Jerusalem!
See, your king comes to you,
righteous and victorious,
lowly and riding on a donkey,
on a colt, the foal of a donkey.

Zechariah 9:9

The crowds didn’t get the Messiah and Saviour they were expecting – he had bigger plans than just delivering his people from the Romans.

In Roman athletic competitions, the winners were awarded palm branches as a symbol of strength. And maybe the crowds were looking for him to be a strong warrior King – not the King of Peace. Certainly now Palm branches typically symbolise in Christianity the victory of the faithful over enemies of the soul. 

I remember a sermon last year where the Pastor explained that one theory on the waiving of Palm branches was more to do with an early Israelite Victory when they crossed the river Jordan into the promised land, rather than it being around the time of Sukkoth.

I need to track more on this down…


Covid-19 Symptom Check

Apart from the regular hang overs we’re all good…

Covid Isolation Week 2 Day 6 – finally feels like spring

The sun is shining, birds singing over the faint hum of far off lawn mowers – it really feels like the start of spring today. But everyone is stuck in-doors unable to do all the normal social activities.

So today’s surprise has been reports of a number of 5G masts getting attacked and set on fire:-

This has been driven by 2 nonsense theories that either 5G suppresses the immune system or that it is being used by the virus to target people! 

It’s amazing, almost astounding, what people will believe… and believe so strongly that they would go out and take direct action. However, if you did believe in conspiracy over cock-up this virus is perfect cover to implement some draconian controls on wider society. If you needed everyone off the streets to be able to do something clandestine then what better cover than a pandemic. Which could even extend to us all having to have a Covid-19 app on our phones to track who we’re interacting with – to trace any future outbreak. The tin-foil had brigade would have a field day with that I’m sure.

Anyway – as it’s so nice we’re all off out for a longish walk – you never know when it might rain.

Covid-19 Symptom Check

Still all ok…


Covid Isolation Week 2 Day 5 – 1 degree of separation

It’s creeping ever closer.

Today was the first day where people we know have started to lose loved ones… getting ever closer.
The preparations ramp up…millennium stadium converted to a hospital…2000 beds! That’s not planning for a few hundred deaths.
We’re getting to the really difficult part… as we all knew it would.

But I think the hardest bit will be when the infection rate and fatality rate starts to tail off. This has always struck me as the kind of infection that will have a double peak. People’s behaviour and desire to get out of lockdown will mean they take chances too soon. The hope is that by then we have some effective tests for carrying the antibodies.

But but but… it stuck me earlier today that this is the third Corona virus epidemic – SARS, MERS, SARS-2 (Covid-19). And the fatality rate has stepped up each time. So the real scary part is what’s next?

Statistically we have been overdue a pandemic for sometime – but it seems odd that the same family of viruses seem to be causing increasingly ferocious diseases. Is this a factor of the modern world or just nature as nature is…   

Covid-19 Symptom Check

All good in the hood 🙂


Covid Isolation Week 2 Day 3 – AA

There are more and more events getting cancelled further and further ahead – today’s latest casualty being the Edinburgh Fringe in August. It’s one of those events I’ve always fancied going to but never have gotten around to. I’m loathed to write a list of things I want to see when reality returns – but it’s tempting. For me lists like that either speak to dissatisfaction in your own life or they make a slave of your future self. I kind of started one with Isaac when he was very young – and stopped fairly soon as it just seemed I was trying to find cool things to do for the list – instead of focusing on him having a ‘cool’ life more generally. 

Anyway if they’re now cancelling events in August it looks like the Greenman festival won’t be far behind it. Which along with Glastonbury and the now annual trip to CentreParcs means all my holiday plans are no more… Which again (a frequent phase in these times) is all a bit surreal. I can’t remember ever not having some trip on the horizon to look forward to…and it’s hard to make definite plans with an indefinite lock down. We’re all assuming that after a few months of this it’ll be back to normal… but will it?

The government are already floating 6 months for how long disruption to life might last. Vaccines probably won’t be available for the general population until 2021. These are short term measures.

And what impact does that have on us, out culture, our ways of doing things?

On a call in work today they were discussing the mass mobilisation of home working – 1300+ people now distributed across the country all logging in remotely. And it struck me – what happens after 6 months of home working, why would you pull people back into offices. Could businesses realise considerable savings by having the majority of their staff home based and having fewer far smaller offices. How will that change the corporate culture, how will that change the social role that work plays for a lot of people – does it exacerbate the creeping disease of loneliness?

Interesting times and whatever happens I think the world we step out into after all this will be very different.

Covid-19 Symptom Check

So far so good – all fully fit…well apart from a couple of hangovers

Covid Isolation Week 1 Day 7 – Quiet Sunday

Life continues on…

This weekend has reminded me of weekends from my childhood where my parents would decide that they needed to get things sorted in the house and so that’s what happened. My parents would get engrossed in chores of various descriptions leaving me and my sister to entertain ourselves.

It led to the type of boredom that fuelled creativity after a lot of sitting around watching TV. Which makes me wonder if this imposed seclusion will lead to Isaac having more appreciation for things like school and the great outdoors. Probably not – but there is always hope.

I’m hoping that the week to come establishes more of a regular pattern for him and that it helps settle his mood. It’s been such a drastic change to everyone’s lives and at the age of 7 I think he struggles to comprehend what it all means. He had bad dreams last night which he refused to talk about – and given the increasing levels of frustration (brought on by not seeing anyone other than his parents) I’m worried how he will cope with another 11 weeks of this. But we’re continuing to talk to him and give him the time and space to discuss things on his mind…. fingers crossed this helps… it all feels a little bit like being in uncharted territory.

However, video calling has been a life saver along with letting him play Roblox online with Will… socialising in a way I suppose. Maybe this is the step change in society that make video calling mainstream.

Highlight of today – going for a long walk through the woods….with a few tricky moments where the rules of social distancing needed some thought as we encountered people on the paths…

Covid-19 Symptom Check

Everyone seems fit and healthy…no fever and no coughs today.
Although Steph was suffering with a sore throat yesterday and a headache – potentially linked to too much wine Friday night.

Covid Isolation Week 1 Day 5 – circadian rhythms

Today has been a tough one – and not just for us. From reading various social media channels it’s been the end of a tough old week, and lot’s of people have struggled. Juggling work and childcare…worrying where the next toilet roll is coming from, as well as the inevitable lecturing of parents who don’t seem to get the principal of isolation. It even stopped Isaac’s face-time call with one of his friends who had to go to bed early due to behaviour – Isaac had came close through the day as well.

New things today – restrictions on how many people are allowed into supermarkets at once, as well as enforced distancing while you wait to go in! Also social media is filling up with more videos of people who have caught the disease – and we’re not yet at the peak.

But, touch wood, we’re all doing good – apart from the cabin fever.

Still the biggest worry is one of the older generation of the family getting it, and although they are staying (for the most part) isolation isn’t something they’re getting as a concept. Popping to a shop if absolutely needed is ok….but popping to 5 shops and the bank is rolling those dice too many times. It’s also odd that, despite being all over 70 (Ken is 80+?), none of them have received a letter from the local NHS…maybe it’s different in Wales to how the media is portraying things. In any case the stern advice from us is to keep inside, keep safe, let us ferry food if the online deliveries aren’t an option.

Covid-19 Symptom Check

Isaac’s cold is no more – hoora!
Steph had a sore throat this morning (snoring maybe?)
…as for me I think my hay-fever has started…which the hypochondriac in me insists is Corona – but no temp 🙂 

Isaac’s random questions

To pass the time my cousin posed some questions for the kids on Facebook…here are Isaac’s answers:-

1. If you won a million pounds, what would you buy?
Isaac – a house and an iPhone

2. How long does it take to get to America?
Isaac – 2 hours

3. What does mum always say to you?
Isaac – go for a shower (Mum)… Do this do that (Dad)

4. What job would you like to do when you’re big?
ISAAC – fireman

5. What is the capital of England?
Isaac – London

6. Where do babies come from?
Isaac – mummy’s tummy simple

7. At what age do you become an adult?
Isaac – 20 (no longer a teenager)

8. If you could change one rule your family has, what would it be?
Isaac – going to school

9. If you could be a superhero, what superpower would you have?
Isaac – invisabliliy, speed, flight

10. What would you do to save the planet?
Isaac – recycle and fair trade

11. If you could eat one thing for the rest of your life, what would it be?
Isaac – Chocolate!

12. How much does it cost to buy a house?
Isaac – £100

13. Why do you think we should be nice to other people?
Isaac – so it will be a peaceful planet

14. What does love mean to you?
Isaac – someone cares for you and is always on your side and protect you

15. What are you scared of?
Isaac – pennywise and Corona virus

16. What is so important?
Isaac – mum, dad, school, family, friends

Covid Isolation Week 1 Day 4 – Quiet times

It’s amazing how quiet things are getting.

During the day there are still cars around and people going for walks but at night it gets eerily quiet – no one out driving to those social events or running errands. 

One thing I’ve noticed today is far more sirens – generally far off. Maybe it’s just because there’s less traffic generally so less of the normal city sounds but 3-4 times today I noticed sirens of ambulances or police cars… I pray who ever is in need to the sirens is ok – which again might be a factor in me noticing more.  

So the new routine continues…the new norm…
Get-up, Tea, sometimes breakfast, log on, work, calls, work, more calls, make tea, lunch, catch-up, hand over, shower (I know late), walk, maths, reading, science, snack, log back on, more calls, emails, apologies, tea, work-out, bed time, dinner, TV, bed…rinse repeat.

Its harder on Isaac I think. The initial joy at not having to go to school is slowly giving way to boredom, which isn’t helped by him being an only child. But we’re trying to keep him occupied and the school have been great at setting him things to do – he’s even started a diary.

It also struck me today how I’m slowly losing track of what day it is…without those typical, familiar queues it all just becomes another day… We’re not even through week 1 and I’m sure life will get more and more surreal…

In other events, I saw my mum today when she dropped off some cardboard for Isaac to build a castle from. Oh and some random flapjacks that she made to free up space in her kitchen. Think we’ll tackle the model building on the weekend (the flapjacks didn’t last a day). I’m trying to get him to build a model of Caldicot Castle but he has his heart set on Castle Coch – because red is his fave colour. 

Covid-19 Symptom Check

Apart from the tail end of Isaac’s cold we’re all ok 🙂


Machine Learning – Tutorial 5

Regression – Forecasting and Predicting

This next tutorial covers using the trained regression model to forecast out data. Full notes here:-

Key takeaways:-

import pandas as pd
import quandl, math, datetime #imports Math, datetime and Quandl
import numpy as np # support for arrays
from sklearn import preprocessing, model_selection, svm #machine learning and
from sklearn.linear_model import LinearRegression # regression
import matplotlib.pyplot as plt
from matplotlib import style


quandl.ApiConfig.api_key = "9qfnyWSTDUpx6uhNX2dc"

df = quandl.get('WIKI/GOOGL') #import data from Qunadl
# print (df.head()) # print out the head rows of the data to check what we're getting

# create a dataframe
df = df[['Adj. Open', 'Adj. High', 'Adj. Low', 'Adj. Close','Adj. Volume']]
df['HL_pct'] = ((df['Adj. High'] - df['Adj. Close']) / df['Adj. Close']) * 100
df['pct_Change'] = ((df['Adj. Close'] - df['Adj. Open']) / df['Adj. Open']) * 100

df = df[['Adj. Close','HL_pct','pct_Change','Adj. Volume']]

forecast_col = 'Adj. Close' # define what we're forcasting
df.fillna(-99999, inplace=True) #replaces missing data with an outlier value (-99999) rather that getting rid of any data

forecast_out = int(math.ceil(0.01*len(df))) # math.ceil rounds everything up to the nearest whole - so this formula takes 1% of the length of the datafram, rounds this up  and finally converts it to an interger

df['label'] = df[forecast_col].shift(-forecast_out) # so this adds a new column 'label' that contains the 'Adj. Close' value from ~1 days in future(?)

# print (df.head()) #just used to check data

X = np.array(df.drop(['label'],1)) # everything except the lable column; this returns a new dataframe that is then converted to a numpy array and stored as X
X = preprocessing.scale(X) # scale X before classifier - this can help with performance but can also take longer: can be skipped
X_lately = X[-forecast_out:] # used to predict against - note there are no y values for these to check against
X = X[:-forecast_out] # needs to happen after scaling

y = np.array(df['label'])
y = np.array(df['label']) # array of labels

### creat training and testing sets
X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, test_size=0.2) # 0.2 = 20% of the datafram

### Swapping different algorythms
# clf = LinearRegression() # simple linear regressions
# clf = LinearRegression(n_jobs=10) # linear regression using threading, 10 jobs at a time = faster
clf = LinearRegression(n_jobs=-1) # linear regression using threading with as many jobs as preprocessor will handle
# clf = svm.SVR() # base support vector regression
# clf = svm.SVR(kernel="poly") # support vector regression with specific kernel, y_train) # fit the data to the training data
accuracy = clf.score(X_test, y_test) # score it against test

# print(accuracy)

### pridiction - easy once the classifier is sets

forecast_set = clf.predict(X_lately)
print (forecast_set, accuracy, forecast_out)
df['Forecast'] = np.nan

last_date = df.iloc[-1].name
last_unix = last_date.timestamp()
one_day = 86400
next_unix = last_unix + one_day # moving to future dates not in dataset

## Set a new Data Frame including dates with the forecast values
for i in forecast_set:
    next_date = datetime.datetime.fromtimestamp(next_unix)
    next_unix += 86400
    df.loc[next_date] = [np.nan for _ in range(len(df.columns)-1)]+[i]

df['Adj. Close'].plot()
plt.savefig('ML_Tutorial5.svg', bbox_inches='tight') #bbox_inches='tight' minimises whitespace around the fig