virtual machine – Virtualbox has a Hyper-V backend. How do I enable nested virtualization with this backend?

Virtualbox has its own nested virtualization – currently (2019) only for AMD-based virtualization.

However, if Hyper-V is enabled, Hyper-V fallback is used to start the virtual machine, rather than its own.

Hyper-V also supports nested virtualization. How do I tell Virtualbox to start the virtual machine with Hyper-V nested virtualization enabled?

Algorithms – Requirements for Artificial Intelligence and Machine Learning?

I'm a beginner in AI and ML. Before I jump into something or learn something, I have a habit of searching for the preconditions needed in my learning process, and I also need to get a clear definition on the subject.

I wanted to learn AI and ML, but I always get stuck in both definitions. Please help me to understand this terminology. I also wanted to know what algorithm they use. Besides, which mathematics should I know before getting started and what further research do I have to do?
Please familiarize yourself step by step before you deal with AI and ML. If possible, please provide a list of projects to work on after completing the course to improve my skills.

Machine Learning – Splitting a large matrix into a neural network

I'm trying to create a neural network that uses a 16x100x100 matrix and splits it into 100×100 pieces, passes them through a dense layer, and then reassembles them into a 16x10x10 matrix. I am having trouble creating the NetModel.

Is there a simpler way to send input to 16 PartLayers and then to each PartLayer to a LinearLayer?

time machine – lost space after removing the bootcamp partition through the Bootcamp Wizard

please help
I lost 150 GB of space after deleting the partition through the Boot Camp Assistant. Disk Utility can not restore or partition it as a disk
I tried rebuilding through Timemachine, but the hard drive looked the same size and I'm afraid the restore will not get the disk space back

Here is a Diskliste

Disk Utility does not partition

Reduction to the proof of undecidability of the problem: Machine M and N accept an infinite number of words

I have to struggle with the following problem:
Decide if this problem is decidable or not: For two given Turing machines M and N, there are infinitely many words that are accepted by both machine M and machine N. In other words, it's language {encodedMachine (M) #encodedMachine (N) | The intersection of language M and language N is infinite} decidable?

Intuitively, this seems to be an indisputable problem, and stopping the reduction could be used to prove it, but I have no idea how to begin this reduction.

Time Machine Backup is not restored to my internal hard disk drive

I had a serious hard drive failure and replaced the hard drive of my MacBook Mid 2012 13 "model with another one with 1 TB, running on the latest version of" Mojave "MacOS.

I am recovering from the Time Machine (TM) backup, and I am told that the restore is only now done on an SSD drive because APFS systems can only be restored to SSDs. I was not even aware that my Time Machine did backups in APFS.

So I'm really stuck here. Is this the very dirty way for Apple to tell me to buy a new MacBook with an SSD drive to continue using TM backups and other system features? How planned obsolescence? Or did I do something wrong? The complete message that appears when I perform the CMS + R recovery startup and try to recover from TM:

The system can not be restored to this disk because this is possible with APFS systems
only be restored to internal SSDs. Reinstall MacOS on this floppy disk and
Then use the Migration Assistant to transfer data from your backup
instead.

Python – Machine Learning, kNN and NB Algorithm. Is there a way to make the code more compact and appealing?

Here is my code! I want to reduce the number of lines and make them look neater. This class implements the Naïve Bayes machine learning algorithm. Please help as much as possible. Many Thanks!

I tried to split more functions and then call them to do the work. Is there any way I can do more? Is there also a way to make the for loops more compact?

Import Heapq
Import sys
Import math as m
from the decimal import decimal

Class entry:
def __init __ (self, attributes):
self.attributes = attributes
self.diabetes = "yes" if "yes" in attributes "no" if "no" in attributes ""

def __str __ (self):
string = ""
for attributeNum attribute in enumerate (self.attributes):
if attributeNum == len (self.attributes) - 1:
String + = str (attribute)
otherwise:
String + = str (attribute) + & # 39 ;, & # 39;
Return string

def set_ifdiabetes (self, diabetes):
Auto diabetes = diabetes

defective Euclidean (self, other_entry):
sum = 0.0
for i in range (len (self.attributes)):
sum + = m.pow (float (self.attributes[i]) - float (other_entry.attributes[i]2)
Return m.sqrt (sum)

Class NB:
def __init __ (self, training_data, testing_data):
self.training_data = training_data
self.testing_data = testing_data

self.training_entries = []
        self.testing_entries = []

        self.diabetes_yes = []
        self.diabetes_no = []

        self.mu_diabetesyes = []
        self.mu_diabetesno = []

        self.sigma_diabetesyes = []
        self.sigma_diabetesno = []

        self.num_attributes = 0

self.p_diabetesyes = 0
self.p_diabetesno = 0

self.num_diabetesyes = 0
self.num_diabetesno = 0

def train (self):
self.traincleandata ()
self.get_mus ()
self.get_sigmas ()

def traincleandata (self):
for line in self.training_data:
if self.num_attributes == 0:
self.num_attributes = len (line.split (& # 39 ;, & # 39;))
for i in range (self.num_attributes):
self.diabetes_yes.append ([])
self.diabetes_no.append ([])
self.mu_diabetesyes.append (0.0)
self.mu_diabetesno.append (0.0)
self.sigma_diabetesyes.append (0.0)
self.sigma_diabetesno.append (0.0)
params = line.split (& # 39 ;, & # 39;)
cleanparams = getcleanparams (params)
entry = entry (cleanparams)
self.training_entries.append (entry)

if (entry.diabetes == "yes"):
for i in range (len (entry.attributes) - 1):
self.diabetes_yes[i].append (Decimal (entry.attributes[i]))
self.p_diabetesyes + = 1
self.num_diabetesyes + = 1
otherwise:
for i in range (len (entry.attributes) - 1):
self.diabetes_no[i].append (Decimal (entry.attributes[i]))
self.p_diabetesno + = 1
self.num_diabetesno + = 1

self.p_diabetesyes = decimal (self.p_diabetesyes) / len (self.training_entries)
self.p_diabetesno = decimal (self.p_diabetesno) / len (self.training_entries)

def get_mus (self):
for i in range (self.num_attributes - 1):
self.mu_diabetesyes[i] = sum (self.diabetes_yes[i]) / len (self.diabetes_yes[i])
self.mu_diabetesno[i] = Sum (self.diabetes_no[i]) / len (self.diabetes_no[i])

def get_sigmas (self):

sigSumYes = [0] * self.num_attributes
sigSumNo = [0] * self.num_attributes

for i in range (self.num_attributes - 1):
for j in range (self.num_diabetesyes):
sigSumYes[i] + = m.pow (self.diabetes_yes[i][j]    - self.mu_diabetesyes[i]2)
self.sigma_diabetesyes[i] = m.sqrt (sigSumYes[i] / (len (self.diabetes_yes[i]) - 1))
for j in range (self.num_diabetesno):
sigSumNo[i] + = m.pow (self.diabetes_no[i][j]    - self.mu_diabetesno[i]2)
self.sigma_diabetesno[i] = m.sqrt (sigSumNo[i] / (len (self.diabetes_no[i]) - 1))

Def-test (self):
self.testcleandata ()
self.testalgo ()

def testcleandata (self):
for line in self.testing_data:
params = line.split (& # 39 ;, & # 39;)
cleanparams = getcleanparams (params)
entry = entry (cleanparams)
self.testing_entries.append (entry)

def testalgo (self):
Counter = 1
P_diabetesyes = [0] * self.num_attributes
P_diabetesno = [0] * self.num_attributes
for the entry in self.testing_entries:
pYesEntry = 1
pNoEntry = 1
for i in range (self.num_attributes - 1):
P_diabetesyes[i] = Decimal number ((1 / (self.sigma_diabetesyes[i] * m.sqrt (2 * m.pi)) * m.pow (m.e, (-m.pow (Decimal (entry.attributes[i]) - self.mu_diabetesyes[i], 2) / (2 * m.pow (self.sigma_diabetesyes[i]2)))))
P_diabetesno[i] = Decimal number ((1 / (self.sigma_diabetesno[i] * m.sqrt (2 * m.pi)) * m.pow (m.e, (-m.pow (Decimal (entry.attributes[i]) -self.mu_diabetesno[i], 2) / (2 * m.pow (self.sigma_diabetesno[i]2)))))
pYesEntry * = float (P_diabetesyes[i])
pNoEntry * = float (P_diabetesno[i])

pYesEntry * = float (self.p_diabetesyes)
pNoEntry * = float (self.p_diabetesno)

entry.set_ifdiabetes ("yes") if (pYesEntry / pNoEntry> = 1) else entry.set_ifdiabetes ("no")
Counter + = 1

Class kNN:
def __init __ (self, training_data, testing_data, k):
self.k = k
self.training_data = training_data
self.testing_data = testing_data
self.training_entries = []
        self.testing_entries = []

    def __str __ (self):
string_to_return = & # 39; & # 39;
for the entry in self.training_entries:
string_to_return = string_to_return + str (input) + & # 39;  n & # 39;
return string_to_return

def train (self):
for line in self.training_data:
params = line.split (& # 39 ;, & # 39;)
self.training_entries.append (entry (getcleanparams (params))

Def-test (self):
Counter = 1
for line in self.testing_data:
params = line.split (& # 39 ;, & # 39;)
self.testing_entries.append (entry (getcleanparams (params))
for testEntry in self.testing_entries:
next []
            for trainEntry in self.training_entries:
current_entry = (testEntry.euclidean (trainEntry), str (trainEntry.diabetes), str (trainEntry))
next.append (current_entry)
heapq.heapify (next)
next.sort ()
next = closest[:int(self.k)]
            num_diabetes = 0
for entry in the immediate vicinity:
if (entry[1] == "yes"):
num_diabetes + = 1
testEntry.set_ifdiabetes ("yes") if (num_diabetes> = int (self.k) / 2) else testEntry.set_ifdiabetes ("no")
Counter + = 1

def compare (self):
for the entry in self.testing_entries:
to press("-----------")
print (entry.compare (self.training_entries[0]))
print (entry)
print (self.training_entries[0])


def getcleanparams (params):
params_nospaceortab = []
    for param in params:
params_nospaceortab.append (param.strip ())
return params_nospaceortab


if __name__ == & # 39; __ main __ & # 39 ;:
training_file = open (sys.argv[1])
testing_file = open (sys.argv[2])
classifier_input = sys.argv[3]

    training_lines = training_file.readlines ()
training_cleanlines = getcleanparams (training_lines)

testing_lines = testing_file.readlines ()
testing_cleanlines = getcleanparams (testing_lines)

if classifier_input == "NB":
Classifier = NB (training_cleanlines, testing_cleanlines)
classifier.train ()
classifier.test ()
for the entry in classifier.testing_entries:
print (entry.diabetes)
elif "NN" in classifier_input:
classifier = kNN (training_cleanlines, testing_cleanlines, (classifier_input.index (& # 39; NN & # 39;) - 1))
classifier.train ()
classifier.test ()
for the entry in classifier.testing_entries:
print (entry.diabetes)
otherwise:
print ("Error: unknown classifier type")
sys.exit ()